1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef _GEOMAlgo_Builder_HeaderFile
23 #define _GEOMAlgo_Builder_HeaderFile
25 #ifndef _NMTTools_PPaveFiller_HeaderFile
26 #include <NMTTools_PPaveFiller.hxx>
28 #ifndef _TopTools_ListOfShape_HeaderFile
29 #include <TopTools_ListOfShape.hxx>
31 #ifndef _Standard_Integer_HeaderFile
32 #include <Standard_Integer.hxx>
34 #ifndef _TopTools_MapOfShape_HeaderFile
35 #include <TopTools_MapOfShape.hxx>
37 #ifndef _BRepAlgo_Image_HeaderFile
38 #include <BRepAlgo_Image.hxx>
40 #ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile
41 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
43 #ifndef _TopTools_IndexedDataMapOfShapeShape_HeaderFile
44 #include <TopTools_IndexedDataMapOfShapeShape.hxx>
46 #ifndef _GEOMAlgo_BuilderShape_HeaderFile
47 #include <GEOMAlgo_BuilderShape.hxx>
49 #ifndef _Standard_Boolean_HeaderFile
50 #include <Standard_Boolean.hxx>
52 #ifndef _TopAbs_ShapeEnum_HeaderFile
53 #include <TopAbs_ShapeEnum.hxx>
55 class NMTTools_PaveFiller;
57 class TopTools_ListOfShape;
61 #ifndef _Standard_HeaderFile
62 #include <Standard.hxx>
64 #ifndef _Standard_Macro_HeaderFile
65 #include <Standard_Macro.hxx>
69 class GEOMAlgo_Builder : public GEOMAlgo_BuilderShape {
73 void* operator new(size_t,void* anAddress)
77 void* operator new(size_t size)
79 return Standard::Allocate(size);
81 void operator delete(void *anAddress)
83 if (anAddress) Standard::Free((Standard_Address&)anAddress);
88 //! Empty constructor <br>
89 Standard_EXPORT GEOMAlgo_Builder();
90 Standard_EXPORT virtual ~GEOMAlgo_Builder();
92 //! Performs calculations <br>
93 Standard_EXPORT virtual void Perform() ;
95 //! Performs calculations using prepared PaveFiller <br>
96 //! object theDSF <br>
97 Standard_EXPORT virtual void PerformWithFiller(const NMTTools_PaveFiller& theDSF) ;
99 //! Adds argument theShape of the operation <br>
100 Standard_EXPORT virtual void AddShape(const TopoDS_Shape& theShape) ;
102 //! Clears internal fields and arguments <br>
103 Standard_EXPORT virtual void Clear() ;
105 //! Returns the arguments of the operation <br>
106 Standard_EXPORT const TopTools_ListOfShape& Shapes() const;
108 //! Returns the list of shapes generated from the <br>
110 Standard_EXPORT virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS) ;
112 //! Returns the list of shapes modified from the shape <br>
114 Standard_EXPORT virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS) ;
116 //! Returns true if the shape theS has been deleted. <br>
117 Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& theS) ;
119 //! Adds arguments of the operation as <br>
120 //! shapes of upper level of container shape theShape <br>
121 Standard_EXPORT void AddCompound(const TopoDS_Shape& theShape) ;
123 //! Returns list of arguments of type theType <br>
124 Standard_EXPORT const TopTools_ListOfShape& Shapes1(const Standard_Integer theType) const;
126 //! Returns image shapes <br>
127 Standard_EXPORT const BRepAlgo_Image& Images() const;
129 //! Returns split-parts of shapes that have <br>
130 //! state IN for the domain of shape theShape <br>
131 Standard_EXPORT const TopTools_ListOfShape& InParts(const TopoDS_Shape& theShape) const;
142 //! Performs calculations using prepared DSFiller <br>
143 //! object theDSF <br>
144 Standard_EXPORT virtual void PerformInternal(const NMTTools_PaveFiller& theDSF) ;
146 //! Prepare information for history support <br>
147 Standard_EXPORT virtual void PrepareHistory() ;
149 //! Clears internal fields <br>
150 Standard_EXPORT virtual void ClearInternals() ;
152 //! Provides preparing actions <br>
153 Standard_EXPORT virtual void Prepare() ;
155 //! Provides post-tratment actions <br>
156 Standard_EXPORT virtual void PostTreat() ;
158 //! Append the argument theShape to <br>
159 //! typified lists of arguments myShapes1 <br>
160 Standard_EXPORT void AddShape1(const TopoDS_Shape& theShape) ;
162 //! Build the resulting shapes of type theType <br>
163 Standard_EXPORT virtual void BuildResult(const TopAbs_ShapeEnum theType) ;
165 //! Fill Images for vertices <br>
166 Standard_EXPORT void FillImagesVertices() ;
168 //! Fill Images for edges <br>
169 Standard_EXPORT void FillImagesEdges() ;
171 //! Fill Images for faces <br>
172 Standard_EXPORT void FillImagesFaces() ;
174 //! For each interferred face find split edges <br>
175 //! that are in 2-D domain of the face <br>
176 Standard_EXPORT void FillIn2DParts() ;
178 //! Build draft faces <br>
179 Standard_EXPORT void BuildSplitFaces() ;
181 //! Among draft faces find same domain faces <br>
182 Standard_EXPORT void FillSameDomainFaces() ;
184 //! Fill Images for faces <br>
185 //! taking into account same domain faces <br>
186 Standard_EXPORT void FillImagesFaces1() ;
188 //! Update Images for faces by <br>
189 //! internal vertices <br>
190 Standard_EXPORT void FillInternalVertices() ;
192 //! Fill Images for Wires, Shells, Compsolids, Compounds <br>
193 Standard_EXPORT void FillImagesContainers(const TopAbs_ShapeEnum theType) ;
195 //! Fill Images for solids <br>
196 Standard_EXPORT void FillImagesSolids() ;
198 //! For each interferred solid find split faces <br>
199 //! that are in 3-D domain of the solid <br>
200 Standard_EXPORT void FillIn3DParts() ;
202 //! Build draft solids <br>
203 Standard_EXPORT void BuildSplitSolids() ;
205 //! Update draft solids by <br>
206 //! internal shells, edges, vertices <br>
207 Standard_EXPORT void FillInternalShapes() ;
209 //! Build solid theDraftSolid that consists of <br>
210 //! non-internal split faces of the solid <br>
212 //! All splits of internal faces of <br>
213 //! theSolid are in the list: theInternalFaces <br>
214 Standard_EXPORT void BuildDraftSolid(const TopoDS_Shape& theSolid,TopoDS_Shape& theDraftSolid,TopTools_ListOfShape& theInternalFaces) ;
219 NMTTools_PPaveFiller myPaveFiller;
220 TopTools_ListOfShape myShapes;
221 Standard_Integer myNbTypes;
222 TopTools_MapOfShape myMapFence;
223 TopTools_ListOfShape myShapes1[9];
224 BRepAlgo_Image myImages;
225 TopTools_IndexedDataMapOfShapeListOfShape myInParts;
226 BRepAlgo_Image mySplitFaces;
227 TopTools_IndexedDataMapOfShapeShape mySameDomainShapes;
228 TopTools_IndexedDataMapOfShapeShape myDraftSolids;
229 Standard_Integer myEntryPoint;
248 // other Inline functions and methods (like "C++: function call" methods)