File indexing completed on 2026-06-18 08:30:24
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _Select3D_SensitivePoly_HeaderFile
0015 #define _Select3D_SensitivePoly_HeaderFile
0016
0017 #include <gp_Circ.hxx>
0018 #include <Select3D_PointData.hxx>
0019 #include <Select3D_SensitiveSet.hxx>
0020 #include <Select3D_TypeOfSensitivity.hxx>
0021 #include <TColStd_HArray1OfInteger.hxx>
0022 #include <TColgp_HArray1OfPnt.hxx>
0023
0024
0025
0026
0027
0028 class Select3D_SensitivePoly : public Select3D_SensitiveSet
0029 {
0030 DEFINE_STANDARD_RTTIEXT(Select3D_SensitivePoly, Select3D_SensitiveSet)
0031 public:
0032
0033
0034
0035
0036 Standard_EXPORT Select3D_SensitivePoly(const Handle(SelectMgr_EntityOwner)& theOwnerId,
0037 const TColgp_Array1OfPnt& thePoints,
0038 const Standard_Boolean theIsBVHEnabled);
0039
0040
0041
0042
0043
0044 Standard_EXPORT Select3D_SensitivePoly(const Handle(SelectMgr_EntityOwner)& theOwnerId,
0045 const Handle(TColgp_HArray1OfPnt)& thePoints,
0046 const Standard_Boolean theIsBVHEnabled);
0047
0048
0049
0050
0051
0052 Standard_EXPORT Select3D_SensitivePoly(const Handle(SelectMgr_EntityOwner)& theOwnerId,
0053 const gp_Circ& theCircle,
0054 const Standard_Real theU1,
0055 const Standard_Real theU2,
0056 const Standard_Boolean theIsFilled = Standard_False,
0057 const Standard_Integer theNbPnts = 12);
0058
0059
0060
0061
0062 Standard_EXPORT Select3D_SensitivePoly(const Handle(SelectMgr_EntityOwner)& theOwnerId,
0063 const Standard_Boolean theIsBVHEnabled,
0064 const Standard_Integer theNbPnts = 6);
0065
0066
0067 Standard_EXPORT virtual Standard_Boolean Matches(SelectBasics_SelectingVolumeManager& theMgr,
0068 SelectBasics_PickResult& thePickResult)
0069 Standard_OVERRIDE;
0070
0071
0072 Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
0073
0074
0075 void Points3D(Handle(TColgp_HArray1OfPnt)& theHArrayOfPnt)
0076 {
0077 Standard_Integer aSize = myPolyg.Size();
0078 theHArrayOfPnt = new TColgp_HArray1OfPnt(1, aSize);
0079 for (Standard_Integer anIndex = 1; anIndex <= aSize; anIndex++)
0080 {
0081 theHArrayOfPnt->SetValue(anIndex, myPolyg.Pnt(anIndex - 1));
0082 }
0083 }
0084
0085
0086 void ArrayBounds(Standard_Integer& theLow, Standard_Integer& theUp) const
0087 {
0088 theLow = 0;
0089 theUp = myPolyg.Size() - 1;
0090 }
0091
0092
0093 gp_Pnt GetPoint3d(const Standard_Integer thePntIdx) const
0094 {
0095 return (thePntIdx >= 0 && thePntIdx < myPolyg.Size()) ? myPolyg.Pnt(thePntIdx) : gp_Pnt();
0096 }
0097
0098
0099
0100 Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
0101
0102
0103
0104 Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
0105
0106
0107 Standard_EXPORT virtual Standard_Integer Size() const Standard_OVERRIDE;
0108
0109
0110 Standard_EXPORT virtual Select3D_BndBox3d Box(const Standard_Integer theIdx) const
0111 Standard_OVERRIDE;
0112
0113
0114
0115 Standard_EXPORT virtual Standard_Real Center(const Standard_Integer theIdx,
0116 const Standard_Integer theAxis) const
0117 Standard_OVERRIDE;
0118
0119
0120 Standard_EXPORT virtual void Swap(const Standard_Integer theIdx1,
0121 const Standard_Integer theIdx2) Standard_OVERRIDE;
0122
0123
0124 Standard_EXPORT virtual void DumpJson(Standard_OStream& theOStream,
0125 Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0126
0127 protected:
0128
0129 Standard_EXPORT virtual Standard_Boolean overlapsElement(
0130 SelectBasics_PickResult& thePickResult,
0131 SelectBasics_SelectingVolumeManager& theMgr,
0132 Standard_Integer theElemIdx,
0133 Standard_Boolean theIsFullInside) Standard_OVERRIDE;
0134
0135
0136 Standard_EXPORT virtual Standard_Boolean elementIsInside(
0137 SelectBasics_SelectingVolumeManager& theMgr,
0138 Standard_Integer theElemIdx,
0139 Standard_Boolean theIsFullInside) Standard_OVERRIDE;
0140
0141
0142
0143 Standard_EXPORT virtual Standard_Real distanceToCOG(SelectBasics_SelectingVolumeManager& theMgr)
0144 Standard_OVERRIDE;
0145
0146 protected:
0147 Select3D_PointData myPolyg;
0148 mutable gp_Pnt myCOG;
0149 Handle(TColStd_HArray1OfInteger) mySegmentIndexes;
0150 Select3D_BndBox3d myBndBox;
0151
0152 Select3D_TypeOfSensitivity mySensType;
0153 mutable Standard_Boolean myIsComputed;
0154
0155 };
0156
0157 DEFINE_STANDARD_HANDLE(Select3D_SensitivePoly, Select3D_SensitiveSet)
0158
0159 #endif