0029938: Visualization - SelectMgr_ViewerSelector::PickedPoint() should return point...
[occt.git] / src / Select3D / Select3D_SensitiveCircle.cxx
index 0682950..3048abc 100644 (file)
@@ -238,14 +238,10 @@ void Select3D_SensitiveCircle::BVH()
 Standard_Boolean Select3D_SensitiveCircle::Matches (SelectBasics_SelectingVolumeManager& theMgr,
                                                     SelectBasics_PickResult& thePickResult)
 {
-  Standard_Real aDepth     = RealLast();
-  Standard_Real aDistToCOG = RealLast();
-
   if (mySensType == Select3D_TOS_BOUNDARY)
   {
     if (!Select3D_SensitivePoly::Matches (theMgr, thePickResult))
     {
-      thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
       return Standard_False;
     }
   }
@@ -255,24 +251,21 @@ Standard_Boolean Select3D_SensitiveCircle::Matches (SelectBasics_SelectingVolume
     Points3D (anArrayOfPnt);
     if (!theMgr.IsOverlapAllowed())
     {
-      thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
       for (Standard_Integer aPntIdx = anArrayOfPnt->Lower(); aPntIdx <= anArrayOfPnt->Upper(); ++aPntIdx)
       {
-        if (!theMgr.Overlaps (anArrayOfPnt->Value (aPntIdx)))
+        if (!theMgr.Overlaps (anArrayOfPnt->Value(aPntIdx)))
+        {
           return Standard_False;
+        }
       }
       return Standard_True;
     }
 
-    if (!theMgr.Overlaps (anArrayOfPnt, Select3D_TOS_INTERIOR, aDepth))
+    if (!theMgr.Overlaps (anArrayOfPnt, Select3D_TOS_INTERIOR, thePickResult))
     {
-      thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
       return Standard_False;
     }
-    else
-    {
-      thePickResult = SelectBasics_PickResult (aDepth, theMgr.DistToGeometryCenter (myCenter3D));
-    }
+    thePickResult.SetDistToGeomCenter(distanceToCOG(theMgr));
   }
 
   return Standard_True;