1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
\r
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
\r
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
\r
6 // This library is free software; you can redistribute it and/or
\r
7 // modify it under the terms of the GNU Lesser General Public
\r
8 // License as published by the Free Software Foundation; either
\r
9 // version 2.1 of the License.
\r
11 // This library is distributed in the hope that it will be useful,
\r
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
14 // Lesser General Public License for more details.
\r
16 // You should have received a copy of the GNU Lesser General Public
\r
17 // License along with this library; if not, write to the Free Software
\r
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
\r
22 // File: GEOMAlgo_Builder.cxx
\r
24 // Author: Peter KURNEV
\r
26 #ifndef _GEOMAlgo_Builder_HeaderFile
\r
27 #define _GEOMAlgo_Builder_HeaderFile
\r
29 #include <Standard.hxx>
\r
30 #include <Standard_Macro.hxx>
\r
31 #include <NMTTools_PPaveFiller.hxx>
\r
32 #include <TopTools_ListOfShape.hxx>
\r
33 #include <Standard_Integer.hxx>
\r
34 #include <TopTools_MapOfShape.hxx>
\r
35 #include <BRepAlgo_Image.hxx>
\r
36 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
\r
37 #include <TopTools_IndexedDataMapOfShapeShape.hxx>
\r
38 #include <GEOMAlgo_BuilderShape.hxx>
\r
39 #include <NMTTools_PaveFiller.hxx>
\r
40 #include <Standard_Boolean.hxx>
\r
41 #include <TopAbs_ShapeEnum.hxx>
\r
42 #include <TopoDS_Shape.hxx>
\r
43 #include <BRepAlgo_Image.hxx>
\r
45 //=======================================================================
\r
46 //function : GEOMAlgo_Builder
\r
48 //=======================================================================
\r
49 class GEOMAlgo_Builder : public GEOMAlgo_BuilderShape
\r
52 //! Empty constructor <br>
\r
57 virtual ~GEOMAlgo_Builder();
\r
59 //! Performs calculations <br>
\r
61 virtual void Perform() ;
\r
63 //! Performs calculations using prepared PaveFiller <br>
\r
64 //! object theDSF <br>
\r
66 virtual void PerformWithFiller(const NMTTools_PaveFiller& theDSF) ;
\r
68 //! Adds argument theShape of the operation <br>
\r
70 virtual void AddShape(const TopoDS_Shape& theShape) ;
\r
72 //! Clears internal fields and arguments <br>
\r
74 virtual void Clear() ;
\r
76 //! Returns the arguments of the operation <br>
\r
78 const TopTools_ListOfShape& Shapes() const;
\r
80 //! Returns the list of shapes generated from the <br>
\r
81 //! shape theS. <br>
\r
83 virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS) ;
\r
85 //! Returns the list of shapes modified from the shape <br>
\r
88 virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS) ;
\r
90 //! Returns true if the shape theS has been deleted. <br>
\r
92 virtual Standard_Boolean IsDeleted(const TopoDS_Shape& theS) ;
\r
94 //! Adds arguments of the operation as <br>
\r
95 //! shapes of upper level of container shape theShape <br>
\r
97 void AddCompound(const TopoDS_Shape& theShape) ;
\r
99 //! Returns list of arguments of type theType <br>
\r
101 const TopTools_ListOfShape& Shapes1(const Standard_Integer theType) const;
\r
103 //! Returns image shapes <br>
\r
105 const BRepAlgo_Image& Images() const;
\r
107 //! Returns split-parts of shapes that have <br>
\r
108 //! state IN for the domain of shape theShape <br>
\r
110 const TopTools_ListOfShape& InParts(const TopoDS_Shape& theShape) const;
\r
113 //! Performs calculations using prepared DSFiller <br>
\r
114 //! object theDSF <br>
\r
116 virtual void PerformInternal(const NMTTools_PaveFiller& theDSF) ;
\r
118 //! Prepare information for history support <br>
\r
120 virtual void PrepareHistory() ;
\r
122 //! Clears internal fields <br>
\r
124 virtual void ClearInternals() ;
\r
126 //! Provides preparing actions <br>
\r
128 virtual void Prepare() ;
\r
130 //! Provides post-tratment actions <br>
\r
132 virtual void PostTreat() ;
\r
134 //! Append the argument theShape to <br>
\r
135 //! typified lists of arguments myShapes1 <br>
\r
137 void AddShape1(const TopoDS_Shape& theShape) ;
\r
139 //! Build the resulting shapes of type theType <br>
\r
141 virtual void BuildResult(const TopAbs_ShapeEnum theType) ;
\r
143 //! Fill Images for vertices <br>
\r
145 void FillImagesVertices() ;
\r
147 //! Fill Images for edges <br>
\r
149 void FillImagesEdges() ;
\r
151 //! Fill Images for faces <br>
\r
153 void FillImagesFaces() ;
\r
155 //! For each interferred face find split edges <br>
\r
156 //! that are in 2-D domain of the face <br>
\r
158 void FillIn2DParts() ;
\r
160 //! Build draft faces <br>
\r
162 void BuildSplitFaces() ;
\r
164 //! Among draft faces find same domain faces <br>
\r
166 void FillSameDomainFaces() ;
\r
168 //! Fill Images for faces <br>
\r
169 //! taking into account same domain faces <br>
\r
171 void FillImagesFaces1() ;
\r
173 //! Update Images for faces by <br>
\r
174 //! internal vertices <br>
\r
176 void FillInternalVertices() ;
\r
178 //! Fill Images for Wires, Shells, Compsolids, Compounds <br>
\r
180 void FillImagesContainers(const TopAbs_ShapeEnum theType) ;
\r
182 //! Fill Images for solids <br>
\r
184 void FillImagesSolids() ;
\r
186 //! For each interferred solid find split faces <br>
\r
187 //! that are in 3-D domain of the solid <br>
\r
189 void FillIn3DParts() ;
\r
191 //! Build draft solids <br>
\r
193 void BuildSplitSolids() ;
\r
195 //! Update draft solids by <br>
\r
196 //! internal shells, edges, vertices <br>
\r
198 void FillInternalShapes() ;
\r
200 //! Build solid theDraftSolid that consists of <br>
\r
201 //! non-internal split faces of the solid <br>
\r
203 //! All splits of internal faces of <br>
\r
204 //! theSolid are in the list: theInternalFaces <br>
\r
206 void BuildDraftSolid(const TopoDS_Shape& theSolid,
\r
207 TopoDS_Shape& theDraftSolid,
\r
208 TopTools_ListOfShape& theInternalFaces) ;
\r
211 NMTTools_PPaveFiller myPaveFiller;
\r
212 TopTools_ListOfShape myShapes;
\r
213 Standard_Integer myNbTypes;
\r
214 TopTools_MapOfShape myMapFence;
\r
215 TopTools_ListOfShape myShapes1[9];
\r
216 BRepAlgo_Image myImages;
\r
217 TopTools_IndexedDataMapOfShapeListOfShape myInParts;
\r
218 BRepAlgo_Image mySplitFaces;
\r
219 TopTools_IndexedDataMapOfShapeShape mySameDomainShapes;
\r
220 TopTools_IndexedDataMapOfShapeShape myDraftSolids;
\r
221 Standard_Integer myEntryPoint;
\r