File indexing completed on 2025-01-18 10:03:05
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 <TopTools_ListOfShape.hxx>
0026
0027
0028
0029 class BOPTools_Set
0030 {
0031 public:
0032
0033 DEFINE_STANDARD_ALLOC
0034
0035
0036 Standard_EXPORT BOPTools_Set();
0037 Standard_EXPORT virtual ~BOPTools_Set();
0038
0039 Standard_EXPORT BOPTools_Set(const Handle(NCollection_BaseAllocator)& theAllocator);
0040
0041
0042 Standard_EXPORT BOPTools_Set (const BOPTools_Set& theOther);
0043
0044 Standard_EXPORT BOPTools_Set& Assign (const BOPTools_Set& Other);
0045 BOPTools_Set& operator = (const BOPTools_Set& Other)
0046 {
0047 return Assign(Other);
0048 }
0049
0050 Standard_EXPORT const TopoDS_Shape& Shape() const;
0051
0052 Standard_EXPORT void Add (const TopoDS_Shape& theS, const TopAbs_ShapeEnum theType);
0053
0054 Standard_EXPORT Standard_Integer NbShapes() const;
0055
0056 Standard_EXPORT Standard_Boolean IsEqual (const BOPTools_Set& aOther) const;
0057
0058 bool operator==(const BOPTools_Set& theOther) const
0059 {
0060 return IsEqual(theOther);
0061 }
0062
0063 size_t GetSum() const { return mySum; }
0064
0065 protected:
0066
0067
0068 Standard_EXPORT void Clear();
0069
0070
0071 Handle(NCollection_BaseAllocator) myAllocator;
0072 TopTools_ListOfShape myShapes;
0073 TopoDS_Shape myShape;
0074 Standard_Integer myNbShapes;
0075 size_t mySum;
0076 Standard_Integer myUpper;
0077 };
0078
0079 namespace std
0080 {
0081 template <>
0082 struct hash<BOPTools_Set>
0083 {
0084 size_t operator()(const BOPTools_Set& theSet) const noexcept
0085 {
0086 return theSet.GetSum();
0087 }
0088 };
0089 }
0090
0091 #endif