0029938: Visualization - SelectMgr_ViewerSelector::PickedPoint() should return point...
[occt.git] / src / Select3D / Select3D_SensitiveSegment.cxx
index 640e328..ef14661 100644 (file)
@@ -42,22 +42,17 @@ Select3D_SensitiveSegment::Select3D_SensitiveSegment (const Handle(SelectBasics_
 Standard_Boolean Select3D_SensitiveSegment::Matches (SelectBasics_SelectingVolumeManager& theMgr,
                                                      SelectBasics_PickResult& thePickResult)
 {
-  thePickResult = SelectBasics_PickResult (RealLast(), RealLast());
-
-  Standard_Real aDepth;
   if (!theMgr.IsOverlapAllowed()) // check for inclusion
   {
-    return theMgr.Overlaps (myStart, aDepth) && theMgr.Overlaps (myEnd, aDepth);
+    return theMgr.Overlaps (myStart, thePickResult) && theMgr.Overlaps (myEnd, thePickResult);
   }
 
-  if (!theMgr.Overlaps (myStart, myEnd, aDepth)) // check for overlap
+  if (!theMgr.Overlaps (myStart, myEnd, thePickResult)) // check for overlap
   {
     return Standard_False;
   }
 
-  thePickResult = SelectBasics_PickResult (aDepth,
-    theMgr.DistToGeometryCenter (CenterOfGeometry()));
-
+  thePickResult.SetDistToGeomCenter (theMgr.DistToGeometryCenter(CenterOfGeometry()));
   return Standard_True;
 }