1 -- Created by: Peter KURNEV
2 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
4 -- This file is part of Open CASCADE Technology software library.
6 -- This library is free software; you can redistribute it and/or modify it under
7 -- the terms of the GNU Lesser General Public License version 2.1 as published
8 -- by the Free Software Foundation, with special exception defined in the file
9 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 -- distribution for complete text of the license and disclaimer of any warranty.
12 -- Alternatively, this file may be used under the terms of Open CASCADE
13 -- commercial license or contractual agreement.
18 -- The class BOPDS_DS provides the control
19 -- the data structure for
20 -- partition and boolean operation algorithms
22 -- The data structure has the following contents:
23 -- 1. the arguments of an operation [myArguments];
24 -- 2 the information about arguments/new shapes
25 -- and their sub-shapes (type of the shape,
26 -- bounding box, etc) [myLines];
27 -- 3. each argument shape(and its subshapes)
28 -- has/have own range of indices (rank)
29 -- 4. pave blocks on source edges [myPaveBlocksPool];
30 -- 5. the state of source faces [myFaceInfoPool]
31 -- 6 the collection of same domain shapes [myShapesSD]
32 -- 7 the collection of interferences [myInterfTB,
33 -- myInterfVV,..myInterfFF]
36 ShapeEnum from TopAbs,
40 ListOfShape from BOPCol,
41 DataMapOfIntegerInteger from BOPCol,
42 DataMapOfShapeInteger from BOPCol,
43 ListOfInteger from BOPCol,
44 MapOfInteger from BOPCol,
45 BaseAllocator from BOPCol,
48 IndexRange from BOPDS,
49 VectorOfIndexRange from BOPDS,
50 VectorOfShapeInfo from BOPDS,
51 VectorOfListOfPaveBlock from BOPDS,
52 ListOfPaveBlock from BOPDS,
53 ListOfPave from BOPDS,
55 CommonBlock from BOPDS,
56 MapOfPaveBlock from BOPDS,
57 IndexedMapOfPaveBlock from BOPDS,
58 VectorOfFaceInfo from BOPDS,
61 MapOfPassKey from BOPDS,
62 DataMapOfPaveBlockCommonBlock from BOPDS,
64 VectorOfInterfVV from BOPDS,
65 VectorOfInterfVE from BOPDS,
66 VectorOfInterfVF from BOPDS,
67 VectorOfInterfEE from BOPDS,
68 VectorOfInterfEF from BOPDS,
69 VectorOfInterfFF from BOPDS,
70 VectorOfInterfVZ from BOPDS,
71 VectorOfInterfEZ from BOPDS,
72 VectorOfInterfFZ from BOPDS,
73 VectorOfInterfZZ from BOPDS
79 returns DS from BOPDS;
80 ---C++: alias "Standard_EXPORT virtual ~BOPDS_DS();"
84 Create (theAllocator: BaseAllocator from BOPCol)
85 returns DS from BOPDS;
88 --- theAllocator - the allocator to manage the memory
93 -- Clears the contents
96 returns BaseAllocator from BOPCol;
97 ---C++: return const &
103 theLS:ListOfShape from BOPCol);
106 --- Sets the arguments [theLS] of an operation
109 returns ListOfShape from BOPCol;
110 ---C++: return const &
113 --- Returns the arguments of an operation
117 --- Initializes the data structure for
121 returns Integer from Standard;
124 --- Returns the total number of shapes stored
127 returns Integer from Standard;
130 --- Returns the total number of source shapes stored
133 returns Integer from Standard;
136 --- Returns the number of index ranges
139 theIndex:Integer from Standard)
140 returns IndexRange from BOPDS;
141 ---C++: return const &
144 --- Returns the index range "i"
147 theIndex:Integer from Standard)
148 returns Integer from Standard;
151 --- Returns the rank of the shape of index "i"
154 theIndex:Integer from Standard)
155 returns Boolean from Standard;
157 --- Returns true if the shape of index "i" is not
158 --- the source shape/sub-shape
161 -- shapes and auxiliary info
164 theSI:ShapeInfo from BOPDS)
165 returns Integer from Standard;
168 --- Appends the information about the shape [theSI]
169 --- to the data structure
170 --- Returns the index of theSI in the data structure
173 theS:Shape from TopoDS)
174 returns Integer from Standard;
177 --- Appends the default information about the shape [theS]
178 --- to the data structure
179 --- Returns the index of theS in the data structure
182 theIndex:Integer from Standard)
183 returns ShapeInfo from BOPDS;
184 ---C++: return const &
187 --- Returns the information about the shape
188 --- with index theIndex
190 ChangeShapeInfo(me:out;
191 theIndex:Integer from Standard)
192 returns ShapeInfo from BOPDS;
195 --- Selector/Modifier
196 --- Returns the information about the shape
197 --- with index theIndex
200 theIndex:Integer from Standard)
201 returns Shape from TopoDS;
202 ---C++: return const &
205 --- Returns the shape
206 -- with index theIndex
209 theS:Shape from TopoDS)
210 returns Integer from Standard;
213 --- Returns the index of the shape theS
219 returns VectorOfListOfPaveBlock from BOPDS;
220 ---C++: return const &
223 --- Returns the information about pave blocks on source edges
225 ChangePaveBlocksPool(me:out)
226 returns VectorOfListOfPaveBlock from BOPDS;
229 --- Selector/Modifier
230 --- Returns the information about pave blocks on source edges
233 theIndex:Integer from Standard)
234 returns Boolean from Standard;
237 --- Returns true if the shape with index theIndex has the
238 --- information about pave blocks
241 theIndex:Integer from Standard)
242 returns ListOfPaveBlock from BOPDS;
243 ---C++: return const &
246 --- Returns the pave blocks for the shape with index theIndex
248 ChangePaveBlocks (me:out;
249 theIndex:Integer from Standard)
250 returns ListOfPaveBlock from BOPDS;
253 --- Selector/Modifier
254 --- Returns the pave blocks for the shape with index theIndex
256 InitPaveBlocks(me:out;
257 theIndex:Integer from Standard)
260 --- Initializes the pave blocks for the shape with index theIndex
262 UpdatePaveBlocks(me:out);
264 --- Update the pave blocks for the all shapes in data structure
266 UpdatePaveBlock(me:out;
267 thePB:PaveBlock from BOPDS);
269 --- Update the pave block thePB
271 UpdateCommonBlock(me:out;
272 theCB:CommonBlock from BOPDS);
274 --- Update the common block theCB
277 thePB:PaveBlock from BOPDS)
278 returns Boolean from Standard;
281 --- Returns true if the pave block is common block
284 thePB:PaveBlock from BOPDS)
285 returns CommonBlock from BOPDS;
288 --- Returns the common block
290 SetCommonBlock(me:out;
291 thePB:PaveBlock from BOPDS;
292 theCB:CommonBlock from BOPDS);
295 --- Sets the common block <theCB>
298 thePB:PaveBlock from BOPDS)
299 returns PaveBlock from BOPDS;
302 --- Returns the real first pave block
304 IsCommonBlockOnEdge(me;
305 thePB:PaveBlock from BOPDS)
306 returns Boolean from Standard;
309 --- Returns true if common block contains more then one pave block
315 returns VectorOfFaceInfo from BOPDS;
316 ---C++: return const &
319 --- Returns the information about state of faces
322 theIndex:Integer from Standard)
323 returns Boolean from Standard;
326 --- Returns true if the shape with index theIndex has the
327 --- information about state of face
330 theIndex:Integer from Standard)
331 returns FaceInfo from BOPDS;
332 ---C++: return const &
335 --- Returns the state of face with index theIndex
337 ChangeFaceInfo(me:out;
338 theIndex:Integer from Standard)
339 returns FaceInfo from BOPDS;
342 --- Selector/Modifier
343 --- Returns the state of face with index theIndex
346 theIndex:Integer from Standard)
349 --- Initializes the state of face with index theIndex
351 UpdateFaceInfoIn(me:out;
352 theIndex:Integer from Standard);
354 --- Update the state In of face with index theIndex
356 UpdateFaceInfoOn(me:out;
357 theIndex:Integer from Standard);
359 --- Update the state On of face with index theIndex
362 theIndex:Integer from Standard;
363 theMPB:out IndexedMapOfPaveBlock from BOPDS;
364 theMVP:out MapOfInteger from BOPCol);
367 --- Returns the state On
368 --- [theMPB,theMVP] of face with index theIndex
371 theIndex:Integer from Standard;
372 theMPB:out IndexedMapOfPaveBlock from BOPDS;
373 theMVP:out MapOfInteger from BOPCol);
376 --- Returns the state In
377 --- [theMPB,theMVP] of face with index theIndex
380 theF:Integer from Standard;
381 theLI:out ListOfInteger from BOPCol);
384 --- Returns the indices of alone vertices
385 --- for the face with index theIndex
387 RefineFaceInfoOn(me:out);
389 --- Refine the state On for the all faces having
390 --- state information
395 theF1:Integer from Standard;
396 theF2:Integer from Standard;
397 theMI:out MapOfInteger from BOPCol;
398 aMPB: out IndexedMapOfPaveBlock from BOPDS);
400 --- Returns the indices of vertices and pave blocks
401 --- that are On/In for the faces with indices theF1, theF2
404 theF1:Integer from Standard;
405 theF2:Integer from Standard;
406 theLI:out ListOfInteger from BOPCol;
407 theAllocator:BaseAllocator from BOPCol);
409 --- Returns the indices of edges that are shared
410 --- for the faces with indices theF1, theF2
412 -- same domain shapes
415 returns DataMapOfIntegerInteger from BOPCol;
419 --- Returns the collection same domain shapes
422 theIndex:Integer from Standard;
423 theIndexSD:Integer from Standard);
426 --- Adds the information about same domain shapes
427 --- with indices theIndex, theIndexSD
430 theIndex:Integer from Standard;
431 theIndexSD:out Integer from Standard)
432 returns Boolean from Standard;
435 --- Returns true if the shape with index theIndex has the
436 --- same domain shape. In this case theIndexSD will contain
437 -- the index of same domain shape found
442 returns VectorOfInterfVV from BOPDS;
446 --- Selector/Modifier
447 --- Returns the collection of interferences Vertex/Vertex
450 returns VectorOfInterfVE from BOPDS;
454 --- Selector/Modifier
455 --- Returns the collection of interferences Vertex/Edge
458 returns VectorOfInterfVF from BOPDS;
462 --- Selector/Modifier
463 --- Returns the collection of interferences Vertex/Face
466 returns VectorOfInterfEE from BOPDS;
470 --- Selector/Modifier
471 --- Returns the collection of interferences Edge/Edge
474 returns VectorOfInterfEF from BOPDS;
478 --- Selector/Modifier
479 --- Returns the collection of interferences Edge/Face
482 returns VectorOfInterfFF from BOPDS;
486 --- Selector/Modifier
487 --- Returns the collection of interferences Face/Face
490 returns VectorOfInterfVZ from BOPDS;
494 --- Selector/Modifier
495 --- Returns the collection of interferences Vertex/Solid
498 returns VectorOfInterfEZ from BOPDS;
502 --- Selector/Modifier
503 --- Returns the collection of interferences Edge/Solid
506 returns VectorOfInterfFZ from BOPDS;
510 --- Selector/Modifier
511 --- Returns the collection of interferences Face/Solid
514 returns VectorOfInterfZZ from BOPDS;
518 --- Selector/Modifier
519 --- Returns the collection of interferences Solid/Solid
521 NbInterfTypes(myclass)
522 returns Integer from Standard;
525 -- Returns the number of types of the interferences
529 theI1:Integer from Standard;
530 theI2:Integer from Standard);
534 --- Adds the information about an interference between
535 --- shapes with indices theI1, theI2 to the summary
536 --- table of interferences
539 theI:Integer from Standard)
540 returns Boolean from Standard;
543 --- Returns true if the shape with index theI
547 theI1:Integer from Standard;
548 theI2:Integer from Standard)
549 returns Boolean from Standard;
553 --- Returns true if the shapes with indices theI1, theI2
556 HasInterfShapeSubShapes(me;
557 theI1:Integer from Standard;
558 theI2:Integer from Standard;
559 theFlag: Boolean from Standard=Standard_True)
560 returns Boolean from Standard;
563 --- Returns true if the shape with index theI1 is interfered
565 -- any sub-shape of the shape with index theI2 (theFlag=true)
566 -- all sub-shapes of the shape with index theI2 (theFlag=false)
568 HasInterfSubShapes(me;
569 theI1:Integer from Standard;
570 theI2:Integer from Standard)
571 returns Boolean from Standard;
574 --- Returns true if the shapes with indices theI1, theI2
575 --- have interferred sub-shapes
578 returns MapOfPassKey from BOPDS;
579 ---C++: return const &
583 --- Returns the table of interferences
592 theIndex:Integer from Standard;
593 theS:Shape from TopoDS;
594 theAllocator:out BaseAllocator from BOPCol;
595 theMSI:out DataMapOfShapeInteger from BOPCol)
598 CheckCoincidence(me:out;
599 thePB1:PaveBlock from BOPDS;
600 thePB2:PaveBlock from BOPDS)
601 returns Boolean from Standard
604 SortPaveBlocks(me:out;
605 theCB:CommonBlock from BOPDS);
608 theCB:CommonBlock from BOPDS;
609 theI:out Integer from Standard)
610 returns Boolean from Standard;
613 theI1:Integer from Standard;
614 theI2:Integer from Standard)
615 returns Boolean from Standard;
618 theIndex:Integer from Standard;
619 theLP:out ListOfPave from BOPDS);
620 ---Purpose: Fills theLP with sorted paves
621 -- of the shape with index theIndex
623 UpdateEdgeTolerance(me:out;
624 theIndex:Integer from Standard;
625 theTolerance:Real from Standard);
627 --- Updates tolerance of the sub-shapes of the shape with index <theIndex>.
630 BuildBndBoxSolid (me:out;
631 theIndex:Integer from Standard;
632 theBox:out Box from Bnd)
635 --- Computes bouding box <theBox> for the solid with DS-index <theIndex>
641 myAllocator : BaseAllocator from BOPCol is protected;
642 myArguments : ListOfShape from BOPCol is protected;
644 myNbShapes : Integer from Standard is protected;
645 myNbSourceShapes : Integer from Standard is protected;
646 myRanges : VectorOfIndexRange from BOPDS is protected;
647 myLines : VectorOfShapeInfo from BOPDS is protected;
648 myMapShapeIndex : DataMapOfShapeInteger from BOPCol is protected;
650 myPaveBlocksPool : VectorOfListOfPaveBlock from BOPDS is protected;
651 myMapPBCB : DataMapOfPaveBlockCommonBlock from BOPDS is protected;
652 myFaceInfoPool : VectorOfFaceInfo from BOPDS is protected;
655 myShapesSD : DataMapOfIntegerInteger from BOPCol is protected;
658 myInterfTB : MapOfPassKey from BOPDS is protected;
659 myInterfVV : VectorOfInterfVV from BOPDS is protected;
660 myInterfVE : VectorOfInterfVE from BOPDS is protected;
661 myInterfVF : VectorOfInterfVF from BOPDS is protected;
662 myInterfEE : VectorOfInterfEE from BOPDS is protected;
663 myInterfEF : VectorOfInterfEF from BOPDS is protected;
664 myInterfFF : VectorOfInterfFF from BOPDS is protected;
665 myInterfVZ : VectorOfInterfVZ from BOPDS is protected;
666 myInterfEZ : VectorOfInterfEZ from BOPDS is protected;
667 myInterfFZ : VectorOfInterfFZ from BOPDS is protected;
668 myInterfZZ : VectorOfInterfZZ from BOPDS is protected;