Salome HOME
Fix Makefile.am
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_BuilderShape.hxx
1 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef _GEOMAlgo_BuilderShape_HeaderFile
24 #define _GEOMAlgo_BuilderShape_HeaderFile
25
26 #ifndef _TopoDS_Shape_HeaderFile
27 #include <TopoDS_Shape.hxx>
28 #endif
29 #ifndef _TopTools_ListOfShape_HeaderFile
30 #include <TopTools_ListOfShape.hxx>
31 #endif
32 #ifndef _TopTools_MapOfShape_HeaderFile
33 #include <TopTools_MapOfShape.hxx>
34 #endif
35 #ifndef _Standard_Boolean_HeaderFile
36 #include <Standard_Boolean.hxx>
37 #endif
38 #ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile
39 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
40 #endif
41 #ifndef _GEOMAlgo_Algo_HeaderFile
42 #include <GEOMAlgo_Algo.hxx>
43 #endif
44 class TopoDS_Shape;
45 class TopTools_ListOfShape;
46 class TopTools_IndexedDataMapOfShapeListOfShape;
47
48
49 #ifndef _Standard_HeaderFile
50 #include <Standard.hxx>
51 #endif
52 #ifndef _Standard_Macro_HeaderFile
53 #include <Standard_Macro.hxx>
54 #endif
55
56 //! Root class for algorithms that has shape as result <br>
57 class GEOMAlgo_BuilderShape  : public GEOMAlgo_Algo {
58
59 public:
60
61     void* operator new(size_t,void* anAddress) 
62       {
63         return anAddress;
64       }
65     void* operator new(size_t size) 
66       { 
67         return Standard::Allocate(size); 
68       }
69     void  operator delete(void *anAddress) 
70       { 
71         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
72       }
73  // Methods PUBLIC
74  // 
75
76 //!  Returns the result of algorithm <br>
77 Standard_EXPORT  const TopoDS_Shape& Shape() const;
78
79 //! Returns the list of shapes generated from the <br>
80 //!          shape theS. <br>
81 Standard_EXPORT virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS) ;
82
83 //! Returns the list of shapes modified from the <br>
84 //!          shape theS. <br>
85 Standard_EXPORT virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS) ;
86
87 //! Returns true if the shape theS has been deleted. <br>
88 Standard_EXPORT virtual  Standard_Boolean IsDeleted(const TopoDS_Shape& theS) ;
89
90 //! Returns true if the at least one shape(or sub-shape) <br>
91 //!          of arguments has been deleted. <br>
92 Standard_EXPORT   Standard_Boolean HasDeleted() const;
93
94 //! Returns true if the at least one shape(or sub-shape) <br>
95 //!          of arguments has generated shapes. <br>
96 Standard_EXPORT   Standard_Boolean HasGenerated() const;
97
98 //! Returns true if the at least one shape(or sub-shape) <br>
99 //!          of arguments has modified shapes. <br>
100 Standard_EXPORT   Standard_Boolean HasModified() const;
101
102
103 Standard_EXPORT  const TopTools_IndexedDataMapOfShapeListOfShape& ImagesResult() const;
104
105
106
107
108
109 protected:
110
111  // Methods PROTECTED
112  // 
113
114 //! Empty constructor <br>
115 Standard_EXPORT GEOMAlgo_BuilderShape();
116 Standard_EXPORT virtual ~GEOMAlgo_BuilderShape();
117
118 //!  Prepare information for history support <br>
119 Standard_EXPORT virtual  void PrepareHistory() ;
120
121
122  // Fields PROTECTED
123  //
124 TopoDS_Shape myShape;
125 TopTools_ListOfShape myHistShapes;
126 TopTools_MapOfShape myMapShape;
127 Standard_Boolean myHasDeleted;
128 Standard_Boolean myHasGenerated;
129 Standard_Boolean myHasModified;
130 TopTools_IndexedDataMapOfShapeListOfShape myImagesResult;
131
132
133 private: 
134
135  // Methods PRIVATE
136  // 
137
138
139  // Fields PRIVATE
140  //
141
142
143 };
144
145
146
147
148
149 // other Inline functions and methods (like "C++: function call" methods)
150 //
151
152
153 #endif