0030058: Visualization, Select3D_SensitivePrimitiveArray - the selection is not fast...
[occt.git] / src / Select3D / Select3D_SensitivePoly.cxx
index 5c19d68..20ffe84 100644 (file)
@@ -220,17 +220,23 @@ void Select3D_SensitivePoly::Swap (const Standard_Integer theIdx1,
 //           theIdx overlaps the current selecting
 //           volume
 //==================================================
-Standard_Boolean Select3D_SensitivePoly::overlapsElement (SelectBasics_SelectingVolumeManager& theMgr,
+Standard_Boolean Select3D_SensitivePoly::overlapsElement (SelectBasics_PickResult& thePickResult,
+                                                          SelectBasics_SelectingVolumeManager& theMgr,
                                                           Standard_Integer theElemIdx,
-                                                          SelectBasics_PickResult& thePickResult)
+                                                          Standard_Boolean theIsFullInside)
 {
   if (mySegmentIndexes.IsNull())
+  {
     return Standard_False;
+  }
+  else if (theIsFullInside)
+  {
+    return Standard_True;
+  }
 
   const Standard_Integer aSegmentIdx = mySegmentIndexes->Value (theElemIdx);
   gp_Pnt aPnt1 = myPolyg.Pnt3d (aSegmentIdx);
   gp_Pnt aPnt2 = myPolyg.Pnt3d (aSegmentIdx + 1);
-
   return theMgr.Overlaps (aPnt1, aPnt2, thePickResult);
 }
 
@@ -239,10 +245,15 @@ Standard_Boolean Select3D_SensitivePoly::overlapsElement (SelectBasics_Selecting
 // Purpose  :
 //==================================================
 Standard_Boolean Select3D_SensitivePoly::elementIsInside (SelectBasics_SelectingVolumeManager& theMgr,
-                                                          const Standard_Integer               theElemIdx)
+                                                          Standard_Integer theElemIdx,
+                                                          Standard_Boolean theIsFullInside)
 {
-  const Standard_Integer aSegmentIdx = mySegmentIndexes->Value (theElemIdx);
+  if (theIsFullInside)
+  {
+    return Standard_True;
+  }
 
+  const Standard_Integer aSegmentIdx = mySegmentIndexes->Value (theElemIdx);
   return theMgr.Overlaps (myPolyg.Pnt3d (aSegmentIdx + 0))
       && theMgr.Overlaps (myPolyg.Pnt3d (aSegmentIdx + 1));
 }