0029938: Visualization - SelectMgr_ViewerSelector::PickedPoint() should return point...
[occt.git] / src / Select3D / Select3D_SensitiveBox.cxx
index c363c1e..526ee3f 100644 (file)
@@ -86,23 +86,18 @@ Handle(Select3D_SensitiveEntity) Select3D_SensitiveBox::GetConnected()
 Standard_Boolean Select3D_SensitiveBox::Matches (SelectBasics_SelectingVolumeManager& theMgr,
                                                  SelectBasics_PickResult& thePickResult)
 {
-  thePickResult = SelectBasics_PickResult (RealLast(), RealLast());
-
   if (!theMgr.IsOverlapAllowed()) // check for inclusion
   {
     Standard_Boolean isInside = Standard_True;
     return theMgr.Overlaps (myBox.CornerMin(), myBox.CornerMax(), &isInside) && isInside;
   }
 
-  Standard_Real aDepth;
-  if (!theMgr.Overlaps (myBox.CornerMin(), myBox.CornerMax(), aDepth)) // check for overlap
+  if (!theMgr.Overlaps (myBox.CornerMin(), myBox.CornerMax(), thePickResult)) // check for overlap
   {
     return Standard_False;
   }
 
-  thePickResult = SelectBasics_PickResult (
-    aDepth, theMgr.DistToGeometryCenter (myCenter3d));
-
+  thePickResult.SetDistToGeomCenter (theMgr.DistToGeometryCenter(myCenter3d));
   return Standard_True;
 }