File indexing completed on 2026-09-18 09:19:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _BOPTools_Set_HeaderFile
0016 #define _BOPTools_Set_HeaderFile
0017
0018 #include <Standard.hxx>
0019 #include <Standard_DefineAlloc.hxx>
0020 #include <Standard_Handle.hxx>
0021
0022 #include <TopoDS_Shape.hxx>
0023 #include <Standard_Integer.hxx>
0024 #include <TopAbs_ShapeEnum.hxx>
0025 #include <NCollection_DynamicArray.hxx>
0026
0027 class BOPTools_Set
0028 {
0029 public:
0030 DEFINE_STANDARD_ALLOC
0031
0032 Standard_EXPORT BOPTools_Set();
0033 Standard_EXPORT virtual ~BOPTools_Set();
0034
0035 Standard_EXPORT BOPTools_Set(const occ::handle<NCollection_BaseAllocator>& theAllocator);
0036
0037
0038 Standard_EXPORT BOPTools_Set(const BOPTools_Set& theOther);
0039
0040 Standard_EXPORT BOPTools_Set& Assign(const BOPTools_Set& Other);
0041
0042 BOPTools_Set& operator=(const BOPTools_Set& Other) { return Assign(Other); }
0043
0044 Standard_EXPORT const TopoDS_Shape& Shape() const;
0045
0046 Standard_EXPORT void Add(const TopoDS_Shape& theS, const TopAbs_ShapeEnum theType);
0047
0048 Standard_EXPORT int NbShapes() const;
0049
0050 Standard_EXPORT bool IsEqual(const BOPTools_Set& aOther) const;
0051
0052 bool operator==(const BOPTools_Set& theOther) const { return IsEqual(theOther); }
0053
0054 size_t GetSum() const { return mySum; }
0055
0056 protected:
0057 Standard_EXPORT void Clear();
0058
0059 occ::handle<NCollection_BaseAllocator> myAllocator;
0060 NCollection_DynamicArray<TopoDS_Shape> myShapes;
0061 TopoDS_Shape myShape;
0062 int myNbShapes;
0063 size_t mySum;
0064 int myUpper;
0065 };
0066
0067 namespace std
0068 {
0069 template <>
0070 struct hash<BOPTools_Set>
0071 {
0072 size_t operator()(const BOPTools_Set& theSet) const noexcept { return theSet.GetSum(); }
0073 };
0074 }
0075
0076 #endif