From: kgv Date: Wed, 1 May 2019 09:24:35 +0000 (+0300) Subject: 0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=3d1ab9a4df577ba455e6d748e0306351800229e1;p=occt-copy.git 0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation-persistent objects SelectMgr_ViewerSelector::updatePoint3d() - added missing Abs() for computed tolerance and added check to not attempt transforming undefined 3D point. --- diff --git a/src/SelectMgr/SelectMgr_ViewerSelector.cxx b/src/SelectMgr/SelectMgr_ViewerSelector.cxx index 0fb6c8666e..0099563c7f 100644 --- a/src/SelectMgr/SelectMgr_ViewerSelector.cxx +++ b/src/SelectMgr/SelectMgr_ViewerSelector.cxx @@ -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(); } }