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_PDSFiller_HeaderFile
24 #include <NMTTools_PDSFiller.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_DSFiller;
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 DSFiller <br>
94 //! object theDSF <br>
95 Standard_EXPORT virtual void PerformWithFiller(const NMTTools_DSFiller& 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 //! Prepare information for history support <br>
141 Standard_EXPORT virtual void PrepareHistory() ;
143 //! Clears internal fields <br>
144 Standard_EXPORT virtual void ClearInternals() ;
146 //! Provides preparing actions <br>
147 Standard_EXPORT virtual void Prepare() ;
149 //! Provides post-tratment actions <br>
150 Standard_EXPORT virtual void PostTreat() ;
152 //! Append the argument theShape to <br>
153 //! typified lists of arguments myShapes1 <br>
154 Standard_EXPORT void AddShape1(const TopoDS_Shape& theShape) ;
156 //! Build the resulting shapes of type theType <br>
157 Standard_EXPORT virtual void BuildResult(const TopAbs_ShapeEnum theType) ;
159 //! Fill Images for vertices <br>
160 Standard_EXPORT void FillImagesVertices() ;
162 //! Fill Images for edges <br>
163 Standard_EXPORT void FillImagesEdges() ;
165 //! Fill Images for faces <br>
166 Standard_EXPORT void FillImagesFaces() ;
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() ;
172 //! Build draft faces <br>
173 Standard_EXPORT void BuildSplitFaces() ;
175 //! Among draft faces find same domain faces <br>
176 Standard_EXPORT void FillSameDomainFaces() ;
178 //! Fill Images for faces <br>
179 //! taking into account same domain faces <br>
180 Standard_EXPORT void FillImagesFaces1() ;
182 //! Update Images for faces by <br>
183 //! internal vertices <br>
184 Standard_EXPORT void FillInternalVertices() ;
186 //! Fill Images for Wires, Shells, Compsolids, Compounds <br>
187 Standard_EXPORT void FillImagesContainers(const TopAbs_ShapeEnum theType) ;
189 //! Fill Images for solids <br>
190 Standard_EXPORT void FillImagesSolids() ;
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() ;
196 //! Build draft solids <br>
197 Standard_EXPORT void BuildSplitSolids() ;
199 //! Update draft solids by <br>
200 //! internal shells, edges, vertices <br>
201 Standard_EXPORT void FillInternalShapes() ;
203 //! Build solid theDraftSolid that consists of <br>
204 //! non-internal split faces of the solid <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) ;
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;
241 // other Inline functions and methods (like "C++: function call" methods)