Salome HOME
This commit was generated by cvs2git to create tag 'StableState1'.
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_Builder.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 //
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
8 //
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19
20 #ifndef _GEOMAlgo_Builder_HeaderFile
21 #define _GEOMAlgo_Builder_HeaderFile
22
23 #ifndef _NMTTools_PDSFiller_HeaderFile
24 #include <NMTTools_PDSFiller.hxx>
25 #endif
26 #ifndef _TopTools_ListOfShape_HeaderFile
27 #include <TopTools_ListOfShape.hxx>
28 #endif
29 #ifndef _Standard_Integer_HeaderFile
30 #include <Standard_Integer.hxx>
31 #endif
32 #ifndef _TopTools_MapOfShape_HeaderFile
33 #include <TopTools_MapOfShape.hxx>
34 #endif
35 #ifndef _BRepAlgo_Image_HeaderFile
36 #include <BRepAlgo_Image.hxx>
37 #endif
38 #ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile
39 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
40 #endif
41 #ifndef _TopTools_IndexedDataMapOfShapeShape_HeaderFile
42 #include <TopTools_IndexedDataMapOfShapeShape.hxx>
43 #endif
44 #ifndef _GEOMAlgo_BuilderShape_HeaderFile
45 #include <GEOMAlgo_BuilderShape.hxx>
46 #endif
47 #ifndef _Standard_Boolean_HeaderFile
48 #include <Standard_Boolean.hxx>
49 #endif
50 #ifndef _TopAbs_ShapeEnum_HeaderFile
51 #include <TopAbs_ShapeEnum.hxx>
52 #endif
53 class NMTTools_DSFiller;
54 class TopoDS_Shape;
55 class TopTools_ListOfShape;
56 class BRepAlgo_Image;
57
58
59 #ifndef _Standard_HeaderFile
60 #include <Standard.hxx>
61 #endif
62 #ifndef _Standard_Macro_HeaderFile
63 #include <Standard_Macro.hxx>
64 #endif
65
66
67 class GEOMAlgo_Builder  : public GEOMAlgo_BuilderShape {
68
69 public:
70
71     void* operator new(size_t,void* anAddress) 
72       {
73         return anAddress;
74       }
75     void* operator new(size_t size) 
76       { 
77         return Standard::Allocate(size); 
78       }
79     void  operator delete(void *anAddress) 
80       { 
81         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
82       }
83  // Methods PUBLIC
84  // 
85
86 //!  Empty constructor <br>
87 Standard_EXPORT GEOMAlgo_Builder();
88 Standard_EXPORT virtual ~GEOMAlgo_Builder();
89
90 //!  Performs calculations <br>
91 Standard_EXPORT virtual  void Perform() ;
92
93 //!  Performs calculations using prepared DSFiller <br>
94 //!           object theDSF <br>
95 Standard_EXPORT virtual  void PerformWithFiller(const NMTTools_DSFiller& theDSF) ;
96
97 //!  Adds argument theShape of the operation <br>
98 Standard_EXPORT virtual  void AddShape(const TopoDS_Shape& theShape) ;
99
100 //!  Clears internal fields and arguments <br>
101 Standard_EXPORT virtual  void Clear() ;
102
103 //!  Returns the arguments of the operation <br>
104 Standard_EXPORT  const TopTools_ListOfShape& Shapes() const;
105
106 //! Returns the  list of shapes generated from the <br>
107 //!          shape theS. <br>
108 Standard_EXPORT virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS) ;
109
110 //! Returns the list of shapes modified from the shape <br>
111 //!          theS. <br>
112 Standard_EXPORT virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS) ;
113
114 //! Returns true if the shape theS has been deleted. <br>
115 Standard_EXPORT virtual  Standard_Boolean IsDeleted(const TopoDS_Shape& theS) ;
116
117 //!  Adds arguments of the operation as <br>
118 //!           shapes of upper level of container shape theShape <br>
119 Standard_EXPORT   void AddCompound(const TopoDS_Shape& theShape) ;
120
121 //! Returns list of arguments of type theType <br>
122 Standard_EXPORT  const TopTools_ListOfShape& Shapes1(const Standard_Integer theType) const;
123
124 //! Returns image shapes <br>
125 Standard_EXPORT  const BRepAlgo_Image& Images() const;
126
127 //! Returns split-parts of shapes that have <br>
128 //!          state IN for the domain of shape theShape <br>
129 Standard_EXPORT  const TopTools_ListOfShape& InParts(const TopoDS_Shape& theShape) const;
130
131
132
133
134
135 protected:
136
137  // Methods PROTECTED
138  // 
139
140 //!  Prepare information for history support <br>
141 Standard_EXPORT virtual  void PrepareHistory() ;
142
143 //!  Clears internal fields <br>
144 Standard_EXPORT virtual  void ClearInternals() ;
145
146 //!  Provides preparing actions <br>
147 Standard_EXPORT virtual  void Prepare() ;
148
149 //!  Provides post-tratment actions <br>
150 Standard_EXPORT virtual  void PostTreat() ;
151
152 //!  Append the argument theShape to <br>
153 //!           typified lists of arguments myShapes1 <br>
154 Standard_EXPORT   void AddShape1(const TopoDS_Shape& theShape) ;
155
156 //! Build the resulting shapes of type theType <br>
157 Standard_EXPORT virtual  void BuildResult(const TopAbs_ShapeEnum theType) ;
158
159 //! Fill Images for vertices <br>
160 Standard_EXPORT   void FillImagesVertices() ;
161
162 //! Fill Images for edges <br>
163 Standard_EXPORT   void FillImagesEdges() ;
164
165 //! Fill Images for faces <br>
166 Standard_EXPORT   void FillImagesFaces() ;
167
168 //! For each interferred face find split edges <br>
169 //!          that are in 2-D domain of the face <br>
170 Standard_EXPORT   void FillIn2DParts() ;
171
172 //! Build draft faces <br>
173 Standard_EXPORT   void BuildSplitFaces() ;
174
175 //! Among draft faces find same domain faces <br>
176 Standard_EXPORT   void FillSameDomainFaces() ;
177
178 //! Fill Images for faces <br>
179 //!          taking into account same domain faces <br>
180 Standard_EXPORT   void FillImagesFaces1() ;
181
182 //! Update Images for faces by <br>
183 //!          internal vertices <br>
184 Standard_EXPORT   void FillInternalVertices() ;
185
186 //!  Fill Images for Wires, Shells, Compsolids, Compounds <br>
187 Standard_EXPORT   void FillImagesContainers(const TopAbs_ShapeEnum theType) ;
188
189 //!  Fill Images for solids <br>
190 Standard_EXPORT   void FillImagesSolids() ;
191
192 //! For each interferred solid find split faces <br>
193 //!          that are in 3-D domain of the solid <br>
194 Standard_EXPORT   void FillIn3DParts() ;
195
196 //! Build draft solids <br>
197 Standard_EXPORT   void BuildSplitSolids() ;
198
199 //!  Update draft solids by <br>
200 //!           internal shells, edges, vertices <br>
201 Standard_EXPORT   void FillInternalShapes() ;
202
203 //!  Build solid theDraftSolid that consists of <br>
204 //!           non-internal split faces of the solid <br>
205 //!           theSolid. <br>
206 //!           All splits of internal faces of <br>
207 //!           theSolid are in the list: theInternalFaces <br>
208 Standard_EXPORT   void BuildDraftSolid(const TopoDS_Shape& theSolid,TopoDS_Shape& theDraftSolid,TopTools_ListOfShape& theInternalFaces) ;
209
210
211  // Fields PROTECTED
212  //
213 NMTTools_PDSFiller myDSFiller;
214 TopTools_ListOfShape myShapes;
215 Standard_Integer myNbTypes;
216 TopTools_MapOfShape myMapFence;
217 TopTools_ListOfShape myShapes1[9];
218 BRepAlgo_Image myImages;
219 TopTools_IndexedDataMapOfShapeListOfShape myInParts;
220 BRepAlgo_Image mySplitFaces;
221 TopTools_IndexedDataMapOfShapeShape mySameDomainShapes;
222 TopTools_IndexedDataMapOfShapeShape myDraftSolids;
223
224
225 private: 
226
227  // Methods PRIVATE
228  // 
229
230
231  // Fields PRIVATE
232  //
233
234
235 };
236
237
238
239
240
241 // other Inline functions and methods (like "C++: function call" methods)
242 //
243
244
245 #endif