File indexing completed on 2025-01-18 10:04:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Select3D_SensitiveTriangle_HeaderFile
0018 #define _Select3D_SensitiveTriangle_HeaderFile
0019
0020 #include <Select3D_TypeOfSensitivity.hxx>
0021 #include <Select3D_SensitivePoly.hxx>
0022 #include <SelectMgr_SelectingVolumeManager.hxx>
0023
0024
0025
0026
0027
0028
0029 class Select3D_SensitiveTriangle : public Select3D_SensitiveEntity
0030 {
0031 public:
0032
0033
0034
0035 Standard_EXPORT Select3D_SensitiveTriangle (const Handle(SelectMgr_EntityOwner)& theOwnerId,
0036 const gp_Pnt& thePnt0,
0037 const gp_Pnt& thePnt1,
0038 const gp_Pnt& thePnt2,
0039 const Select3D_TypeOfSensitivity theType = Select3D_TOS_INTERIOR);
0040
0041
0042 Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
0043 SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
0044
0045
0046 void Points3D (gp_Pnt& thePnt0, gp_Pnt& thePnt1, gp_Pnt& thePnt2) const
0047 {
0048 thePnt0 = myPoints[0];
0049 thePnt1 = myPoints[1];
0050 thePnt2 = myPoints[2];
0051 }
0052
0053
0054 gp_Pnt Center3D() const { return myCentroid; }
0055
0056
0057 Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
0058
0059
0060
0061 Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
0062
0063
0064 virtual Standard_Boolean ToBuildBVH() const Standard_OVERRIDE { return Standard_False; }
0065
0066
0067 virtual Standard_Integer NbSubElements() const Standard_OVERRIDE { return 3; }
0068
0069 virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE { return myCentroid; }
0070
0071
0072 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0073
0074 DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveTriangle,Select3D_SensitiveEntity)
0075
0076 private:
0077
0078 Select3D_TypeOfSensitivity mySensType;
0079 gp_Pnt myCentroid;
0080 gp_Pnt myPoints[3];
0081 };
0082
0083 DEFINE_STANDARD_HANDLE(Select3D_SensitiveTriangle, Select3D_SensitiveEntity)
0084
0085 #endif