]> OCCT Git - occt-copy.git/commitdiff
0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation...
authorkgv <kgv@opencascade.com>
Wed, 1 May 2019 09:24:35 +0000 (12:24 +0300)
committernds <nds@opencascade.com>
Wed, 8 May 2019 09:35:16 +0000 (12:35 +0300)
SelectMgr_ViewerSelector::updatePoint3d() - added missing Abs() for computed tolerance
and added check to not attempt transforming undefined 3D point.

(cherry picked from commit b44bf0f8fe992510e38324f76729035ec1ecfc44)

src/SelectMgr/SelectMgr_ViewerSelector.cxx

index c693773d84f051ffc5c989a350d7e0f8f0365b37..76847d4f6922e472cc824ec7bfe481a617362739 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();
   }
 }