File indexing completed on 2026-09-22 08:58:41
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 Standard_EXPORT MeshVS_CommonSensitiveEntity(const occ::handle<SelectMgr_EntityOwner>& theOwner,
0031 const occ::handle<MeshVS_Mesh>& theParentMesh,
0032 const MeshVS_MeshSelectionMethod theSelMethod);
0033
0034
0035 Standard_EXPORT ~MeshVS_CommonSensitiveEntity() override;
0036
0037
0038 Standard_EXPORT int NbSubElements() const override;
0039
0040
0041 Standard_EXPORT int Size() const override;
0042
0043
0044 Standard_EXPORT Select3D_BndBox3d Box(const int theIdx) const override;
0045
0046
0047 Standard_EXPORT double Center(const int theIdx, const int theAxis) const override;
0048
0049
0050 Standard_EXPORT void Swap(const int theIdx1, const int theIdx2) override;
0051
0052
0053
0054 Standard_EXPORT Select3D_BndBox3d BoundingBox() override;
0055
0056
0057 Standard_EXPORT gp_Pnt CenterOfGeometry() const override;
0058
0059
0060 occ::handle<Select3D_SensitiveEntity> GetConnected() override
0061 {
0062 return new MeshVS_CommonSensitiveEntity(*this);
0063 }
0064
0065 protected:
0066
0067 Standard_EXPORT bool overlapsElement(SelectBasics_PickResult& thePickResult,
0068 SelectBasics_SelectingVolumeManager& theMgr,
0069 int theElemIdx,
0070 bool theIsFullInside) override;
0071
0072
0073 Standard_EXPORT bool elementIsInside(SelectBasics_SelectingVolumeManager& theMgr,
0074 int theElemIdx,
0075 bool theIsFullInside) override;
0076
0077
0078
0079 Standard_EXPORT double distanceToCOG(SelectBasics_SelectingVolumeManager& theMgr) override;
0080
0081
0082 Standard_EXPORT MeshVS_CommonSensitiveEntity(const MeshVS_CommonSensitiveEntity& theOther);
0083
0084 private:
0085
0086 gp_Pnt getVertexByIndex(const int theNodeIdx) const;
0087
0088 private:
0089 occ::handle<MeshVS_DataSource> myDataSource;
0090 NCollection_DynamicArray<int> myItemIndexes;
0091 MeshVS_MeshSelectionMethod mySelMethod;
0092
0093 int myMaxFaceNodes;
0094
0095 gp_Pnt myCOG;
0096 Select3D_BndBox3d myBndBox;
0097 };
0098
0099 #endif