0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation...
authorkgv <kgv@opencascade.com>
Wed, 1 May 2019 09:24:35 +0000 (12:24 +0300)
committerbugmaster <bugmaster@opencascade.com>
Mon, 6 May 2019 12:57:57 +0000 (15:57 +0300)
SelectMgr_ViewerSelector::updatePoint3d() - added missing Abs() for computed tolerance
and added check to not attempt transforming undefined 3D point.

src/SelectMgr/SelectMgr_ViewerSelector.cxx

index 0fb6c86..0099563 100644 (file)
@@ -81,6 +81,11 @@ void SelectMgr_ViewerSelector::updatePoint3d (SelectMgr_SortCriterion& theCriter
   {
     theCriterion.Point = thePickResult.PickedPoint();
   }
+  else if (!thePickResult.IsValid())
+  {
+    theCriterion.Point = thePickResult.PickedPoint();
+    return;
+  }
   else
   {
     theCriterion.Point = theMgr.DetectedPoint (theCriterion.Depth);
@@ -106,7 +111,7 @@ void SelectMgr_ViewerSelector::updatePoint3d (SelectMgr_SortCriterion& theCriter
   }
   else
   {
-    const Standard_Real aDistFromEye = (theCriterion.Point.XYZ() - myCameraEye.XYZ()).Dot (myCameraDir.XYZ());
+    const Standard_Real aDistFromEye = Abs ((theCriterion.Point.XYZ() - myCameraEye.XYZ()).Dot (myCameraDir.XYZ()));
     theCriterion.Tolerance = aDistFromEye * myCameraScale * theEntity->SensitivityFactor();
   }
 }