File indexing completed on 2025-01-18 10:04:54
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 typedef NCollection_IndexedMap<Handle(SelectMgr_SensitiveEntity)> SelectMgr_IndexedMapOfHSensitive;
0026 typedef NCollection_DataMap<Handle(SelectMgr_EntityOwner), Standard_Integer> SelectMgr_MapOfOwners;
0027
0028
0029
0030
0031 class SelectMgr_SensitiveEntitySet : public BVH_PrimitiveSet3d
0032 {
0033 DEFINE_STANDARD_RTTIEXT(SelectMgr_SensitiveEntitySet, BVH_PrimitiveSet3d)
0034 public:
0035
0036
0037 Standard_EXPORT SelectMgr_SensitiveEntitySet (const Handle(Select3D_BVHBuilder3d)& theBuilder);
0038
0039 virtual ~SelectMgr_SensitiveEntitySet() {}
0040
0041
0042 Standard_EXPORT void Append (const Handle(SelectMgr_SensitiveEntity)& theEntity);
0043
0044
0045
0046 Standard_EXPORT void Append (const Handle(SelectMgr_Selection)& theSelection);
0047
0048
0049
0050 Standard_EXPORT void Remove (const Handle(SelectMgr_Selection)& theSelection);
0051
0052
0053 Standard_EXPORT virtual Select3D_BndBox3d Box (const Standard_Integer theIndex) const Standard_OVERRIDE;
0054
0055
0056 using BVH_PrimitiveSet3d::Box;
0057
0058
0059
0060 Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIndex,
0061 const Standard_Integer theAxis) const Standard_OVERRIDE;
0062
0063
0064 Standard_EXPORT virtual void Swap (const Standard_Integer theIndex1,
0065 const Standard_Integer theIndex2) Standard_OVERRIDE;
0066
0067
0068 Standard_EXPORT virtual Standard_Integer Size() const Standard_OVERRIDE;
0069
0070
0071 Standard_EXPORT const Handle(SelectMgr_SensitiveEntity)& GetSensitiveById (const Standard_Integer theIndex) const;
0072
0073
0074 const SelectMgr_IndexedMapOfHSensitive& Sensitives() const { return mySensitives; }
0075
0076
0077 const SelectMgr_MapOfOwners& Owners() const { return myOwnersMap; }
0078
0079
0080 Standard_Boolean HasEntityWithPersistence() const { return myHasEntityWithPersistence; }
0081
0082 protected:
0083
0084
0085 Standard_EXPORT void addOwner (const Handle(SelectMgr_EntityOwner)& theOwner);
0086
0087
0088 Standard_EXPORT void removeOwner (const Handle(SelectMgr_EntityOwner)& theOwner);
0089
0090 private:
0091
0092 SelectMgr_IndexedMapOfHSensitive mySensitives;
0093 SelectMgr_MapOfOwners myOwnersMap;
0094 Standard_Boolean myHasEntityWithPersistence;
0095 };
0096
0097 #endif