1 // Copyright (C) 2007-2010 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
23 #ifndef _GEOMAlgo_Builder_HeaderFile
24 #define _GEOMAlgo_Builder_HeaderFile
26 #ifndef _NMTTools_PPaveFiller_HeaderFile
27 #include <NMTTools_PPaveFiller.hxx>
29 #ifndef _TopTools_ListOfShape_HeaderFile
30 #include <TopTools_ListOfShape.hxx>
32 #ifndef _Standard_Integer_HeaderFile
33 #include <Standard_Integer.hxx>
35 #ifndef _TopTools_MapOfShape_HeaderFile
36 #include <TopTools_MapOfShape.hxx>
38 #ifndef _BRepAlgo_Image_HeaderFile
39 #include <BRepAlgo_Image.hxx>
41 #ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile
42 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
44 #ifndef _TopTools_IndexedDataMapOfShapeShape_HeaderFile
45 #include <TopTools_IndexedDataMapOfShapeShape.hxx>
47 #ifndef _GEOMAlgo_BuilderShape_HeaderFile
48 #include <GEOMAlgo_BuilderShape.hxx>
50 #ifndef _Standard_Boolean_HeaderFile
51 #include <Standard_Boolean.hxx>
53 #ifndef _TopAbs_ShapeEnum_HeaderFile
54 #include <TopAbs_ShapeEnum.hxx>
56 class NMTTools_PaveFiller;
58 class TopTools_ListOfShape;
62 #ifndef _Standard_HeaderFile
63 #include <Standard.hxx>
65 #ifndef _Standard_Macro_HeaderFile
66 #include <Standard_Macro.hxx>
70 class GEOMAlgo_Builder : public GEOMAlgo_BuilderShape {
74 void* operator new(size_t,void* anAddress)
78 void* operator new(size_t size)
80 return Standard::Allocate(size);
82 void operator delete(void *anAddress)
84 if (anAddress) Standard::Free((Standard_Address&)anAddress);
89 //! Empty constructor <br>
90 Standard_EXPORT GEOMAlgo_Builder();
91 Standard_EXPORT virtual ~GEOMAlgo_Builder();
93 //! Performs calculations <br>
94 Standard_EXPORT virtual void Perform() ;
96 //! Performs calculations using prepared PaveFiller <br>
97 //! object theDSF <br>
98 Standard_EXPORT virtual void PerformWithFiller(const NMTTools_PaveFiller& theDSF) ;
100 //! Adds argument theShape of the operation <br>
101 Standard_EXPORT virtual void AddShape(const TopoDS_Shape& theShape) ;
103 //! Clears internal fields and arguments <br>
104 Standard_EXPORT virtual void Clear() ;
106 //! Returns the arguments of the operation <br>
107 Standard_EXPORT const TopTools_ListOfShape& Shapes() const;
109 //! Returns the list of shapes generated from the <br>
111 Standard_EXPORT virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS) ;
113 //! Returns the list of shapes modified from the shape <br>
115 Standard_EXPORT virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS) ;
117 //! Returns true if the shape theS has been deleted. <br>
118 Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& theS) ;
120 //! Adds arguments of the operation as <br>
121 //! shapes of upper level of container shape theShape <br>
122 Standard_EXPORT void AddCompound(const TopoDS_Shape& theShape) ;
124 //! Returns list of arguments of type theType <br>
125 Standard_EXPORT const TopTools_ListOfShape& Shapes1(const Standard_Integer theType) const;
127 //! Returns image shapes <br>
128 Standard_EXPORT const BRepAlgo_Image& Images() const;
130 //! Returns split-parts of shapes that have <br>
131 //! state IN for the domain of shape theShape <br>
132 Standard_EXPORT const TopTools_ListOfShape& InParts(const TopoDS_Shape& theShape) const;
143 //! Performs calculations using prepared DSFiller <br>
144 //! object theDSF <br>
145 Standard_EXPORT virtual void PerformInternal(const NMTTools_PaveFiller& theDSF) ;
147 //! Prepare information for history support <br>
148 Standard_EXPORT virtual void PrepareHistory() ;
150 //! Clears internal fields <br>
151 Standard_EXPORT virtual void ClearInternals() ;
153 //! Provides preparing actions <br>
154 Standard_EXPORT virtual void Prepare() ;
156 //! Provides post-tratment actions <br>
157 Standard_EXPORT virtual void PostTreat() ;
159 //! Append the argument theShape to <br>
160 //! typified lists of arguments myShapes1 <br>
161 Standard_EXPORT void AddShape1(const TopoDS_Shape& theShape) ;
163 //! Build the resulting shapes of type theType <br>
164 Standard_EXPORT virtual void BuildResult(const TopAbs_ShapeEnum theType) ;
166 //! Fill Images for vertices <br>
167 Standard_EXPORT void FillImagesVertices() ;
169 //! Fill Images for edges <br>
170 Standard_EXPORT void FillImagesEdges() ;
172 //! Fill Images for faces <br>
173 Standard_EXPORT void FillImagesFaces() ;
175 //! For each interferred face find split edges <br>
176 //! that are in 2-D domain of the face <br>
177 Standard_EXPORT void FillIn2DParts() ;
179 //! Build draft faces <br>
180 Standard_EXPORT void BuildSplitFaces() ;
182 //! Among draft faces find same domain faces <br>
183 Standard_EXPORT void FillSameDomainFaces() ;
185 //! Fill Images for faces <br>
186 //! taking into account same domain faces <br>
187 Standard_EXPORT void FillImagesFaces1() ;
189 //! Update Images for faces by <br>
190 //! internal vertices <br>
191 Standard_EXPORT void FillInternalVertices() ;
193 //! Fill Images for Wires, Shells, Compsolids, Compounds <br>
194 Standard_EXPORT void FillImagesContainers(const TopAbs_ShapeEnum theType) ;
196 //! Fill Images for solids <br>
197 Standard_EXPORT void FillImagesSolids() ;
199 //! For each interferred solid find split faces <br>
200 //! that are in 3-D domain of the solid <br>
201 Standard_EXPORT void FillIn3DParts() ;
203 //! Build draft solids <br>
204 Standard_EXPORT void BuildSplitSolids() ;
206 //! Update draft solids by <br>
207 //! internal shells, edges, vertices <br>
208 Standard_EXPORT void FillInternalShapes() ;
210 //! Build solid theDraftSolid that consists of <br>
211 //! non-internal split faces of the solid <br>
213 //! All splits of internal faces of <br>
214 //! theSolid are in the list: theInternalFaces <br>
215 Standard_EXPORT void BuildDraftSolid(const TopoDS_Shape& theSolid,TopoDS_Shape& theDraftSolid,TopTools_ListOfShape& theInternalFaces) ;
220 NMTTools_PPaveFiller myPaveFiller;
221 TopTools_ListOfShape myShapes;
222 Standard_Integer myNbTypes;
223 TopTools_MapOfShape myMapFence;
224 TopTools_ListOfShape myShapes1[9];
225 BRepAlgo_Image myImages;
226 TopTools_IndexedDataMapOfShapeListOfShape myInParts;
227 BRepAlgo_Image mySplitFaces;
228 TopTools_IndexedDataMapOfShapeShape mySameDomainShapes;
229 TopTools_IndexedDataMapOfShapeShape myDraftSolids;
230 Standard_Integer myEntryPoint;
249 // other Inline functions and methods (like "C++: function call" methods)