42cf5bc1 |
1 | // Created by: Peter KURNEV |
2 | // Copyright (c) 2010-2014 OPEN CASCADE SAS |
3 | // Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE |
4 | // Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, |
5 | // EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS |
6 | // |
7 | // This file is part of Open CASCADE Technology software library. |
8 | // |
9 | // This library is free software; you can redistribute it and/or modify it under |
10 | // the terms of the GNU Lesser General Public License version 2.1 as published |
11 | // by the Free Software Foundation, with special exception defined in the file |
12 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
13 | // distribution for complete text of the license and disclaimer of any warranty. |
14 | // |
15 | // Alternatively, this file may be used under the terms of Open CASCADE |
16 | // commercial license or contractual agreement. |
17 | |
18 | #ifndef _BOPAlgo_Builder_HeaderFile |
19 | #define _BOPAlgo_Builder_HeaderFile |
20 | |
21 | #include <Standard.hxx> |
22 | #include <Standard_DefineAlloc.hxx> |
23 | #include <Standard_Handle.hxx> |
24 | |
42cf5bc1 |
25 | #include <BOPAlgo_PPaveFiller.hxx> |
1155d05a |
26 | #include <BOPAlgo_BuilderShape.hxx> |
483ce1bd |
27 | #include <BOPAlgo_GlueEnum.hxx> |
13c0e402 |
28 | #include <BOPAlgo_Operation.hxx> |
42cf5bc1 |
29 | #include <BOPDS_PDS.hxx> |
1155d05a |
30 | #include <NCollection_BaseAllocator.hxx> |
42cf5bc1 |
31 | #include <Standard_Integer.hxx> |
42cf5bc1 |
32 | #include <Standard_Real.hxx> |
1155d05a |
33 | #include <TopTools_DataMapOfShapeListOfShape.hxx> |
34 | #include <TopTools_DataMapOfShapeShape.hxx> |
42cf5bc1 |
35 | #include <TopTools_ListOfShape.hxx> |
1155d05a |
36 | #include <TopTools_MapOfShape.hxx> |
42cf5bc1 |
37 | #include <TopAbs_ShapeEnum.hxx> |
38 | class IntTools_Context; |
39 | class TopoDS_Shape; |
42cf5bc1 |
40 | |
33ba8565 |
41 | //! |
42 | //! The class is a General Fuse algorithm - base algorithm for the |
43 | //! algorithms in the Boolean Component. Its main purpose is to build |
44 | //! the split parts of the argument shapes from which the result of |
45 | //! the operations is combined.<br> |
46 | //! The result of the General Fuse algorithm itself is a compound |
47 | //! containing all split parts of the arguments. <br> |
48 | //! |
49 | //! Additionally to the options of the base classes, the algorithm has |
50 | //! the following options:<br> |
51 | //! - *Safe processing mode* - allows to avoid modification of the input |
52 | //! shapes during the operation (by default it is off);<br> |
53 | //! - *Gluing options* - allows to speed up the calculation of the intersections |
54 | //! on the special cases, in which some sub-shapes are coinciding.<br> |
81a55a69 |
55 | //! - *Disabling the check for inverted solids* - Disables/Enables the check of the input solids |
56 | //! for inverted status (holes in the space). The default value is TRUE, |
57 | //! i.e. the check is performed. Setting this flag to FALSE for inverted solids, |
58 | //! most likely will lead to incorrect results. |
33ba8565 |
59 | //! |
80d55adf |
60 | //! The algorithm returns the following warnings: |
61 | //! - *BOPAlgo_AlertUnableToOrientTheShape* - in case the check on the orientation of the split shape |
62 | //! to match the orientation of the original shape has failed. |
63 | //! |
33ba8565 |
64 | //! The algorithm returns the following Error statuses: |
65 | //! - *BOPAlgo_AlertTooFewArguments* - in case there are no enough arguments to perform the operation; |
66 | //! - *BOPAlgo_AlertNoFiller* - in case the intersection tool has not been created; |
67 | //! - *BOPAlgo_AlertIntersectionFailed* - in case the intersection of the arguments has failed; |
68 | //! - *BOPAlgo_AlertBuilderFailed* - in case building splits of arguments has failed with some unexpected error. |
69 | //! |
42cf5bc1 |
70 | class BOPAlgo_Builder : public BOPAlgo_BuilderShape |
71 | { |
72 | public: |
73 | |
74 | DEFINE_STANDARD_ALLOC |
75 | |
81a55a69 |
76 | //! Empty constructor. |
42cf5bc1 |
77 | Standard_EXPORT BOPAlgo_Builder(); |
81a55a69 |
78 | Standard_EXPORT virtual ~BOPAlgo_Builder(); |
79 | |
1155d05a |
80 | Standard_EXPORT BOPAlgo_Builder(const Handle(NCollection_BaseAllocator)& theAllocator); |
81a55a69 |
81 | |
82 | //! Clears the content of the algorithm. |
33ba8565 |
83 | Standard_EXPORT virtual void Clear() Standard_OVERRIDE; |
81a55a69 |
84 | |
85 | //! Returns the PaveFiller, algorithm for sub-shapes intersection. |
86 | BOPAlgo_PPaveFiller PPaveFiller() |
87 | { |
88 | return myPaveFiller; |
89 | } |
90 | |
91 | //! Returns the Data Structure, holder of intersection information. |
92 | BOPDS_PDS PDS() |
93 | { |
94 | return myDS; |
95 | } |
96 | |
97 | //! Returns the Context, tool for cashing heavy algorithms. |
98 | Handle(IntTools_Context) Context() const |
99 | { |
100 | return myContext; |
101 | } |
102 | |
103 | |
104 | public: //! @name Arguments |
105 | |
106 | //! Adds the argument to the operation. |
42cf5bc1 |
107 | Standard_EXPORT virtual void AddArgument (const TopoDS_Shape& theShape); |
81a55a69 |
108 | |
109 | //! Sets the list of arguments for the operation. |
1155d05a |
110 | Standard_EXPORT virtual void SetArguments (const TopTools_ListOfShape& theLS); |
3510db62 |
111 | |
81a55a69 |
112 | //! Returns the list of arguments. |
113 | const TopTools_ListOfShape& Arguments() const |
114 | { |
115 | return myArguments; |
116 | } |
117 | |
118 | public: //! @name Options |
119 | |
3510db62 |
120 | //! Sets the flag that defines the mode of treatment. |
121 | //! In non-destructive mode the argument shapes are not modified. Instead |
122 | //! a copy of a sub-shape is created in the result if it is needed to be updated. |
123 | //! This flag is taken into account if internal PaveFiller is used only. |
124 | //! In the case of calling PerformWithFiller the corresponding flag of that PaveFiller |
125 | //! is in force. |
81a55a69 |
126 | void SetNonDestructive(const Standard_Boolean theFlag) |
127 | { |
128 | myNonDestructive = theFlag; |
129 | } |
42cf5bc1 |
130 | |
3510db62 |
131 | //! Returns the flag that defines the mode of treatment. |
132 | //! In non-destructive mode the argument shapes are not modified. Instead |
133 | //! a copy of a sub-shape is created in the result if it is needed to be updated. |
81a55a69 |
134 | Standard_Boolean NonDestructive() const |
135 | { |
136 | return myNonDestructive; |
137 | } |
42cf5bc1 |
138 | |
483ce1bd |
139 | //! Sets the glue option for the algorithm |
81a55a69 |
140 | void SetGlue(const BOPAlgo_GlueEnum theGlue) |
141 | { |
142 | myGlue = theGlue; |
143 | } |
144 | |
483ce1bd |
145 | //! Returns the glue option of the algorithm |
81a55a69 |
146 | BOPAlgo_GlueEnum Glue() const |
147 | { |
148 | return myGlue; |
149 | } |
42cf5bc1 |
150 | |
81a55a69 |
151 | //! Enables/Disables the check of the input solids for inverted status |
152 | void SetCheckInverted(const Standard_Boolean theCheck) |
153 | { |
154 | myCheckInverted = theCheck; |
155 | } |
42cf5bc1 |
156 | |
81a55a69 |
157 | //! Returns the flag defining whether the check for input solids on inverted status |
158 | //! should be performed or not. |
159 | Standard_Boolean CheckInverted() const |
160 | { |
161 | return myCheckInverted; |
162 | } |
163 | |
164 | |
165 | public: //! @name Performing the operation |
166 | |
167 | //! Performs the operation. |
168 | //! The intersection will be performed also. |
d03c0898 |
169 | Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; |
81a55a69 |
170 | |
171 | //! Performs the operation with the prepared filler. |
172 | //! The intersection will not be performed in this case. |
d03c0898 |
173 | Standard_EXPORT virtual void PerformWithFiller (const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange = Message_ProgressRange()); |
81a55a69 |
174 | |
175 | |
13c0e402 |
176 | public: //! @name BOPs on open solids |
177 | |
178 | //! Builds the result shape according to the given states for the objects |
179 | //! and tools. These states can be unambiguously converted into the Boolean operation type. |
180 | //! Thus, it performs the Boolean operation on the given groups of shapes. |
181 | //! |
182 | //! The result is built basing on the result of Builder operation (GF or any other). |
183 | //! The only condition for the Builder is that the splits of faces should be created |
184 | //! and classified relatively solids. |
185 | //! |
186 | //! The method uses classification approach for choosing the faces which will |
187 | //! participate in building the result shape: |
188 | //! - All faces from each group having the given state for the opposite group |
189 | //! will be taken into result. |
190 | //! |
191 | //! Such approach shows better results (in comparison with BOPAlgo_BuilderSolid approach) |
192 | //! when working with open solids. However, the result may not be always |
193 | //! correct on such data (at least, not as expected) as the correct classification |
194 | //! of the faces relatively open solids is not always possible and may vary |
195 | //! depending on the chosen classification point on the face. |
196 | //! |
197 | //! History is not created for the solids in this method. |
198 | //! |
199 | //! To avoid pollution of the report of Builder algorithm, there is a possibility to pass |
200 | //! the different report to collect the alerts of the method only. But, if the new report |
201 | //! is not given, the Builder report will be used. |
202 | //! So, even if Builder passed without any errors, but some error has been stored into its report |
203 | //! in this method, for the following calls the Builder report must be cleared. |
204 | //! |
205 | //! The method may set the following errors: |
206 | //! - BOPAlgo_AlertBuilderFailed - Building operation has not been performed yet or failed; |
207 | //! - BOPAlgo_AlertBOPNotSet - invalid BOP type is given (COMMON/FUSE/CUT/CUT21 are supported); |
208 | //! - BOPAlgo_AlertTooFewArguments - arguments are not given; |
209 | //! - BOPAlgo_AlertUnknownShape - the shape is unknown for the operation. |
210 | //! |
211 | //! Parameters: |
d03c0898 |
212 | //! @param theObjects - The group of Objects for BOP; |
213 | //! @param theObjState - State for objects faces to pass into result; |
214 | //! @param theTools - The group of Tools for BOP; |
215 | //! @param theToolsState - State for tools faces to pass into result; |
216 | //! @param theReport - The alternative report to avoid pollution of the main one. |
217 | Standard_EXPORT virtual void BuildBOP(const TopTools_ListOfShape& theObjects, |
218 | const TopAbs_State theObjState, |
219 | const TopTools_ListOfShape& theTools, |
220 | const TopAbs_State theToolsState, |
221 | const Message_ProgressRange& theRange, |
222 | Handle(Message_Report) theReport = NULL); |
13c0e402 |
223 | |
224 | //! Builds the result of Boolean operation of given type |
225 | //! basing on the result of Builder operation (GF or any other). |
226 | //! |
227 | //! The method converts the given type of operation into the states |
228 | //! for the objects and tools required for their face to pass into result |
229 | //! and performs the call to the same method, but with states instead |
230 | //! of operation type. |
231 | //! |
232 | //! The conversion looks as follows: |
233 | //! - COMMON is built from the faces of objects located IN any of the tools |
234 | //! and vice versa. |
235 | //! - FUSE is built from the faces OUT of all given shapes; |
236 | //! - CUT is built from the faces of the objects OUT of the tools and |
237 | //! faces of the tools located IN solids of the objects. |
238 | //! |
239 | //! @param theObjects - The group of Objects for BOP; |
240 | //! @param theTools - The group of Tools for BOP; |
241 | //! @param theOperation - The BOP type; |
d03c0898 |
242 | //! @param theRange - The parameter to progressIndicator |
13c0e402 |
243 | //! @param theReport - The alternative report to avoid pollution of the global one. |
d03c0898 |
244 | void BuildBOP(const TopTools_ListOfShape& theObjects, |
245 | const TopTools_ListOfShape& theTools, |
246 | const BOPAlgo_Operation theOperation, |
247 | const Message_ProgressRange& theRange, |
248 | Handle(Message_Report) theReport = NULL) |
13c0e402 |
249 | { |
250 | TopAbs_State anObjState, aToolsState; |
251 | switch (theOperation) |
252 | { |
253 | case BOPAlgo_COMMON: |
254 | { |
255 | anObjState = TopAbs_IN; |
256 | aToolsState = TopAbs_IN; |
257 | break; |
258 | } |
259 | case BOPAlgo_FUSE: |
260 | { |
261 | anObjState = TopAbs_OUT; |
262 | aToolsState = TopAbs_OUT; |
263 | break; |
264 | } |
265 | case BOPAlgo_CUT: |
266 | { |
267 | anObjState = TopAbs_OUT; |
268 | aToolsState = TopAbs_IN; |
269 | break; |
270 | } |
271 | case BOPAlgo_CUT21: |
272 | { |
273 | anObjState = TopAbs_IN; |
274 | aToolsState = TopAbs_OUT; |
275 | break; |
276 | } |
277 | default: |
278 | { |
279 | anObjState = TopAbs_UNKNOWN; |
280 | aToolsState = TopAbs_UNKNOWN; |
281 | break; |
282 | } |
283 | } |
d03c0898 |
284 | BuildBOP(theObjects, anObjState, theTools, aToolsState, theRange, theReport); |
13c0e402 |
285 | } |
286 | |
803a8caf |
287 | protected: //! @name History methods |
288 | |
289 | //! Prepare information for history support. |
d03c0898 |
290 | Standard_EXPORT void PrepareHistory(const Message_ProgressRange& theRange); |
803a8caf |
291 | |
292 | //! Prepare history information for the input shapes taking into account possible |
293 | //! operation-specific modifications. |
294 | //! For instance, in the CellsBuilder operation, additionally to splitting input shapes |
295 | //! the splits of the shapes (or the shapes themselves) may be unified during removal of internal |
296 | //! boundaries. In this case each split should be linked to the unified shape. |
297 | //! |
298 | //! To have correct history information, the method should be redefined in each operation |
299 | //! where such additional modification is possible. The input shape <theS> should be the one from arguments, |
300 | //! and the returning list should contain all final elements to which the input shape has evolved, |
301 | //! including those not contained in the result shape. |
302 | //! |
303 | //! The method returns pointer to the list of modified elements. |
304 | //! NULL pointer means that the shape has not been modified at all. |
305 | //! |
306 | //! The General Fuse operation does not perform any other modification than splitting the input |
307 | //! shapes basing on their intersection information. This information is contained in myImages map. |
308 | //! Thus, here the method returns only splits (if any) contained in this map. |
309 | Standard_EXPORT virtual const TopTools_ListOfShape* LocModified(const TopoDS_Shape& theS); |
310 | |
948fe6ca |
311 | //! Returns the list of shapes generated from the shape theS. |
312 | //! Similarly to *LocModified* must be redefined for specific operations, |
313 | //! obtaining Generated elements differently. |
314 | Standard_EXPORT virtual const TopTools_ListOfShape& LocGenerated(const TopoDS_Shape& theS); |
81a55a69 |
315 | |
316 | public: //! @name Images/Origins |
317 | |
318 | //! Returns the map of images. |
319 | const TopTools_DataMapOfShapeListOfShape& Images() const |
320 | { |
321 | return myImages; |
322 | } |
323 | |
324 | //! Returns the map of origins. |
325 | const TopTools_DataMapOfShapeListOfShape& Origins() const |
326 | { |
327 | return myOrigins; |
328 | } |
329 | |
330 | //! Returns the map of Same Domain (SD) shapes - coinciding shapes |
331 | //! from different arguments. |
332 | const TopTools_DataMapOfShapeShape& ShapesSD() const |
333 | { |
334 | return myShapesSD; |
335 | } |
336 | |
d03c0898 |
337 | protected://! @name Analyze progress of the operation |
338 | |
339 | //! List of operations to be supported by the Progress Indicator |
340 | enum BOPAlgo_PIOperation |
341 | { |
342 | PIOperation_TreatVertices = 0, |
343 | PIOperation_TreatEdges, |
344 | PIOperation_TreatWires, |
345 | PIOperation_TreatFaces, |
346 | PIOperation_TreatShells, |
347 | PIOperation_TreatSolids, |
348 | PIOperation_TreatCompsolids, |
349 | PIOperation_TreatCompounds, |
350 | PIOperation_FillHistory, |
351 | PIOperation_PostTreat, |
352 | PIOperation_Last |
353 | }; |
354 | |
355 | |
356 | //! Auxiliary structure to get information about number of shapes |
357 | //! of each type participated in operation. |
358 | class NbShapes |
359 | { |
360 | public: |
361 | NbShapes() |
362 | { |
363 | for (Standard_Integer i = 0; i < 8; ++i) |
364 | { |
365 | myNbShapesArr[i] = 0; |
366 | } |
367 | } |
368 | |
369 | Standard_Integer NbVertices() const { return myNbShapesArr[0]; } |
370 | Standard_Integer NbEdges() const { return myNbShapesArr[1]; } |
371 | Standard_Integer NbWires() const { return myNbShapesArr[2]; } |
372 | Standard_Integer NbFaces() const { return myNbShapesArr[3]; } |
373 | Standard_Integer NbShells() const { return myNbShapesArr[4]; } |
374 | Standard_Integer NbSolids() const { return myNbShapesArr[5]; } |
375 | Standard_Integer NbCompsolids() const { return myNbShapesArr[6]; } |
376 | Standard_Integer NbCompounds() const { return myNbShapesArr[7]; } |
377 | |
378 | Standard_Integer& NbVertices() { return myNbShapesArr[0]; } |
379 | Standard_Integer& NbEdges() { return myNbShapesArr[1]; } |
380 | Standard_Integer& NbWires() { return myNbShapesArr[2]; } |
381 | Standard_Integer& NbFaces() { return myNbShapesArr[3]; } |
382 | Standard_Integer& NbShells() { return myNbShapesArr[4]; } |
383 | Standard_Integer& NbSolids() { return myNbShapesArr[5]; } |
384 | Standard_Integer& NbCompsolids() { return myNbShapesArr[6]; } |
385 | Standard_Integer& NbCompounds() { return myNbShapesArr[7]; } |
386 | |
387 | private: |
388 | Standard_Integer myNbShapesArr[8]; |
389 | }; |
390 | |
391 | protected: |
392 | |
393 | //! Compute number of shapes of certain type participating in operation |
394 | Standard_EXPORT NbShapes getNbShapes() const; |
395 | |
396 | //! Filling steps for constant operations |
397 | Standard_EXPORT void fillPIConstants(const Standard_Real theWhole, BOPAlgo_PISteps& theSteps) const Standard_OVERRIDE; |
398 | |
399 | //! Filling steps for all other operations |
400 | Standard_EXPORT void fillPISteps(BOPAlgo_PISteps& theSteps) const Standard_OVERRIDE; |
81a55a69 |
401 | |
402 | protected: //! @name Methods for building the result |
403 | |
404 | //! Performs the building of the result. |
b81b237f |
405 | //! The method calls the PerformInternal1() method surrounded by a try-catch block. |
d03c0898 |
406 | Standard_EXPORT virtual void PerformInternal (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange); |
81a55a69 |
407 | |
408 | //! Performs the building of the result. |
409 | //! To build the result of any other operation |
410 | //! it will be necessary to override this method. |
d03c0898 |
411 | Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange); |
81a55a69 |
412 | |
81a55a69 |
413 | //! Builds the result of operation. |
414 | //! The method is called for each of the arguments type and |
415 | //! adds into the result the splits of the arguments of that type. |
416 | Standard_EXPORT virtual void BuildResult (const TopAbs_ShapeEnum theType); |
417 | |
418 | |
419 | protected: //! @name Checking input arguments |
420 | |
421 | //! Checks the input data. |
42cf5bc1 |
422 | Standard_EXPORT virtual void CheckData() Standard_OVERRIDE; |
33ba8565 |
423 | |
81a55a69 |
424 | //! Checks if the intersection algorithm has Errors/Warnings. |
33ba8565 |
425 | Standard_EXPORT void CheckFiller(); |
81a55a69 |
426 | |
427 | //! Prepares the result shape by making it empty compound. |
42cf5bc1 |
428 | Standard_EXPORT virtual void Prepare(); |
81a55a69 |
429 | |
430 | |
431 | protected: //! @name Fill Images of VERTICES |
432 | |
433 | //! Fills the images of vertices. |
d03c0898 |
434 | Standard_EXPORT void FillImagesVertices(const Message_ProgressRange& theRange); |
81a55a69 |
435 | |
436 | |
437 | protected: //! @name Fill Images of EDGES |
438 | |
439 | //! Fills the images of edges. |
d03c0898 |
440 | Standard_EXPORT void FillImagesEdges(const Message_ProgressRange& theRange); |
81a55a69 |
441 | |
442 | |
443 | protected: //! @name Fill Images of CONTAINERS |
444 | |
445 | //! Fills the images of containers (WIRES/SHELLS/COMPSOLID). |
d03c0898 |
446 | Standard_EXPORT void FillImagesContainers (const TopAbs_ShapeEnum theType, const Message_ProgressRange& theRange); |
81a55a69 |
447 | |
448 | //! Builds the image of the given container using the splits |
449 | //! of its sub-shapes. |
42cf5bc1 |
450 | Standard_EXPORT void FillImagesContainer (const TopoDS_Shape& theS, const TopAbs_ShapeEnum theType); |
81a55a69 |
451 | |
452 | |
453 | protected: //! @name Fill Images of FACES |
454 | |
455 | //! Fills the images of faces. |
456 | //! The method consists of three steps: |
457 | //! 1. Build the splits of faces; |
458 | //! 2. Find SD faces; |
459 | //! 3. Add internal vertices (if any) to faces. |
d03c0898 |
460 | Standard_EXPORT void FillImagesFaces(const Message_ProgressRange& theRange); |
81a55a69 |
461 | |
462 | //! Builds the splits of faces using the information from the |
463 | //! intersection stage stored in Data Structure. |
d03c0898 |
464 | Standard_EXPORT virtual void BuildSplitFaces(const Message_ProgressRange& theRange); |
81a55a69 |
465 | |
466 | //! Looks for the same domain faces among the splits of the faces. |
467 | //! Updates the map of images with SD faces. |
d03c0898 |
468 | Standard_EXPORT void FillSameDomainFaces(const Message_ProgressRange& theRange); |
81a55a69 |
469 | |
470 | //! Classifies the alone vertices on faces relatively its splits |
471 | //! and adds them as INTERNAL into the splits. |
d03c0898 |
472 | Standard_EXPORT void FillInternalVertices(const Message_ProgressRange& theRange); |
81a55a69 |
473 | |
474 | |
475 | protected: //! @name Fill Images of SOLIDS |
476 | |
477 | //! Fills the images of solids. |
478 | //! The method consists of four steps: |
479 | //! 1. Build the draft solid - just rebuild the solid using the splits of faces; |
480 | //! 2. Find faces from other arguments located inside the solids; |
481 | //! 3. Build splits of solid using the inside faces; |
482 | //! 4. Fill internal shapes for the splits (Wires and vertices). |
d03c0898 |
483 | Standard_EXPORT void FillImagesSolids(const Message_ProgressRange& theRange); |
81a55a69 |
484 | |
485 | //! Builds the draft solid by rebuilding the shells of the solid |
486 | //! with the splits of faces. |
487 | Standard_EXPORT void BuildDraftSolid (const TopoDS_Shape& theSolid, |
488 | TopoDS_Shape& theDraftSolid, |
489 | TopTools_ListOfShape& theLIF); |
490 | |
491 | //! Finds faces located inside each solid. |
d03c0898 |
492 | Standard_EXPORT virtual void FillIn3DParts(TopTools_DataMapOfShapeShape& theDraftSolids, |
493 | const Message_ProgressRange& theRange); |
81a55a69 |
494 | |
495 | //! Builds the splits of the solids using their draft versions |
496 | //! and faces located inside. |
d03c0898 |
497 | Standard_EXPORT void BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSolids, |
498 | const Message_ProgressRange& theRange); |
81a55a69 |
499 | |
500 | //! Classifies the vertices and edges from the arguments relatively |
501 | //! splits of solids and makes them INTERNAL for solids. |
d03c0898 |
502 | Standard_EXPORT void FillInternalShapes(const Message_ProgressRange& theRange); |
81a55a69 |
503 | |
504 | |
505 | protected: //! @name Fill Images of COMPOUNDS |
506 | |
507 | //! Fills the images of compounds. |
d03c0898 |
508 | Standard_EXPORT void FillImagesCompounds(const Message_ProgressRange& theRange); |
81a55a69 |
509 | |
510 | //! Builds the image of the given compound. |
511 | Standard_EXPORT void FillImagesCompound (const TopoDS_Shape& theS, |
512 | TopTools_MapOfShape& theMF); |
513 | |
514 | protected: //! @name Post treatment |
515 | |
516 | //! Post treatment of the result of the operation. |
517 | //! The method checks validity of the sub-shapes of the result |
518 | //! and updates the tolerances to make them valid. |
d03c0898 |
519 | Standard_EXPORT virtual void PostTreat(const Message_ProgressRange& theRange); |
42cf5bc1 |
520 | |
81a55a69 |
521 | protected: //! @name Fields |
42cf5bc1 |
522 | |
81a55a69 |
523 | TopTools_ListOfShape myArguments; //!< Arguments of the operation |
524 | TopTools_MapOfShape myMapFence; //!< Fence map providing the uniqueness of the shapes in the list of arguments |
525 | BOPAlgo_PPaveFiller myPaveFiller; //!< Pave Filler - algorithm for sub-shapes intersection |
526 | BOPDS_PDS myDS; //!< Data Structure - holder of intersection information |
527 | Handle(IntTools_Context) myContext; //!< Context - tool for cashing heavy algorithms such as Projectors and Classifiers |
528 | Standard_Integer myEntryPoint; //!< EntryPoint - controls the deletion of the PaveFiller, which could live longer than the Builder |
529 | TopTools_DataMapOfShapeListOfShape myImages; //!< Images - map of Images of the sub-shapes of arguments |
530 | TopTools_DataMapOfShapeShape myShapesSD; //!< ShapesSD - map of SD Shapes |
531 | TopTools_DataMapOfShapeListOfShape myOrigins; //!< Origins - map of Origins, back map of Images |
13c0e402 |
532 | TopTools_DataMapOfShapeListOfShape myInParts; //!< InParts - map of own and acquired IN faces of the arguments solids |
81a55a69 |
533 | Standard_Boolean myNonDestructive; //!< Safe processing option allows avoiding modification of the input shapes |
534 | BOPAlgo_GlueEnum myGlue; //!< Gluing option allows speeding up the intersection of the input shapes |
535 | Standard_Boolean myCheckInverted; //!< Check inverted option allows disabling the check of input solids on inverted status |
42cf5bc1 |
536 | |
42cf5bc1 |
537 | }; |
538 | |
42cf5bc1 |
539 | #endif // _BOPAlgo_Builder_HeaderFile |