File indexing completed on 2025-01-18 10:04:52
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
0037 Standard_EXPORT Select3D_SensitivePoly (const Handle(SelectMgr_EntityOwner)& theOwnerId,
0038 const TColgp_Array1OfPnt& thePoints,
0039 const Standard_Boolean theIsBVHEnabled);
0040
0041
0042
0043
0044
0045 Standard_EXPORT Select3D_SensitivePoly (const Handle(SelectMgr_EntityOwner)& theOwnerId,
0046 const Handle(TColgp_HArray1OfPnt)& thePoints,
0047 const Standard_Boolean theIsBVHEnabled);
0048
0049
0050
0051
0052
0053 Standard_EXPORT Select3D_SensitivePoly (const Handle(SelectMgr_EntityOwner)& theOwnerId,
0054 const gp_Circ& theCircle,
0055 const Standard_Real theU1,
0056 const Standard_Real theU2,
0057 const Standard_Boolean theIsFilled = Standard_False,
0058 const Standard_Integer theNbPnts = 12);
0059
0060
0061
0062
0063 Standard_EXPORT Select3D_SensitivePoly (const Handle(SelectMgr_EntityOwner)& theOwnerId,
0064 const Standard_Boolean theIsBVHEnabled,
0065 const Standard_Integer theNbPnts = 6);
0066
0067
0068 Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
0069 SelectBasics_PickResult& thePickResult) 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,
0087 Standard_Integer& theUp) const
0088 {
0089 theLow = 0;
0090 theUp = myPolyg.Size() - 1;
0091 }
0092
0093
0094 gp_Pnt GetPoint3d (const Standard_Integer thePntIdx) const
0095 {
0096 return (thePntIdx >= 0 && thePntIdx < myPolyg.Size())
0097 ? myPolyg.Pnt (thePntIdx)
0098 : gp_Pnt();
0099 }
0100
0101
0102
0103 Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
0104
0105
0106
0107 Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
0108
0109
0110 Standard_EXPORT virtual Standard_Integer Size() const Standard_OVERRIDE;
0111
0112
0113 Standard_EXPORT virtual Select3D_BndBox3d Box (const Standard_Integer theIdx) const Standard_OVERRIDE;
0114
0115
0116
0117 Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIdx,
0118 const Standard_Integer theAxis) const Standard_OVERRIDE;
0119
0120
0121 Standard_EXPORT virtual void Swap (const Standard_Integer theIdx1,
0122 const Standard_Integer theIdx2) Standard_OVERRIDE;
0123
0124
0125 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0126
0127 protected:
0128
0129
0130 Standard_EXPORT virtual Standard_Boolean overlapsElement (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 (SelectBasics_SelectingVolumeManager& theMgr,
0137 Standard_Integer theElemIdx,
0138 Standard_Boolean theIsFullInside) Standard_OVERRIDE;
0139
0140
0141
0142 Standard_EXPORT virtual Standard_Real distanceToCOG (SelectBasics_SelectingVolumeManager& theMgr) Standard_OVERRIDE;
0143
0144 protected:
0145
0146 Select3D_PointData myPolyg;
0147 mutable gp_Pnt myCOG;
0148 Handle(TColStd_HArray1OfInteger) mySegmentIndexes;
0149 Select3D_BndBox3d myBndBox;
0150 Select3D_TypeOfSensitivity mySensType;
0151 mutable Standard_Boolean myIsComputed;
0152 };
0153
0154 DEFINE_STANDARD_HANDLE(Select3D_SensitivePoly, Select3D_SensitiveSet)
0155
0156 #endif