File indexing completed on 2026-09-14 09:15:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _SelectMgr_SensitiveEntitySet_HeaderFile
0017 #define _SelectMgr_SensitiveEntitySet_HeaderFile
0018
0019 #include <BVH_PrimitiveSet3d.hxx>
0020 #include <Select3D_BVHBuilder3d.hxx>
0021 #include <SelectMgr_EntityOwner.hxx>
0022 #include <SelectMgr_SensitiveEntity.hxx>
0023 #include <SelectMgr_Selection.hxx>
0024
0025
0026
0027
0028 class SelectMgr_SensitiveEntitySet : public BVH_PrimitiveSet3d
0029 {
0030 DEFINE_STANDARD_RTTIEXT(SelectMgr_SensitiveEntitySet, BVH_PrimitiveSet3d)
0031 public:
0032
0033 Standard_EXPORT SelectMgr_SensitiveEntitySet(
0034 const occ::handle<Select3D_BVHBuilder3d>& theBuilder);
0035
0036 ~SelectMgr_SensitiveEntitySet() override = default;
0037
0038
0039 Standard_EXPORT void Append(const occ::handle<SelectMgr_SensitiveEntity>& theEntity);
0040
0041
0042
0043 Standard_EXPORT void Append(const occ::handle<SelectMgr_Selection>& theSelection);
0044
0045
0046
0047 Standard_EXPORT void Remove(const occ::handle<SelectMgr_Selection>& theSelection);
0048
0049
0050 Standard_EXPORT Select3D_BndBox3d Box(const int theIndex) const override;
0051
0052
0053 using BVH_PrimitiveSet3d::Box;
0054
0055
0056
0057 Standard_EXPORT double Center(const int theIndex, const int theAxis) const override;
0058
0059
0060 Standard_EXPORT void Swap(const int theIndex1, const int theIndex2) override;
0061
0062
0063 Standard_EXPORT int Size() const override;
0064
0065
0066 Standard_EXPORT const occ::handle<SelectMgr_SensitiveEntity>& GetSensitiveById(
0067 const int theIndex) const;
0068
0069
0070 const NCollection_IndexedMap<occ::handle<SelectMgr_SensitiveEntity>>& Sensitives() const
0071 {
0072 return mySensitives;
0073 }
0074
0075
0076 const NCollection_DataMap<occ::handle<SelectMgr_EntityOwner>, int>& Owners() const
0077 {
0078 return myOwnersMap;
0079 }
0080
0081
0082 bool HasEntityWithPersistence() const { return myNbEntityWithPersistence > 0; }
0083
0084
0085 bool HasEntityWithFlipping() const { return myNbEntityWithFlipping > 0; }
0086
0087 protected:
0088
0089 Standard_EXPORT void addOwner(const occ::handle<SelectMgr_EntityOwner>& theOwner);
0090
0091
0092 Standard_EXPORT void removeOwner(const occ::handle<SelectMgr_EntityOwner>& theOwner);
0093
0094 private:
0095
0096 NCollection_IndexedMap<occ::handle<SelectMgr_SensitiveEntity>> mySensitives;
0097 NCollection_DataMap<occ::handle<SelectMgr_EntityOwner>, int> myOwnersMap;
0098 int myNbEntityWithPersistence;
0099 int myNbEntityWithFlipping;
0100
0101 };
0102
0103 #endif