#include <Select3D_InteriorSensitivePointSet.hxx>
+IMPLEMENT_STANDARD_RTTIEXT(Select3D_InteriorSensitivePointSet,Select3D_SensitiveSet)
+
+namespace {
+
// Internal class for creation of planar polygons
class Select3D_Plane
{
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)
{
}
}
-// =======================================================================
-// 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
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);
}
//=======================================================================
// =======================================================================
// 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);
}
// =======================================================================
// 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);
}
// =======================================================================
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)
+}