File indexing completed on 2025-01-18 10:03:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef _BOPAlgo_BuilderShape_HeaderFile
0019 #define _BOPAlgo_BuilderShape_HeaderFile
0020
0021 #include <Standard.hxx>
0022 #include <Standard_DefineAlloc.hxx>
0023 #include <Standard_Handle.hxx>
0024
0025 #include <BOPAlgo_Algo.hxx>
0026 #include <BRepTools_History.hxx>
0027
0028 #include <NCollection_BaseAllocator.hxx>
0029 #include <TopoDS_Shape.hxx>
0030 #include <TopTools_ListOfShape.hxx>
0031 #include <TopTools_MapOfShape.hxx>
0032 class TopoDS_Shape;
0033
0034
0035
0036
0037
0038
0039
0040 class BOPAlgo_BuilderShape : public BOPAlgo_Algo
0041 {
0042 public:
0043
0044 DEFINE_STANDARD_ALLOC
0045
0046 public:
0047
0048
0049 const TopoDS_Shape& Shape() const { return myShape; }
0050
0051
0052 public:
0053
0054
0055 const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS)
0056 {
0057 if (myFillHistory && myHistory)
0058 return myHistory->Modified(theS);
0059 myHistShapes.Clear();
0060 return myHistShapes;
0061 }
0062
0063
0064 const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS)
0065 {
0066 if (myFillHistory && myHistory)
0067 return myHistory->Generated(theS);
0068 myHistShapes.Clear();
0069 return myHistShapes;
0070 }
0071
0072
0073
0074
0075 Standard_Boolean IsDeleted(const TopoDS_Shape& theS)
0076 {
0077 return (myFillHistory && myHistory ? myHistory->IsRemoved(theS) : Standard_False);
0078 }
0079
0080
0081 Standard_Boolean HasModified() const
0082 {
0083 return (myFillHistory && myHistory ? myHistory->HasModified() : Standard_False);
0084 }
0085
0086
0087 Standard_Boolean HasGenerated() const
0088 {
0089 return (myFillHistory && myHistory ? myHistory->HasGenerated() : Standard_False);
0090 }
0091
0092
0093 Standard_Boolean HasDeleted() const
0094 {
0095 return (myFillHistory && myHistory ? myHistory->HasRemoved() : Standard_False);
0096 }
0097
0098
0099 Handle(BRepTools_History) History()
0100 {
0101 if (myFillHistory)
0102 {
0103 if (myHistory.IsNull())
0104
0105
0106
0107 myHistory = new BRepTools_History();
0108
0109 return myHistory;
0110 }
0111
0112
0113
0114
0115 return NULL;
0116 }
0117
0118 public:
0119
0120
0121 void SetToFillHistory(const Standard_Boolean theHistFlag) { myFillHistory = theHistFlag; }
0122
0123
0124 Standard_Boolean HasHistory() const { return myFillHistory; }
0125
0126 protected:
0127
0128
0129 BOPAlgo_BuilderShape()
0130 :
0131 BOPAlgo_Algo(),
0132 myFillHistory(Standard_True)
0133 {}
0134
0135
0136 BOPAlgo_BuilderShape(const Handle(NCollection_BaseAllocator)& theAllocator)
0137 :
0138 BOPAlgo_Algo(theAllocator),
0139 myFillHistory(Standard_True)
0140 {}
0141
0142
0143 protected:
0144
0145
0146 virtual void Clear() Standard_OVERRIDE
0147 {
0148 BOPAlgo_Algo::Clear();
0149 myHistory.Nullify();
0150 myMapShape.Clear();
0151 }
0152
0153 protected:
0154
0155 TopoDS_Shape myShape;
0156
0157 TopTools_ListOfShape myHistShapes;
0158 TopTools_MapOfShape myMapShape;
0159
0160 Standard_Boolean myFillHistory;
0161 Handle(BRepTools_History) myHistory;
0162
0163 };
0164
0165 #endif