0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / TopOpeBRepBuild / TopOpeBRepBuild_Builder.hxx
CommitLineData
42cf5bc1 1// Created on: 1993-06-14
2// Created by: Jean Yves LEBEY
3// Copyright (c) 1993-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _TopOpeBRepBuild_Builder_HeaderFile
18#define _TopOpeBRepBuild_Builder_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <TopAbs_State.hxx>
25#include <TopoDS_Shape.hxx>
26#include <TopOpeBRepDS_BuildTool.hxx>
27#include <TopTools_HArray1OfShape.hxx>
28#include <TopTools_DataMapOfIntegerListOfShape.hxx>
29#include <TopTools_HArray1OfListOfShape.hxx>
30#include <TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State.hxx>
31#include <TopTools_ListOfShape.hxx>
32#include <TopTools_DataMapOfShapeListOfShape.hxx>
33#include <Standard_Boolean.hxx>
34#include <TopoDS_Solid.hxx>
35#include <TopoDS_Face.hxx>
36#include <TopoDS_Edge.hxx>
37#include <TopTools_IndexedMapOfShape.hxx>
38#include <Standard_Integer.hxx>
39#include <TopOpeBRepTool_ShapeClassifier.hxx>
40#include <TopTools_MapOfShape.hxx>
41#include <TCollection_AsciiString.hxx>
42#include <TopTools_IndexedDataMapOfShapeShape.hxx>
43#include <TopTools_IndexedMapOfOrientedShape.hxx>
44#include <TopTools_DataMapOfShapeShape.hxx>
45#include <TopAbs_ShapeEnum.hxx>
46#include <TopAbs_Orientation.hxx>
47#include <TopTools_DataMapOfIntegerShape.hxx>
48#include <TopOpeBRepDS_Config.hxx>
49#include <Standard_Real.hxx>
50#include <TopTools_DataMapOfShapeInteger.hxx>
51#include <Standard_Address.hxx>
52class TopOpeBRepDS_HDataStructure;
53class Standard_NoSuchObject;
54class TopOpeBRepBuild_HBuilder;
55class TopOpeBRepDS_BuildTool;
56class TopoDS_Shape;
57class TopOpeBRepTool_ShapeExplorer;
58class TopOpeBRepBuild_ShapeSet;
59class TopOpeBRepBuild_EdgeBuilder;
60class TopOpeBRepBuild_FaceBuilder;
61class TopOpeBRepBuild_SolidBuilder;
62class TopOpeBRepBuild_WireEdgeSet;
63class TopOpeBRepDS_PointIterator;
64class TopOpeBRepBuild_PaveSet;
65class TopOpeBRepBuild_GTopo;
66class TopOpeBRepBuild_ShellFaceSet;
67class TopOpeBRepDS_SurfaceIterator;
68class TopOpeBRepDS_CurveIterator;
69class TopoDS_Vertex;
70class TopoDS_Edge;
71class gp_Pnt;
72class TopoDS_Face;
73class TCollection_AsciiString;
74
75
76//! The Builder algorithm constructs topological
77//! objects from an existing topology and new
78//! geometries attached to the topology. It is used to
79//! construct the result of a topological operation;
80//! the existing topologies are the parts involved in
81//! the topological operation and the new geometries
82//! are the intersection lines and points.
83class TopOpeBRepBuild_Builder
84{
85public:
86
87 DEFINE_STANDARD_ALLOC
88
89
90 Standard_EXPORT TopOpeBRepBuild_Builder(const TopOpeBRepDS_BuildTool& BT);
91
92 Standard_EXPORT virtual void Destroy();
93Standard_EXPORT virtual ~TopOpeBRepBuild_Builder() { Destroy() ; }
94
95 Standard_EXPORT TopOpeBRepDS_BuildTool& ChangeBuildTool();
96
97 Standard_EXPORT const TopOpeBRepDS_BuildTool& BuildTool() const;
98
99 //! Stores the data structure <HDS>,
100 //! Create shapes from the new geometries.
101 Standard_EXPORT virtual void Perform (const Handle(TopOpeBRepDS_HDataStructure)& HDS);
102
103 //! Stores the data structure <HDS>,
104 //! Create shapes from the new geometries,
105 //! Evaluates if an operation performed on shapes S1,S2
106 //! is a particular case.
107 Standard_EXPORT virtual void Perform (const Handle(TopOpeBRepDS_HDataStructure)& HDS, const TopoDS_Shape& S1, const TopoDS_Shape& S2);
108
109 //! returns the DS handled by this builder
110 Standard_EXPORT Handle(TopOpeBRepDS_HDataStructure) DataStructure() const;
111
112 //! Removes all splits and merges already performed.
113 //! Does NOT clear the handled DS.
114 Standard_EXPORT virtual void Clear();
115
116 //! Merges the two edges <S1> and <S2> keeping the
117 //! parts in each edge of states <TB1> and <TB2>.
118 //! Booleans onA, onB, onAB indicate wheter parts of edges
119 //! found as state ON respectively on first, second, and both
120 //! shapes must be (or not) built.
121 Standard_EXPORT void MergeEdges (const TopTools_ListOfShape& L1, const TopAbs_State TB1, const TopTools_ListOfShape& L2, const TopAbs_State TB2, const Standard_Boolean onA = Standard_False, const Standard_Boolean onB = Standard_False, const Standard_Boolean onAB = Standard_False);
122
123 //! Merges the two faces <S1> and <S2> keeping the
124 //! parts in each face of states <TB1> and <TB2>.
125 Standard_EXPORT void MergeFaces (const TopTools_ListOfShape& S1, const TopAbs_State TB1, const TopTools_ListOfShape& S2, const TopAbs_State TB2, const Standard_Boolean onA = Standard_False, const Standard_Boolean onB = Standard_False, const Standard_Boolean onAB = Standard_False);
126
127 //! Merges the two solids <S1> and <S2> keeping the
128 //! parts in each solid of states <TB1> and <TB2>.
129 Standard_EXPORT void MergeSolids (const TopoDS_Shape& S1, const TopAbs_State TB1, const TopoDS_Shape& S2, const TopAbs_State TB2);
130
131 //! Merges the two shapes <S1> and <S2> keeping the
132 //! parts of states <TB1>,<TB2> in <S1>,<S2>.
133 Standard_EXPORT void MergeShapes (const TopoDS_Shape& S1, const TopAbs_State TB1, const TopoDS_Shape& S2, const TopAbs_State TB2);
134
135 Standard_EXPORT void End();
136
137 Standard_EXPORT Standard_Boolean Classify() const;
138
139 Standard_EXPORT void ChangeClassify (const Standard_Boolean B);
140
141 //! Merges the solid <S> keeping the
142 //! parts of state <TB>.
143 Standard_EXPORT void MergeSolid (const TopoDS_Shape& S, const TopAbs_State TB);
144
145 //! Returns the vertex created on point <I>.
146 Standard_EXPORT const TopoDS_Shape& NewVertex (const Standard_Integer I) const;
147
148 //! Returns the edges created on curve <I>.
149 Standard_EXPORT const TopTools_ListOfShape& NewEdges (const Standard_Integer I) const;
150
151 //! Returns the faces created on surface <I>.
152 Standard_EXPORT const TopTools_ListOfShape& NewFaces (const Standard_Integer I) const;
153
154 //! Returns True if the shape <S> has been split.
155 Standard_EXPORT Standard_Boolean IsSplit (const TopoDS_Shape& S, const TopAbs_State TB) const;
156
157 //! Returns the split parts <TB> of shape <S>.
158 Standard_EXPORT const TopTools_ListOfShape& Splits (const TopoDS_Shape& S, const TopAbs_State TB) const;
159
160 //! Returns True if the shape <S> has been merged.
161 Standard_EXPORT Standard_Boolean IsMerged (const TopoDS_Shape& S, const TopAbs_State TB) const;
162
163 //! Returns the merged parts <TB> of shape <S>.
164 Standard_EXPORT const TopTools_ListOfShape& Merged (const TopoDS_Shape& S, const TopAbs_State TB) const;
165
166 Standard_EXPORT void InitSection();
167
168 //! create parts ON solid of section edges
169 Standard_EXPORT void SplitSectionEdges();
170
171 //! create parts ON solid of section edges
172 Standard_EXPORT virtual void SplitSectionEdge (const TopoDS_Shape& E);
173
174 //! return the section edges built on new curves.
175 Standard_EXPORT void SectionCurves (TopTools_ListOfShape& L);
176
177 //! return the parts of edges found ON the boundary
178 //! of the two arguments S1,S2 of Perform()
179 Standard_EXPORT void SectionEdges (TopTools_ListOfShape& L);
180
181 //! Fills anAncMap with pairs (edge,ancestor edge) for each
182 //! split from the map aMapON for the shape object identified
183 //! by ShapeRank
184 Standard_EXPORT void FillSecEdgeAncestorMap (const Standard_Integer aShapeRank, const TopTools_MapOfShape& aMapON, TopTools_DataMapOfShapeShape& anAncMap) const;
185
186 //! return all section edges.
187 Standard_EXPORT void Section (TopTools_ListOfShape& L);
188
189 Standard_EXPORT const TopTools_ListOfShape& Section();
190
191 //! update the DS by creating new geometries.
192 //! create vertices on DS points.
193 Standard_EXPORT void BuildVertices (const Handle(TopOpeBRepDS_HDataStructure)& DS);
194
195 //! update the DS by creating new geometries.
196 //! create shapes from the new geometries.
197 Standard_EXPORT void BuildEdges (const Handle(TopOpeBRepDS_HDataStructure)& DS);
198
199 Standard_EXPORT const TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& MSplit (const TopAbs_State s) const;
200
201 Standard_EXPORT TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State& ChangeMSplit (const TopAbs_State s);
202
203 Standard_EXPORT void MakeEdges (const TopoDS_Shape& E, TopOpeBRepBuild_EdgeBuilder& B, TopTools_ListOfShape& L);
204
205 Standard_EXPORT void MakeFaces (const TopoDS_Shape& F, TopOpeBRepBuild_FaceBuilder& B, TopTools_ListOfShape& L);
206
207 Standard_EXPORT void MakeSolids (TopOpeBRepBuild_SolidBuilder& B, TopTools_ListOfShape& L);
208
209 Standard_EXPORT void MakeShells (TopOpeBRepBuild_SolidBuilder& B, TopTools_ListOfShape& L);
210
211 //! Returns a ref.on the list of shapes connected to <S> as
212 //! <TB> split parts of <S>.
213 //! Mark <S> as split in <TB> parts.
214 Standard_EXPORT TopTools_ListOfShape& ChangeSplit (const TopoDS_Shape& S, const TopAbs_State TB);
215
216 Standard_EXPORT Standard_Boolean Opec12() const;
217
218 Standard_EXPORT Standard_Boolean Opec21() const;
219
220 Standard_EXPORT Standard_Boolean Opecom() const;
221
222 Standard_EXPORT Standard_Boolean Opefus() const;
223
224 Standard_EXPORT TopAbs_State ShapePosition (const TopoDS_Shape& S, const TopTools_ListOfShape& LS);
225
226 Standard_EXPORT Standard_Boolean KeepShape (const TopoDS_Shape& S, const TopTools_ListOfShape& LS, const TopAbs_State T);
227
228 Standard_EXPORT static TopAbs_ShapeEnum TopType (const TopoDS_Shape& S);
229
230 Standard_EXPORT static Standard_Boolean Reverse (const TopAbs_State T1, const TopAbs_State T2);
231
232 Standard_EXPORT static TopAbs_Orientation Orient (const TopAbs_Orientation O, const Standard_Boolean R);
233
234 Standard_EXPORT void FindSameDomain (TopTools_ListOfShape& L1, TopTools_ListOfShape& L2) const;
235
236 Standard_EXPORT void FindSameDomainSameOrientation (TopTools_ListOfShape& LSO, TopTools_ListOfShape& LDO) const;
237
238 Standard_EXPORT void MapShapes (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
239
240 Standard_EXPORT void ClearMaps();
241
242 Standard_EXPORT void FindSameRank (const TopTools_ListOfShape& L1, const Standard_Integer R, TopTools_ListOfShape& L2) const;
243
244 Standard_EXPORT Standard_Integer ShapeRank (const TopoDS_Shape& S) const;
245
246 Standard_EXPORT Standard_Boolean IsShapeOf (const TopoDS_Shape& S, const Standard_Integer I12) const;
247
248 Standard_EXPORT static Standard_Boolean Contains (const TopoDS_Shape& S, const TopTools_ListOfShape& L);
249
250 Standard_EXPORT Standard_Integer FindIsKPart();
251
252 Standard_EXPORT Standard_Integer IsKPart() const;
253
254 Standard_EXPORT virtual void MergeKPart();
255
256 Standard_EXPORT virtual void MergeKPart (const TopAbs_State TB1, const TopAbs_State TB2);
257
258 Standard_EXPORT void MergeKPartiskole();
259
260 Standard_EXPORT void MergeKPartiskoletge();
261
262 Standard_EXPORT void MergeKPartisdisj();
263
264 Standard_EXPORT void MergeKPartisfafa();
265
266 Standard_EXPORT void MergeKPartissoso();
267
268 Standard_EXPORT Standard_Integer KPiskole();
269
270 Standard_EXPORT Standard_Integer KPiskoletge();
271
272 Standard_EXPORT Standard_Integer KPisdisj();
273
274 Standard_EXPORT Standard_Integer KPisfafa();
275
276 Standard_EXPORT Standard_Integer KPissoso();
277
278 Standard_EXPORT void KPClearMaps();
279
280 Standard_EXPORT Standard_Integer KPlhg (const TopoDS_Shape& S, const TopAbs_ShapeEnum T, TopTools_ListOfShape& L) const;
281
282 Standard_EXPORT Standard_Integer KPlhg (const TopoDS_Shape& S, const TopAbs_ShapeEnum T) const;
283
284 Standard_EXPORT Standard_Integer KPlhsd (const TopoDS_Shape& S, const TopAbs_ShapeEnum T, TopTools_ListOfShape& L) const;
285
286 Standard_EXPORT Standard_Integer KPlhsd (const TopoDS_Shape& S, const TopAbs_ShapeEnum T) const;
287
288 Standard_EXPORT TopAbs_State KPclasSS (const TopoDS_Shape& S1, const TopTools_ListOfShape& exceptLS1, const TopoDS_Shape& S2);
289
290 Standard_EXPORT TopAbs_State KPclasSS (const TopoDS_Shape& S1, const TopoDS_Shape& exceptS1, const TopoDS_Shape& S2);
291
292 Standard_EXPORT TopAbs_State KPclasSS (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
293
294 Standard_EXPORT Standard_Boolean KPiskolesh (const TopoDS_Shape& S, TopTools_ListOfShape& LS, TopTools_ListOfShape& LF) const;
295
296 Standard_EXPORT Standard_Boolean KPiskoletgesh (const TopoDS_Shape& S, TopTools_ListOfShape& LS, TopTools_ListOfShape& LF) const;
297
298 Standard_EXPORT void KPSameDomain (TopTools_ListOfShape& L1, TopTools_ListOfShape& L2) const;
299
300 Standard_EXPORT Standard_Integer KPisdisjsh (const TopoDS_Shape& S) const;
301
302 Standard_EXPORT Standard_Integer KPisfafash (const TopoDS_Shape& S) const;
303
304 Standard_EXPORT Standard_Integer KPissososh (const TopoDS_Shape& S) const;
305
306 Standard_EXPORT void KPiskoleanalyse (const TopAbs_State FT1, const TopAbs_State FT2, const TopAbs_State ST1, const TopAbs_State ST2, Standard_Integer& I, Standard_Integer& I1, Standard_Integer& I2) const;
307
308 Standard_EXPORT void KPiskoletgeanalyse (const TopOpeBRepDS_Config Conf, const TopAbs_State ST1, const TopAbs_State ST2, Standard_Integer& I) const;
309
310 Standard_EXPORT void KPisdisjanalyse (const TopAbs_State ST1, const TopAbs_State ST2, Standard_Integer& I, Standard_Integer& IC1, Standard_Integer& IC2) const;
311
312 Standard_EXPORT static Standard_Integer KPls (const TopoDS_Shape& S, const TopAbs_ShapeEnum T, TopTools_ListOfShape& L);
313
314 Standard_EXPORT static Standard_Integer KPls (const TopoDS_Shape& S, const TopAbs_ShapeEnum T);
315
316 Standard_EXPORT TopAbs_State KPclassF (const TopoDS_Shape& F1, const TopoDS_Shape& F2);
317
318 Standard_EXPORT void KPclassFF (const TopoDS_Shape& F1, const TopoDS_Shape& F2, TopAbs_State& T1, TopAbs_State& T2);
319
320 Standard_EXPORT Standard_Boolean KPiskoleFF (const TopoDS_Shape& F1, const TopoDS_Shape& F2, TopAbs_State& T1, TopAbs_State& T2);
321
322 Standard_EXPORT static Standard_Boolean KPContains (const TopoDS_Shape& S, const TopTools_ListOfShape& L);
323
324 Standard_EXPORT TopoDS_Shape KPmakeface (const TopoDS_Shape& F1, const TopTools_ListOfShape& LF2, const TopAbs_State T1, const TopAbs_State T2, const Standard_Boolean R1, const Standard_Boolean R2);
325
326 Standard_EXPORT static Standard_Integer KPreturn (const Standard_Integer KP);
327
328 Standard_EXPORT void SplitEvisoONperiodicF();
329
330 Standard_EXPORT void GMergeSolids (const TopTools_ListOfShape& LSO1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G);
331
332 Standard_EXPORT void GFillSolidsSFS (const TopTools_ListOfShape& LSO1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_ShellFaceSet& SFS);
333
334 Standard_EXPORT virtual void GFillSolidSFS (const TopoDS_Shape& SO1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_ShellFaceSet& SFS);
335
336 Standard_EXPORT void GFillSurfaceTopologySFS (const TopoDS_Shape& SO1, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_ShellFaceSet& SFS);
337
338 Standard_EXPORT void GFillSurfaceTopologySFS (const TopOpeBRepDS_SurfaceIterator& IT, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_ShellFaceSet& SFS) const;
339
340 Standard_EXPORT virtual void GFillShellSFS (const TopoDS_Shape& SH1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_ShellFaceSet& SFS);
341
342 Standard_EXPORT void GFillFaceSFS (const TopoDS_Shape& F1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_ShellFaceSet& SFS);
343
344 Standard_EXPORT void GSplitFaceSFS (const TopoDS_Shape& F1, const TopTools_ListOfShape& LSclass, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_ShellFaceSet& SFS);
345
346 Standard_EXPORT void GMergeFaceSFS (const TopoDS_Shape& F, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_ShellFaceSet& SFS);
347
348 Standard_EXPORT void GSplitFace (const TopoDS_Shape& F, const TopOpeBRepBuild_GTopo& G, const TopTools_ListOfShape& LSclass);
349
350 Standard_EXPORT void AddONPatchesSFS (const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_ShellFaceSet& SFS);
351
352 Standard_EXPORT void FillOnPatches (const TopTools_ListOfShape& anEdgesON, const TopoDS_Shape& aBaseFace, const TopTools_IndexedMapOfOrientedShape& avoidMap);
353
354 Standard_EXPORT void FindFacesTouchingEdge (const TopoDS_Shape& aFace, const TopoDS_Shape& anEdge, const Standard_Integer aShRank, TopTools_ListOfShape& aFaces) const;
355
356 Standard_EXPORT void GMergeFaces (const TopTools_ListOfShape& LF1, const TopTools_ListOfShape& LF2, const TopOpeBRepBuild_GTopo& G);
357
358 Standard_EXPORT void GFillFacesWES (const TopTools_ListOfShape& LF1, const TopTools_ListOfShape& LF2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
359
360 Standard_EXPORT void GFillFacesWESK (const TopTools_ListOfShape& LF1, const TopTools_ListOfShape& LF2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES, const Standard_Integer K);
361
362 Standard_EXPORT void GFillFacesWESMakeFaces (const TopTools_ListOfShape& LF1, const TopTools_ListOfShape& LF2, const TopTools_ListOfShape& LSO, const TopOpeBRepBuild_GTopo& G);
363
364 Standard_EXPORT void GFillFaceWES (const TopoDS_Shape& F, const TopTools_ListOfShape& LF2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
365
366 Standard_EXPORT void GFillCurveTopologyWES (const TopoDS_Shape& F, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
367
368 Standard_EXPORT void GFillCurveTopologyWES (const TopOpeBRepDS_CurveIterator& IT, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES) const;
369
370 Standard_EXPORT void GFillONPartsWES (const TopoDS_Shape& F, const TopOpeBRepBuild_GTopo& G, const TopTools_ListOfShape& LSclass, TopOpeBRepBuild_WireEdgeSet& WES);
371
372 Standard_EXPORT void GFillWireWES (const TopoDS_Shape& W, const TopTools_ListOfShape& LF2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
373
374 Standard_EXPORT void GFillEdgeWES (const TopoDS_Shape& E, const TopTools_ListOfShape& LF2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
375
376 Standard_EXPORT void GSplitEdgeWES (const TopoDS_Shape& E, const TopTools_ListOfShape& LF2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
377
378 Standard_EXPORT void GMergeEdgeWES (const TopoDS_Shape& E, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
379
380 Standard_EXPORT void GSplitEdge (const TopoDS_Shape& E, const TopOpeBRepBuild_GTopo& G, const TopTools_ListOfShape& LSclass);
381
382 Standard_EXPORT void GMergeEdges (const TopTools_ListOfShape& LE1, const TopTools_ListOfShape& LE2, const TopOpeBRepBuild_GTopo& G);
383
384 Standard_EXPORT void GFillEdgesPVS (const TopTools_ListOfShape& LE1, const TopTools_ListOfShape& LE2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_PaveSet& PVS);
385
386 Standard_EXPORT void GFillEdgePVS (const TopoDS_Shape& E, const TopTools_ListOfShape& LE2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_PaveSet& PVS);
387
388 Standard_EXPORT void GFillPointTopologyPVS (const TopoDS_Shape& E, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_PaveSet& PVS);
389
390 Standard_EXPORT void GFillPointTopologyPVS (const TopoDS_Shape& E, const TopOpeBRepDS_PointIterator& IT, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_PaveSet& PVS) const;
391
392 Standard_EXPORT Standard_Boolean GParamOnReference (const TopoDS_Vertex& V, const TopoDS_Edge& E, Standard_Real& P) const;
393
394 Standard_EXPORT Standard_Boolean GKeepShape (const TopoDS_Shape& S, const TopTools_ListOfShape& Lref, const TopAbs_State T);
395
396 //! return True if S is classified <T> / Lref shapes
397 Standard_EXPORT Standard_Boolean GKeepShape1 (const TopoDS_Shape& S, const TopTools_ListOfShape& Lref, const TopAbs_State T, TopAbs_State& pos);
398
399 //! add to Lou the shapes of Lin classified <T> / Lref shapes.
400 //! Lou is not cleared. (S is a dummy trace argument)
401 Standard_EXPORT void GKeepShapes (const TopoDS_Shape& S, const TopTools_ListOfShape& Lref, const TopAbs_State T, const TopTools_ListOfShape& Lin, TopTools_ListOfShape& Lou);
402
403 Standard_EXPORT void GSFSMakeSolids (const TopoDS_Shape& SOF, TopOpeBRepBuild_ShellFaceSet& SFS, TopTools_ListOfShape& LOSO);
404
405 Standard_EXPORT void GSOBUMakeSolids (const TopoDS_Shape& SOF, TopOpeBRepBuild_SolidBuilder& SOBU, TopTools_ListOfShape& LOSO);
406
407 Standard_EXPORT virtual void GWESMakeFaces (const TopoDS_Shape& FF, TopOpeBRepBuild_WireEdgeSet& WES, TopTools_ListOfShape& LOF);
408
409 Standard_EXPORT void GFABUMakeFaces (const TopoDS_Shape& FF, TopOpeBRepBuild_FaceBuilder& FABU, TopTools_ListOfShape& LOF, TopTools_DataMapOfShapeInteger& MWisOld);
410
411 Standard_EXPORT void RegularizeFaces (const TopoDS_Shape& FF, const TopTools_ListOfShape& lnewFace, TopTools_ListOfShape& LOF);
412
413 Standard_EXPORT void RegularizeFace (const TopoDS_Shape& FF, const TopoDS_Shape& newFace, TopTools_ListOfShape& LOF);
414
415 Standard_EXPORT void RegularizeSolids (const TopoDS_Shape& SS, const TopTools_ListOfShape& lnewSolid, TopTools_ListOfShape& LOS);
416
417 Standard_EXPORT void RegularizeSolid (const TopoDS_Shape& SS, const TopoDS_Shape& newSolid, TopTools_ListOfShape& LOS);
418
419 Standard_EXPORT void GPVSMakeEdges (const TopoDS_Shape& EF, TopOpeBRepBuild_PaveSet& PVS, TopTools_ListOfShape& LOE) const;
420
421 Standard_EXPORT void GEDBUMakeEdges (const TopoDS_Shape& EF, TopOpeBRepBuild_EdgeBuilder& EDBU, TopTools_ListOfShape& LOE) const;
422
423 Standard_EXPORT Standard_Boolean GToSplit (const TopoDS_Shape& S, const TopAbs_State TB) const;
424
425 Standard_EXPORT Standard_Boolean GToMerge (const TopoDS_Shape& S) const;
426
427 Standard_EXPORT static Standard_Boolean GTakeCommonOfSame (const TopOpeBRepBuild_GTopo& G);
428
429 Standard_EXPORT static Standard_Boolean GTakeCommonOfDiff (const TopOpeBRepBuild_GTopo& G);
430
431 Standard_EXPORT void GFindSamDom (const TopoDS_Shape& S, TopTools_ListOfShape& L1, TopTools_ListOfShape& L2) const;
432
433 Standard_EXPORT void GFindSamDom (TopTools_ListOfShape& L1, TopTools_ListOfShape& L2) const;
434
435 Standard_EXPORT void GFindSamDomSODO (const TopoDS_Shape& S, TopTools_ListOfShape& LSO, TopTools_ListOfShape& LDO) const;
436
437 Standard_EXPORT void GFindSamDomSODO (TopTools_ListOfShape& LSO, TopTools_ListOfShape& LDO) const;
438
439 Standard_EXPORT void GMapShapes (const TopoDS_Shape& S1, const TopoDS_Shape& S2);
440
441 Standard_EXPORT void GClearMaps();
442
443 Standard_EXPORT void GFindSameRank (const TopTools_ListOfShape& L1, const Standard_Integer R, TopTools_ListOfShape& L2) const;
444
445 Standard_EXPORT Standard_Integer GShapeRank (const TopoDS_Shape& S) const;
446
447 Standard_EXPORT Standard_Boolean GIsShapeOf (const TopoDS_Shape& S, const Standard_Integer I12) const;
448
449 Standard_EXPORT static Standard_Boolean GContains (const TopoDS_Shape& S, const TopTools_ListOfShape& L);
450
451 Standard_EXPORT static void GCopyList (const TopTools_ListOfShape& Lin, const Standard_Integer i1, const Standard_Integer i2, TopTools_ListOfShape& Lou);
452
453 Standard_EXPORT static void GCopyList (const TopTools_ListOfShape& Lin, TopTools_ListOfShape& Lou);
454
455 Standard_EXPORT void GdumpLS (const TopTools_ListOfShape& L) const;
456
457 Standard_EXPORT static void GdumpPNT (const gp_Pnt& P);
458
459 Standard_EXPORT static void GdumpORIPARPNT (const TopAbs_Orientation o, const Standard_Real p, const gp_Pnt& Pnt);
460
461 Standard_EXPORT void GdumpSHA (const TopoDS_Shape& S, const Standard_Address str = NULL) const;
462
463 Standard_EXPORT void GdumpSHAORI (const TopoDS_Shape& S, const Standard_Address str = NULL) const;
464
465 Standard_EXPORT void GdumpSHAORIGEO (const TopoDS_Shape& S, const Standard_Address str = NULL) const;
466
467 Standard_EXPORT void GdumpSHASTA (const Standard_Integer iS, const TopAbs_State T, const TCollection_AsciiString& a = "", const TCollection_AsciiString& b = "") const;
468
469 Standard_EXPORT void GdumpSHASTA (const TopoDS_Shape& S, const TopAbs_State T, const TCollection_AsciiString& a = "", const TCollection_AsciiString& b = "") const;
470
471 Standard_EXPORT void GdumpSHASTA (const Standard_Integer iS, const TopAbs_State T, const TopOpeBRepBuild_ShapeSet& SS, const TCollection_AsciiString& a = "", const TCollection_AsciiString& b = "", const TCollection_AsciiString& c = "\n") const;
472
473 Standard_EXPORT void GdumpEDG (const TopoDS_Shape& S, const Standard_Address str = NULL) const;
474
475 Standard_EXPORT void GdumpEDGVER (const TopoDS_Shape& E, const TopoDS_Shape& V, const Standard_Address str = NULL) const;
476
477 Standard_EXPORT void GdumpSAMDOM (const TopTools_ListOfShape& L, const Standard_Address str = NULL) const;
478
479 Standard_EXPORT void GdumpEXP (const TopOpeBRepTool_ShapeExplorer& E) const;
480
481 Standard_EXPORT void GdumpSOBU (TopOpeBRepBuild_SolidBuilder& SB) const;
482
483 Standard_EXPORT void GdumpFABU (TopOpeBRepBuild_FaceBuilder& FB) const;
484
485 Standard_EXPORT void GdumpEDBU (TopOpeBRepBuild_EdgeBuilder& EB) const;
486
487 Standard_EXPORT Standard_Boolean GtraceSPS (const Standard_Integer iS) const;
488
489 Standard_EXPORT Standard_Boolean GtraceSPS (const Standard_Integer iS, const Standard_Integer jS) const;
490
491 Standard_EXPORT Standard_Boolean GtraceSPS (const TopoDS_Shape& S) const;
492
493 Standard_EXPORT Standard_Boolean GtraceSPS (const TopoDS_Shape& S, Standard_Integer& IS) const;
494
495 Standard_EXPORT void GdumpSHASETreset();
496
497 Standard_EXPORT Standard_Integer GdumpSHASETindex();
498
499 Standard_EXPORT static void PrintGeo (const TopoDS_Shape& S);
500
501 Standard_EXPORT static void PrintSur (const TopoDS_Face& F);
502
503 Standard_EXPORT static void PrintCur (const TopoDS_Edge& E);
504
505 Standard_EXPORT static void PrintPnt (const TopoDS_Vertex& V);
506
507 Standard_EXPORT static void PrintOri (const TopoDS_Shape& S);
508
509 Standard_EXPORT static TCollection_AsciiString StringState (const TopAbs_State S);
510
511 Standard_EXPORT static Standard_Boolean GcheckNBOUNDS (const TopoDS_Shape& E);
512
513
514friend class TopOpeBRepBuild_HBuilder;
515
516
517protected:
518
519
520 //! update the DS by creating new geometries.
521 //! create edges on the new curve <Icurv>.
522 Standard_EXPORT void BuildEdges (const Standard_Integer iC, const Handle(TopOpeBRepDS_HDataStructure)& DS);
523
524 //! update the DS by creating new geometries.
525 //! create faces on the new surface <ISurf>.
526 Standard_EXPORT void BuildFaces (const Standard_Integer iS, const Handle(TopOpeBRepDS_HDataStructure)& DS);
527
528 //! update the DS by creating new geometries.
529 //! create shapes from the new geometries.
530 Standard_EXPORT void BuildFaces (const Handle(TopOpeBRepDS_HDataStructure)& DS);
531
532 //! Split <E1> keeping the parts of state <TB1>.
533 Standard_EXPORT void SplitEdge (const TopoDS_Shape& E1, const TopAbs_State TB1, const TopAbs_State TB2);
534
535 //! Split <E1> keeping the parts of state <TB1>.
536 Standard_EXPORT void SplitEdge1 (const TopoDS_Shape& E1, const TopAbs_State TB1, const TopAbs_State TB2);
537
538 //! Split <E1> keeping the parts of state <TB1>.
539 Standard_EXPORT void SplitEdge2 (const TopoDS_Shape& E1, const TopAbs_State TB1, const TopAbs_State TB2);
540
541 //! Split <F1> keeping the parts of state <TB1>.
542 //! Merge faces with same domain, keeping parts of
543 //! state <TB2>.
544 Standard_EXPORT void SplitFace (const TopoDS_Shape& F1, const TopAbs_State TB1, const TopAbs_State TB2);
545
546 Standard_EXPORT void SplitFace1 (const TopoDS_Shape& F1, const TopAbs_State TB1, const TopAbs_State TB2);
547
548 Standard_EXPORT void SplitFace2 (const TopoDS_Shape& F1, const TopAbs_State TB1, const TopAbs_State TB2);
549
550 //! Split <S1> keeping the parts of state <TB1>.
551 Standard_EXPORT void SplitSolid (const TopoDS_Shape& S1, const TopAbs_State TB1, const TopAbs_State TB2);
552
553 //! Explore shapes of given by explorer <Ex> to split them.
554 //! Store new shapes in the set <SS>.
555 //! According to RevOri, reverse or not their orientation.
556 Standard_EXPORT void SplitShapes (TopOpeBRepTool_ShapeExplorer& Ex, const TopAbs_State TB1, const TopAbs_State TB2, TopOpeBRepBuild_ShapeSet& SS, const Standard_Boolean RevOri);
557
558 //! Split edges of <F1> and store wires and edges in
559 //! the set <WES>. According to RevOri, reverse (or not) orientation.
560 Standard_EXPORT void FillFace (const TopoDS_Shape& F1, const TopAbs_State TB1, const TopTools_ListOfShape& LF2, const TopAbs_State TB2, TopOpeBRepBuild_WireEdgeSet& WES, const Standard_Boolean RevOri);
561
562 //! Split faces of <S1> and store shells and faces in
563 //! the set <SS>. According to RevOri, reverse (or not) orientation.
564 Standard_EXPORT void FillSolid (const TopoDS_Shape& S1, const TopAbs_State TB1, const TopTools_ListOfShape& LS2, const TopAbs_State TB2, TopOpeBRepBuild_ShapeSet& SS, const Standard_Boolean RevOri);
565
566 //! Split subshapes of <S1> and store subshapes in
567 //! the set <SS>. According to RevOri, reverse (or not) orientation.
568 Standard_EXPORT void FillShape (const TopoDS_Shape& S1, const TopAbs_State TB1, const TopTools_ListOfShape& LS2, const TopAbs_State TB2, TopOpeBRepBuild_ShapeSet& SS, const Standard_Boolean RevOri);
569
570 //! fills the vertex set PVS with the point iterator IT.
571 //! IT accesses a list of interferences which geometry is a point or a vertex.
572 //! TB indicates the orientation to give to the geometries
573 //! found in interference list accessed by IT.
574 Standard_EXPORT void FillVertexSet (TopOpeBRepDS_PointIterator& IT, const TopAbs_State TB, TopOpeBRepBuild_PaveSet& PVS) const;
575
576 //! fills vertex set PVS with the current value of IT.
577 //! I geometry is a point or a vertex.
578 //! TB indicates the orientation to give to geometries found I
579 Standard_EXPORT void FillVertexSetOnValue (const TopOpeBRepDS_PointIterator& IT, const TopAbs_State TB, TopOpeBRepBuild_PaveSet& PVS) const;
580
581 //! Returns True if the shape <S> has not already been split
582 Standard_EXPORT Standard_Boolean ToSplit (const TopoDS_Shape& S, const TopAbs_State TB) const;
583
584 //! add the shape <S> to the map of split shapes.
585 //! mark <S> as split/not split on <state>, according to B value.
586 Standard_EXPORT void MarkSplit (const TopoDS_Shape& S, const TopAbs_State TB, const Standard_Boolean B = Standard_True);
587
588 //! Returns a ref. on the list of shapes connected to <S> as
589 //! <TB> merged parts of <S>.
590 Standard_EXPORT TopTools_ListOfShape& ChangeMerged (const TopoDS_Shape& S, const TopAbs_State TB);
591
592 //! Returns a ref. on the vertex created on point <I>.
593 Standard_EXPORT TopoDS_Shape& ChangeNewVertex (const Standard_Integer I);
594
595 //! Returns a ref. on the list of edges created on curve <I>.
596 Standard_EXPORT TopTools_ListOfShape& ChangeNewEdges (const Standard_Integer I);
597
598 //! Returns a ref. on the list of faces created on surface <I>.
599 Standard_EXPORT TopTools_ListOfShape& ChangeNewFaces (const Standard_Integer I);
600
601 Standard_EXPORT void AddIntersectionEdges (TopoDS_Shape& F, const TopAbs_State TB, const Standard_Boolean RevOri, TopOpeBRepBuild_ShapeSet& ES) const;
602
603 Standard_EXPORT void UpdateSplitAndMerged (const TopTools_DataMapOfIntegerListOfShape& mle, const TopTools_DataMapOfIntegerShape& mre, const TopTools_DataMapOfShapeShape& mlf, const TopAbs_State state);
604
605
606 TopAbs_State myState1;
607 TopAbs_State myState2;
608 TopoDS_Shape myShape1;
609 TopoDS_Shape myShape2;
610 Handle(TopOpeBRepDS_HDataStructure) myDataStructure;
611 TopOpeBRepDS_BuildTool myBuildTool;
612 Handle(TopTools_HArray1OfShape) myNewVertices;
613 TopTools_DataMapOfIntegerListOfShape myNewEdges;
614 Handle(TopTools_HArray1OfListOfShape) myNewFaces;
615 TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State mySplitIN;
616 TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State mySplitON;
617 TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State mySplitOUT;
618 TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State myMergedIN;
619 TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State myMergedON;
620 TopOpeBRepDS_DataMapOfShapeListOfShapeOn1State myMergedOUT;
621 TopTools_ListOfShape myEmptyShapeList;
622 TopTools_ListOfShape myListOfSolid;
623 TopTools_ListOfShape myListOfFace;
624 TopTools_ListOfShape myListOfEdge;
625 TopTools_DataMapOfShapeListOfShape myFSplits;
626 TopTools_DataMapOfShapeListOfShape myESplits;
627 Standard_Boolean mySectionDone;
628 Standard_Boolean mySplitSectionEdgesDone;
629 TopTools_ListOfShape mySection;
630 TopoDS_Solid mySolidReference;
631 TopoDS_Solid mySolidToFill;
632 TopTools_ListOfShape myFaceAvoid;
633 TopoDS_Face myFaceReference;
634 TopoDS_Face myFaceToFill;
635 TopTools_ListOfShape myEdgeAvoid;
636 TopoDS_Edge myEdgeReference;
637 TopoDS_Edge myEdgeToFill;
638 TopTools_ListOfShape myVertexAvoid;
639 TopTools_IndexedMapOfShape myMAP1;
640 TopTools_IndexedMapOfShape myMAP2;
641 Standard_Integer myIsKPart;
642 TopTools_DataMapOfShapeListOfShape myKPMAPf1f2;
643 Standard_Integer mySHASETindex;
644 Standard_Boolean myClassifyDef;
645 Standard_Boolean myClassifyVal;
646 TopOpeBRepTool_ShapeClassifier myShapeClassifier;
647 TopTools_MapOfShape myMemoSplit;
648 TCollection_AsciiString myEmptyAS;
649 Standard_Boolean myProcessON;
650 TopTools_IndexedDataMapOfShapeShape myONFacesMap;
651 TopTools_IndexedMapOfOrientedShape myONElemMap;
652
653
654private:
655
656
657
658
659
660};
661
662
663
664
665
666
667
668#endif // _TopOpeBRepBuild_Builder_HeaderFile