File indexing completed on 2025-01-18 10:04:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _MeshVS_CommonSensitiveEntity_Header
0017 #define _MeshVS_CommonSensitiveEntity_Header
0018
0019 #include <MeshVS_DataSource.hxx>
0020 #include <MeshVS_Mesh.hxx>
0021 #include <MeshVS_MeshSelectionMethod.hxx>
0022 #include <Select3D_SensitiveSet.hxx>
0023
0024
0025 class MeshVS_CommonSensitiveEntity : public Select3D_SensitiveSet
0026 {
0027 DEFINE_STANDARD_RTTIEXT (MeshVS_CommonSensitiveEntity, Select3D_SensitiveSet)
0028 public:
0029
0030
0031 Standard_EXPORT MeshVS_CommonSensitiveEntity (const Handle(SelectMgr_EntityOwner)& theOwner,
0032 const Handle(MeshVS_Mesh)& theParentMesh,
0033 const MeshVS_MeshSelectionMethod theSelMethod);
0034
0035
0036 Standard_EXPORT virtual ~MeshVS_CommonSensitiveEntity();
0037
0038
0039 Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
0040
0041
0042 Standard_EXPORT virtual Standard_Integer Size() const Standard_OVERRIDE;
0043
0044
0045 Standard_EXPORT virtual Select3D_BndBox3d Box (const Standard_Integer theIdx) const Standard_OVERRIDE;
0046
0047
0048 Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIdx,
0049 const Standard_Integer theAxis) const Standard_OVERRIDE;
0050
0051
0052 Standard_EXPORT virtual void Swap (const Standard_Integer theIdx1,
0053 const Standard_Integer theIdx2) Standard_OVERRIDE;
0054
0055
0056
0057 Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
0058
0059
0060 Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
0061
0062
0063 virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE { return new MeshVS_CommonSensitiveEntity (*this); }
0064
0065 protected:
0066
0067
0068 Standard_EXPORT virtual Standard_Boolean overlapsElement (SelectBasics_PickResult& thePickResult,
0069 SelectBasics_SelectingVolumeManager& theMgr,
0070 Standard_Integer theElemIdx,
0071 Standard_Boolean theIsFullInside) Standard_OVERRIDE;
0072
0073
0074 Standard_EXPORT virtual Standard_Boolean elementIsInside (SelectBasics_SelectingVolumeManager& theMgr,
0075 Standard_Integer theElemIdx,
0076 Standard_Boolean theIsFullInside) Standard_OVERRIDE;
0077
0078
0079 Standard_EXPORT virtual Standard_Real distanceToCOG (SelectBasics_SelectingVolumeManager& theMgr) Standard_OVERRIDE;
0080
0081
0082 Standard_EXPORT MeshVS_CommonSensitiveEntity (const MeshVS_CommonSensitiveEntity& theOther);
0083
0084 private:
0085
0086
0087 gp_Pnt getVertexByIndex (const Standard_Integer theNodeIdx) const;
0088
0089 private:
0090
0091 Handle(MeshVS_DataSource) myDataSource;
0092 NCollection_Vector<Standard_Integer> myItemIndexes;
0093 MeshVS_MeshSelectionMethod mySelMethod;
0094 Standard_Integer myMaxFaceNodes;
0095 gp_Pnt myCOG;
0096 Select3D_BndBox3d myBndBox;
0097
0098 };
0099
0100 DEFINE_STANDARD_HANDLE (MeshVS_CommonSensitiveEntity, Select3D_SensitiveSet)
0101
0102 #endif