1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef _GEOMAlgo_Builder_HeaderFile
21 #define _GEOMAlgo_Builder_HeaderFile
23 #ifndef _NMTTools_PPaveFiller_HeaderFile
24 #include <NMTTools_PPaveFiller.hxx>
26 #ifndef _TopTools_ListOfShape_HeaderFile
27 #include <TopTools_ListOfShape.hxx>
29 #ifndef _Standard_Integer_HeaderFile
30 #include <Standard_Integer.hxx>
32 #ifndef _TopTools_MapOfShape_HeaderFile
33 #include <TopTools_MapOfShape.hxx>
35 #ifndef _BRepAlgo_Image_HeaderFile
36 #include <BRepAlgo_Image.hxx>
38 #ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile
39 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
41 #ifndef _TopTools_IndexedDataMapOfShapeShape_HeaderFile
42 #include <TopTools_IndexedDataMapOfShapeShape.hxx>
44 #ifndef _GEOMAlgo_BuilderShape_HeaderFile
45 #include <GEOMAlgo_BuilderShape.hxx>
47 #ifndef _Standard_Boolean_HeaderFile
48 #include <Standard_Boolean.hxx>
50 #ifndef _TopAbs_ShapeEnum_HeaderFile
51 #include <TopAbs_ShapeEnum.hxx>
53 class NMTTools_PaveFiller;
55 class TopTools_ListOfShape;
59 #ifndef _Standard_HeaderFile
60 #include <Standard.hxx>
62 #ifndef _Standard_Macro_HeaderFile
63 #include <Standard_Macro.hxx>
67 class GEOMAlgo_Builder : public GEOMAlgo_BuilderShape {
71 void* operator new(size_t,void* anAddress)
75 void* operator new(size_t size)
77 return Standard::Allocate(size);
79 void operator delete(void *anAddress)
81 if (anAddress) Standard::Free((Standard_Address&)anAddress);
86 //! Empty constructor <br>
87 Standard_EXPORT GEOMAlgo_Builder();
88 Standard_EXPORT virtual ~GEOMAlgo_Builder();
90 //! Performs calculations <br>
91 Standard_EXPORT virtual void Perform() ;
93 //! Performs calculations using prepared PaveFiller <br>
94 //! object theDSF <br>
95 Standard_EXPORT virtual void PerformWithFiller(const NMTTools_PaveFiller& theDSF) ;
97 //! Adds argument theShape of the operation <br>
98 Standard_EXPORT virtual void AddShape(const TopoDS_Shape& theShape) ;
100 //! Clears internal fields and arguments <br>
101 Standard_EXPORT virtual void Clear() ;
103 //! Returns the arguments of the operation <br>
104 Standard_EXPORT const TopTools_ListOfShape& Shapes() const;
106 //! Returns the list of shapes generated from the <br>
108 Standard_EXPORT virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS) ;
110 //! Returns the list of shapes modified from the shape <br>
112 Standard_EXPORT virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS) ;
114 //! Returns true if the shape theS has been deleted. <br>
115 Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& theS) ;
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) ;
121 //! Returns list of arguments of type theType <br>
122 Standard_EXPORT const TopTools_ListOfShape& Shapes1(const Standard_Integer theType) const;
124 //! Returns image shapes <br>
125 Standard_EXPORT const BRepAlgo_Image& Images() const;
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;
140 //! Performs calculations using prepared DSFiller <br>
141 //! object theDSF <br>
142 Standard_EXPORT virtual void PerformInternal(const NMTTools_PaveFiller& theDSF) ;
144 //! Prepare information for history support <br>
145 Standard_EXPORT virtual void PrepareHistory() ;
147 //! Clears internal fields <br>
148 Standard_EXPORT virtual void ClearInternals() ;
150 //! Provides preparing actions <br>
151 Standard_EXPORT virtual void Prepare() ;
153 //! Provides post-tratment actions <br>
154 Standard_EXPORT virtual void PostTreat() ;
156 //! Append the argument theShape to <br>
157 //! typified lists of arguments myShapes1 <br>
158 Standard_EXPORT void AddShape1(const TopoDS_Shape& theShape) ;
160 //! Build the resulting shapes of type theType <br>
161 Standard_EXPORT virtual void BuildResult(const TopAbs_ShapeEnum theType) ;
163 //! Fill Images for vertices <br>
164 Standard_EXPORT void FillImagesVertices() ;
166 //! Fill Images for edges <br>
167 Standard_EXPORT void FillImagesEdges() ;
169 //! Fill Images for faces <br>
170 Standard_EXPORT void FillImagesFaces() ;
172 //! For each interferred face find split edges <br>
173 //! that are in 2-D domain of the face <br>
174 Standard_EXPORT void FillIn2DParts() ;
176 //! Build draft faces <br>
177 Standard_EXPORT void BuildSplitFaces() ;
179 //! Among draft faces find same domain faces <br>
180 Standard_EXPORT void FillSameDomainFaces() ;
182 //! Fill Images for faces <br>
183 //! taking into account same domain faces <br>
184 Standard_EXPORT void FillImagesFaces1() ;
186 //! Update Images for faces by <br>
187 //! internal vertices <br>
188 Standard_EXPORT void FillInternalVertices() ;
190 //! Fill Images for Wires, Shells, Compsolids, Compounds <br>
191 Standard_EXPORT void FillImagesContainers(const TopAbs_ShapeEnum theType) ;
193 //! Fill Images for solids <br>
194 Standard_EXPORT void FillImagesSolids() ;
196 //! For each interferred solid find split faces <br>
197 //! that are in 3-D domain of the solid <br>
198 Standard_EXPORT void FillIn3DParts() ;
200 //! Build draft solids <br>
201 Standard_EXPORT void BuildSplitSolids() ;
203 //! Update draft solids by <br>
204 //! internal shells, edges, vertices <br>
205 Standard_EXPORT void FillInternalShapes() ;
207 //! Build solid theDraftSolid that consists of <br>
208 //! non-internal split faces of the solid <br>
210 //! All splits of internal faces of <br>
211 //! theSolid are in the list: theInternalFaces <br>
212 Standard_EXPORT void BuildDraftSolid(const TopoDS_Shape& theSolid,TopoDS_Shape& theDraftSolid,TopTools_ListOfShape& theInternalFaces) ;
217 NMTTools_PPaveFiller myPaveFiller;
218 TopTools_ListOfShape myShapes;
219 Standard_Integer myNbTypes;
220 TopTools_MapOfShape myMapFence;
221 TopTools_ListOfShape myShapes1[9];
222 BRepAlgo_Image myImages;
223 TopTools_IndexedDataMapOfShapeListOfShape myInParts;
224 BRepAlgo_Image mySplitFaces;
225 TopTools_IndexedDataMapOfShapeShape mySameDomainShapes;
226 TopTools_IndexedDataMapOfShapeShape myDraftSolids;
227 Standard_Integer myEntryPoint;
246 // other Inline functions and methods (like "C++: function call" methods)