]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #18882 (Tuleap): Improve calculation of projection point.
authorvsv <vsv@opencascade.com>
Mon, 6 Apr 2020 14:36:58 +0000 (17:36 +0300)
committervsv <vsv@opencascade.com>
Mon, 6 Apr 2020 14:36:58 +0000 (17:36 +0300)
src/PartSet/PartSet_Tools.cpp

index 2bb8ccb2df0637eb04b28de67fc7f691e4ec0868..e67624da03a47f8323366da391ac92d5706210f5 100644 (file)
@@ -115,18 +115,14 @@ gp_Pnt PartSet_Tools::convertClickToPoint(QPoint thePoint, Handle(V3d_View) theV
   if (theView.IsNull())
     return gp_Pnt();
 
-  V3d_Coordinate XEye, YEye, ZEye, XAt, YAt, ZAt;
-  theView->Eye(XEye, YEye, ZEye);
-
+  V3d_Coordinate XAt, YAt, ZAt;
   theView->At(XAt, YAt, ZAt);
-  gp_Pnt EyePoint(XEye, YEye, ZEye);
   gp_Pnt AtPoint(XAt, YAt, ZAt);
 
-  if (EyePoint.Distance(AtPoint) < Precision::Confusion())
-    return gp_Pnt();
-
-  gp_Vec EyeVector(EyePoint, AtPoint);
-  gp_Dir EyeDir(EyeVector);
+  double aX, aY, aZ;
+  theView->Proj(aX, aY, aZ);
+  gp_Dir EyeDir(aX, aY, aZ);
+  EyeDir.Reverse();
 
   gp_Pln PlaneOfTheView = gp_Pln(AtPoint, EyeDir);
   Standard_Real X, Y, Z;