0031313: Foundation Classes - Dump improvement for classes
[occt.git] / src / Select3D / Select3D_InteriorSensitivePointSet.cxx
index b86c23c..564e3f7 100644 (file)
 
 #include <Select3D_InteriorSensitivePointSet.hxx>
 
+IMPLEMENT_STANDARD_RTTIEXT(Select3D_InteriorSensitivePointSet,Select3D_SensitiveSet)
+
+namespace {
+
 // Internal class for creation of planar polygons
 class Select3D_Plane
 {
@@ -74,12 +78,15 @@ private:
   Standard_Boolean                myIsInitialized;
 };
 
+} // anonymous namespace
+
+
 // =======================================================================
 // function : Select3D_InteriorSensitivePointSet
 // purpose  : Splits the given point set thePoints onto planar convex
 //            polygons
 // =======================================================================
-Select3D_InteriorSensitivePointSet::Select3D_InteriorSensitivePointSet (const Handle(SelectBasics_EntityOwner)& theOwnerId,
+Select3D_InteriorSensitivePointSet::Select3D_InteriorSensitivePointSet (const Handle(SelectMgr_EntityOwner)& theOwnerId,
                                                                         const TColgp_Array1OfPnt& thePoints)
   : Select3D_SensitiveSet (theOwnerId)
 {
@@ -171,17 +178,6 @@ Select3D_InteriorSensitivePointSet::Select3D_InteriorSensitivePointSet (const Ha
   }
 }
 
-// =======================================================================
-// function : Matches
-// purpose  : Checks whether the point set overlaps current selecting
-//            volume
-// =======================================================================
-Standard_Boolean Select3D_InteriorSensitivePointSet::Matches (SelectBasics_SelectingVolumeManager& theMgr,
-                                                              SelectBasics_PickResult& thePickResult)
-{
-  return Select3D_SensitiveSet::Matches (theMgr, thePickResult);
-}
-
 // =======================================================================
 // function : GetPoints
 // purpose  : Initializes the given array theHArrayOfPnt by 3d
@@ -242,11 +238,9 @@ Select3D_BndBox3d Select3D_InteriorSensitivePointSet::Box (const Standard_Intege
 Standard_Real Select3D_InteriorSensitivePointSet::Center (const Standard_Integer theIdx,
                                                           const Standard_Integer theAxis) const
 {
-  Standard_Integer aPolygIdx = myPolygonsIdxs->Value (theIdx);
-  const gp_XYZ& aCOG = myPlanarPolygons.Value (aPolygIdx)->CenterOfGeometry().XYZ();
-  Standard_Real aCenter = theAxis == 0 ? aCOG.X() : (theAxis == 1 ? aCOG.Y() : aCOG.Z());
-
-  return aCenter;
+  const Standard_Integer aPolygIdx = myPolygonsIdxs->Value (theIdx);
+  const gp_Pnt aCOG = myPlanarPolygons.Value (aPolygIdx)->CenterOfGeometry();
+  return aCOG.Coord (theAxis - 1);
 }
 
 //=======================================================================
@@ -265,18 +259,18 @@ void Select3D_InteriorSensitivePointSet::Swap (const Standard_Integer theIdx1,
 
 // =======================================================================
 // function : overlapsElement
-// purpose  : Checks whether the planar convex polygon with index theIdx
-//            in myPlanarPolygons overlaps the current selecting volume
+// purpose  :
 // =======================================================================
-Standard_Boolean Select3D_InteriorSensitivePointSet::overlapsElement (SelectBasics_SelectingVolumeManager& theMgr,
+Standard_Boolean Select3D_InteriorSensitivePointSet::overlapsElement (SelectBasics_PickResult& thePickResult,
+                                                                      SelectBasics_SelectingVolumeManager& theMgr,
                                                                       Standard_Integer theElemIdx,
-                                                                      Standard_Real& theMatchDepth)
+                                                                      Standard_Boolean )
 {
   Standard_Integer aPolygIdx = myPolygonsIdxs->Value (theElemIdx);
   const Handle(Select3D_SensitivePoly)& aPolygon = myPlanarPolygons.Value (aPolygIdx);
   Handle(TColgp_HArray1OfPnt) aPoints;
   aPolygon->Points3D (aPoints);
-  return theMgr.Overlaps (aPoints, Select3D_TOS_INTERIOR, theMatchDepth);
+  return theMgr.Overlaps (aPoints, Select3D_TOS_INTERIOR, thePickResult);
 }
 
 // =======================================================================
@@ -284,10 +278,11 @@ Standard_Boolean Select3D_InteriorSensitivePointSet::overlapsElement (SelectBasi
 // purpose  :
 // =======================================================================
 Standard_Boolean Select3D_InteriorSensitivePointSet::elementIsInside (SelectBasics_SelectingVolumeManager& theMgr,
-                                                                      const Standard_Integer               theElemIdx)
+                                                                      Standard_Integer theElemIdx,
+                                                                      Standard_Boolean theIsFullInside)
 {
-  Standard_Real aDummy;
-  return overlapsElement (theMgr, theElemIdx, aDummy);
+  SelectBasics_PickResult aDummy;
+  return overlapsElement (aDummy, theMgr, theElemIdx, theIsFullInside);
 }
 
 // =======================================================================
@@ -320,20 +315,23 @@ gp_Pnt Select3D_InteriorSensitivePointSet::CenterOfGeometry() const
   return myCOG;
 }
 
-//=======================================================================
-// function : BVH
-// purpose  : Builds BVH tree for the point set
-//=======================================================================
-void Select3D_InteriorSensitivePointSet::BVH()
-{
-  BVH();
-}
-
 //=======================================================================
 // function : NbSubElements
 // purpose  : Returns the amount of points in set
 //=======================================================================
-Standard_Integer Select3D_InteriorSensitivePointSet::NbSubElements()
+Standard_Integer Select3D_InteriorSensitivePointSet::NbSubElements() const
 {
   return myPlanarPolygons.Length();
 }
+
+// =======================================================================
+// function : DumpJson
+// purpose  :
+// =======================================================================
+void Select3D_InteriorSensitivePointSet::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveSet)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBndBox)
+}