2cb8087a14c9af8eaccfd012e7fc7ff82e83f52d
[occt.git] / src / BOPDS / BOPDS_DS.cdl
1 -- Created by: Peter KURNEV
2 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
3 --
4 -- This file is part of Open CASCADE Technology software library.
5 --
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.
11 --
12 -- Alternatively, this file may be used under the terms of Open CASCADE
13 -- commercial license or contractual agreement.
14
15 class DS from BOPDS 
16
17         ---Purpose: 
18             -- The class BOPDS_DS provides the control 
19         -- the data structure for  
20             -- partition and  boolean operation algorithms 
21         -- 
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] 
34         
35 uses  
36     ShapeEnum     from TopAbs, 
37     Box from Bnd, 
38     Shape         from TopoDS,
39     -- 
40     ListOfShape from BOPCol,  
41     DataMapOfIntegerInteger from BOPCol,
42     DataMapOfShapeInteger   from BOPCol, 
43     ListOfInteger           from BOPCol, 
44     MapOfInteger            from BOPCol, 
45     BaseAllocator           from BOPCol, 
46     --
47     ShapeInfo  from BOPDS, 
48     IndexRange from BOPDS, 
49     VectorOfIndexRange from BOPDS,
50     VectorOfShapeInfo  from BOPDS, 
51     VectorOfListOfPaveBlock from BOPDS,  
52     ListOfPaveBlock    from BOPDS,  
53     ListOfPave from BOPDS,
54     PaveBlock from BOPDS,  
55     CommonBlock from BOPDS,
56     MapOfPaveBlock from BOPDS, 
57     IndexedMapOfPaveBlock from BOPDS, 
58     VectorOfFaceInfo from BOPDS, 
59     FaceInfo from BOPDS, 
60     --  
61     MapOfPassKey     from BOPDS,  
62     DataMapOfPaveBlockCommonBlock from BOPDS,
63     --
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
74  
75 --raises
76
77 is
78     Create 
79             returns DS from BOPDS; 
80     ---C++: alias "Standard_EXPORT virtual ~BOPDS_DS();"  
81             ---Purpose:  
82             --- Empty contructor  
83             ---     
84     Create (theAllocator: BaseAllocator from BOPCol) 
85             returns DS from BOPDS;  
86             ---Purpose:  
87             ---  Contructor    
88             ---  theAllocator - the allocator to manage the memory     
89             ---     
90   
91     Clear(me:out); 
92             ---Purpose:  
93         --  Clears the contents 
94          
95     Allocator(me) 
96             returns BaseAllocator from BOPCol; 
97     ---C++: return const &         
98              ---Purpose:  
99             --- Selector  
100             --- 
101         
102     SetArguments(me:out; 
103                 theLS:ListOfShape from BOPCol); 
104             ---Purpose: 
105         --- Modifier 
106         --- Sets the arguments [theLS] of an operation  
107          
108     Arguments(me) 
109             returns ListOfShape from BOPCol;  
110     ---C++: return const &         
111              ---Purpose:  
112             --- Selector  
113             --- Returns the arguments of an operation 
114          
115     Init(me:out); 
116             ---Purpose: 
117               --- Initializes the data structure for 
118         --  the arguments 
119          
120     NbShapes(me) 
121             returns Integer from Standard; 
122             ---Purpose:  
123             --- Selector  
124             --- Returns the total number of shapes stored   
125          
126     NbSourceShapes(me) 
127             returns Integer from Standard; 
128         ---Purpose:  
129             --- Selector  
130             --- Returns the total number of source shapes stored    
131  
132     NbRanges(me) 
133             returns Integer from Standard; 
134         ---Purpose:  
135             --- Selector  
136             --- Returns the number of index ranges     
137     
138     Range(me; 
139                 theIndex:Integer from Standard) 
140             returns IndexRange from BOPDS; 
141     ---C++: return const & 
142              ---Purpose:  
143             --- Selector  
144             --- Returns the index range "i"      
145      
146     Rank (me; 
147                 theIndex:Integer from Standard) 
148         returns Integer from Standard; 
149             ---Purpose: 
150             --- Selector   
151             --- Returns the rank of the shape of index "i"  
152             
153     IsNewShape(me; 
154                 theIndex:Integer from Standard) 
155         returns Boolean from Standard; 
156             ---Purpose:  
157             --- Returns true if the shape of index "i" is not 
158         --- the source shape/sub-shape 
159          
160     --
161     --  shapes and auxiliary info  
162     --
163     Append(me:out; 
164                 theSI:ShapeInfo from BOPDS) 
165             returns Integer from Standard; 
166             ---Purpose: 
167             --- Modifier  
168         --- Appends the information about the shape [theSI] 
169         --- to the data structure  
170         --- Returns the index of theSI in the data structure 
171          
172     Append(me:out;  
173                 theS:Shape from TopoDS) 
174             returns Integer from Standard; 
175             ---Purpose:  
176             --- Modifier  
177         --- Appends the default information about the shape [theS] 
178         --- to the data structure  
179         --- Returns the index of theS in the data structure  
180         
181     ShapeInfo(me; 
182                 theIndex:Integer from Standard) 
183         returns ShapeInfo from BOPDS; 
184     ---C++: return const & 
185             ---Purpose: 
186         --- Selector 
187         --- Returns the information about the shape  
188         --- with index theIndex 
189          
190     ChangeShapeInfo(me:out; 
191                 theIndex:Integer from Standard) 
192         returns ShapeInfo from BOPDS; 
193     ---C++: return &  
194             ---Purpose:      
195             --- Selector/Modifier
196         --- Returns the information about the shape  
197         --- with index theIndex 
198     
199     Shape(me; 
200                 theIndex:Integer from Standard) 
201         returns Shape from TopoDS; 
202     ---C++: return const &   
203              ---Purpose:  
204             --- Selector
205         --- Returns the shape  
206         --  with index theIndex 
207      
208     Index(me; 
209                 theS:Shape from TopoDS) 
210             returns Integer from Standard; 
211             ---Purpose:  
212             --- Selector
213         --- Returns the index  of the shape theS 
214
215     -- 
216     -- pave blocks
217     -- 
218     PaveBlocksPool(me)  
219             returns VectorOfListOfPaveBlock from BOPDS; 
220     ---C++: return const &  
221             ---Purpose:  
222             --- Selector
223         --- Returns the information about pave blocks on source edges 
224
225     ChangePaveBlocksPool(me:out)  
226             returns VectorOfListOfPaveBlock from BOPDS; 
227     ---C++: return &  
228             ---Purpose:  
229             --- Selector/Modifier
230         --- Returns the information about pave blocks on source edges  
231
232     HasPaveBlocks(me; 
233                 theIndex:Integer from Standard)  
234         returns Boolean from Standard; 
235             ---Purpose:  
236             --- Query
237         --- Returns true if the shape with index theIndex has the 
238         --- information about pave blocks 
239      
240     PaveBlocks (me; 
241                 theIndex:Integer from Standard) 
242         returns ListOfPaveBlock from BOPDS; 
243     ---C++: return const &  
244             ---Purpose:  
245             --- Selector
246         --- Returns the pave blocks for the shape with index theIndex  
247
248     ChangePaveBlocks (me:out; 
249                 theIndex:Integer from Standard) 
250         returns ListOfPaveBlock from BOPDS; 
251     ---C++: return & 
252               ---Purpose:  
253             --- Selector/Modifier
254         --- Returns the pave blocks for the shape with index theIndex 
255          
256     InitPaveBlocks(me:out; 
257                 theIndex:Integer from Standard) 
258             is protected;  
259         ---Purpose:  
260         --- Initializes the pave blocks for the shape with index theIndex
261      
262     UpdatePaveBlocks(me:out);  
263             ---Purpose:  
264         --- Update the pave blocks for the all shapes in data structure 
265         
266     UpdatePaveBlock(me:out; 
267                 thePB:PaveBlock from BOPDS);  
268              ---Purpose:  
269         --- Update the pave block thePB 
270          
271     UpdateCommonBlock(me:out; 
272                 theCB:CommonBlock from BOPDS); 
273             ---Purpose:   
274             --- Update the common block theCB  
275              
276     IsCommonBlock(me; 
277                 thePB:PaveBlock from BOPDS)
278         returns Boolean from Standard; 
279     ---Purpose: 
280     --- Query 
281     --- Returns true if the pave block is common block     
282      
283     CommonBlock(me; 
284                 thePB:PaveBlock from BOPDS)
285         returns CommonBlock from BOPDS;     
286     ---Purpose: 
287     --- Selector  
288     --- Returns the common block  
289      
290     SetCommonBlock(me:out; 
291                 thePB:PaveBlock from BOPDS;
292                 theCB:CommonBlock from BOPDS); 
293     ---Purpose: 
294     --- Modifier  
295     --- Sets the common block <theCB>  
296  
297     RealPaveBlock(me; 
298                 thePB:PaveBlock from BOPDS) 
299     returns PaveBlock from BOPDS;
300     ---Purpose: 
301     --- Selector  
302     --- Returns the real first pave block  
303  
304     IsCommonBlockOnEdge(me; 
305                 thePB:PaveBlock from BOPDS)   
306     returns Boolean from Standard;       
307     ---Purpose: 
308     --- Query 
309     --- Returns true if common block contains more then one pave block 
310     
311     -- 
312     -- face info
313     --   
314     FaceInfoPool(me) 
315         returns VectorOfFaceInfo from BOPDS; 
316     ---C++: return const &   
317              ---Purpose:  
318             --- Selector
319         --- Returns the information about state of faces  
320         
321     HasFaceInfo(me; 
322                 theIndex:Integer from Standard)  
323         returns Boolean from Standard;  
324         ---Purpose:   
325             --- Query
326         --- Returns true if the shape with index theIndex has the 
327         --- information about state of face  
328         
329     FaceInfo(me; 
330                theIndex:Integer from Standard) 
331             returns FaceInfo from BOPDS; 
332     ---C++: return const & 
333             ---Purpose:  
334             --- Selector
335         --- Returns the state of face with index theIndex    
336
337     ChangeFaceInfo(me:out; 
338                 theIndex:Integer from Standard) 
339             returns FaceInfo from BOPDS; 
340     ---C++: return  & 
341              ---Purpose:  
342             --- Selector/Modifier
343         --- Returns the state of face with index theIndex  
344         
345     InitFaceInfo(me:out; 
346                 theIndex:Integer from Standard) 
347             is protected; 
348         ---Purpose:  
349         --- Initializes the state of face with index theIndex 
350          
351     UpdateFaceInfoIn(me:out; 
352                 theIndex:Integer from Standard); 
353             ---Purpose:  
354         --- Update the state In of face with index theIndex    
355         
356     UpdateFaceInfoOn(me:out; 
357                 theIndex:Integer from Standard); 
358             ---Purpose:  
359         --- Update the state On of face with index theIndex   
360
361     FaceInfoOn(me:out;  
362                 theIndex:Integer from Standard;  
363             theMPB:out IndexedMapOfPaveBlock from BOPDS;
364             theMVP:out MapOfInteger from BOPCol);  
365         ---Purpose:  
366             --- Selector
367         --- Returns the state On  
368             --- [theMPB,theMVP] of face with index theIndex 
369          
370     FaceInfoIn(me:out;  
371                 theIndex:Integer from Standard;  
372             theMPB:out IndexedMapOfPaveBlock from BOPDS;
373             theMVP:out MapOfInteger from BOPCol);  
374             ---Purpose:  
375             --- Selector
376         --- Returns the state In  
377             --- [theMPB,theMVP] of face with index theIndex 
378      
379     AloneVertices(me; 
380                 theF:Integer from Standard; 
381                 theLI:out ListOfInteger from BOPCol); 
382               ---Purpose:   
383             --- Selector
384         --- Returns the indices of alone vertices  
385             --- for the face with index theIndex 
386          
387     RefineFaceInfoOn(me:out);  
388             ---Purpose:   
389         --- Refine the state On for the all faces having 
390         --- state information 
391     -- 
392     --  ++ 
393     --
394     VerticesOnIn(me; 
395                 theF1:Integer from Standard; 
396                 theF2:Integer from Standard; 
397                 theMI:out MapOfInteger from BOPCol; 
398                 aMPB: out IndexedMapOfPaveBlock from BOPDS);
399         ---Purpose:   
400         --- Returns the indices of vertices and pave blocks 
401         --- that  are On/In for the faces with indices theF1, theF2  
402         
403     SharedEdges(me:out; 
404                 theF1:Integer from Standard; 
405                 theF2:Integer from Standard; 
406                 theLI:out ListOfInteger from BOPCol; 
407                 theAllocator:BaseAllocator from BOPCol); 
408              ---Purpose:   
409         --- Returns the indices of edges that are  shared 
410         --- for the faces with indices theF1, theF2  
411     -- 
412     -- same domain shapes
413     --  
414     ShapesSD (me:out) 
415         returns DataMapOfIntegerInteger from BOPCol; 
416     ---C++: return &   
417              ---Purpose:  
418             --- Selector
419         --- Returns the collection same domain shapes  
420         
421     AddShapeSD(me:out; 
422                 theIndex:Integer from Standard;  
423             theIndexSD:Integer from Standard); 
424         ---Purpose:  
425             --- Modifier
426         --- Adds the information about same domain shapes  
427         --- with indices theIndex, theIndexSD  
428          
429     HasShapeSD(me; 
430                 theIndex:Integer from Standard;  
431             theIndexSD:out Integer from Standard) 
432         returns Boolean from Standard;  
433             ---Purpose:   
434             --- Query
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
438     --
439     -- interferences
440     --  
441     InterfVV(me:out) 
442             returns VectorOfInterfVV from BOPDS; 
443     ---C++: return &  
444     ---C++: inline  
445             ---Purpose:  
446             --- Selector/Modifier
447         --- Returns the collection of interferences Vertex/Vertex   
448      
449     InterfVE(me:out) 
450             returns VectorOfInterfVE from BOPDS; 
451     ---C++: return &  
452     ---C++: inline   
453             ---Purpose:  
454             --- Selector/Modifier
455         --- Returns the collection of interferences Vertex/Edge  
456      
457     InterfVF(me:out) 
458             returns VectorOfInterfVF from BOPDS; 
459     ---C++: return &  
460     ---C++: inline  
461             ---Purpose:  
462             --- Selector/Modifier
463         --- Returns the collection of interferences Vertex/Face  
464      
465     InterfEE(me:out) 
466             returns VectorOfInterfEE from BOPDS; 
467     ---C++: return &  
468     ---C++: inline 
469             ---Purpose:  
470             --- Selector/Modifier
471         --- Returns the collection of interferences Edge/Edge  
472      
473     InterfEF(me:out) 
474             returns VectorOfInterfEF from BOPDS; 
475     ---C++: return &  
476     ---C++: inline 
477             ---Purpose:  
478             --- Selector/Modifier
479         --- Returns the collection of interferences Edge/Face  
480
481     InterfFF(me:out) 
482             returns VectorOfInterfFF from BOPDS; 
483     ---C++: return &  
484     ---C++: inline  
485             ---Purpose:  
486             --- Selector/Modifier
487         --- Returns the collection of interferences Face/Face  
488  
489      InterfVZ(me:out) 
490             returns VectorOfInterfVZ from BOPDS; 
491     ---C++: return &  
492     ---C++: inline  
493             ---Purpose:  
494             --- Selector/Modifier
495         --- Returns the collection of interferences Vertex/Solid   
496      
497     InterfEZ(me:out) 
498             returns VectorOfInterfEZ from BOPDS; 
499     ---C++: return &  
500     ---C++: inline  
501             ---Purpose:  
502             --- Selector/Modifier
503         --- Returns the collection of interferences Edge/Solid   
504   
505     InterfFZ(me:out) 
506             returns VectorOfInterfFZ from BOPDS; 
507     ---C++: return &  
508     ---C++: inline  
509             ---Purpose:  
510             --- Selector/Modifier
511         --- Returns the collection of interferences Face/Solid           
512  
513     InterfZZ(me:out) 
514             returns VectorOfInterfZZ from BOPDS; 
515     ---C++: return &  
516     ---C++: inline  
517             ---Purpose:  
518             --- Selector/Modifier
519         --- Returns the collection of interferences Solid/Solid                  
520             
521     NbInterfTypes(myclass)  
522         returns Integer from Standard;  
523         ---C++: inline       
524            ---Purpose: 
525            -- Returns the number of types of the interferences 
526            -- 
527  
528     AddInterf(me:out; 
529                 theI1:Integer from Standard;
530                 theI2:Integer from Standard); 
531     ---C++: inline 
532             ---Purpose:  
533             --- Modifier
534         --- Adds the information about an interference between  
535         --- shapes with indices theI1, theI2 to the summary 
536         --- table of interferences 
537          
538     HasInterf(me; 
539                 theI:Integer from Standard)
540         returns Boolean from Standard; 
541             ---Purpose: 
542             --- Query
543         --- Returns true if the shape with index theI    
544         --- is interferred
545           
546     HasInterf(me; 
547                 theI1:Integer from Standard;  
548             theI2:Integer from Standard) 
549         returns Boolean from Standard; 
550     ---C++: inline 
551             ---Purpose: 
552             --- Query
553         --- Returns true if the shapes with indices theI1, theI2    
554         --- are interferred 
555          
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;  
561             ---Purpose: 
562             --- Query
563         --- Returns true if the shape with index theI1 is interfered 
564         --- with  
565         --    any sub-shape of the shape with index theI2  (theFlag=true)    
566         --    all sub-shapes of the shape with index theI2 (theFlag=false)     
567   
568     HasInterfSubShapes(me; 
569             theI1:Integer from Standard;  
570             theI2:Integer from Standard) 
571         returns Boolean from Standard; 
572             ---Purpose: 
573             --- Query
574         --- Returns true if the shapes with indices theI1, theI2    
575         --- have interferred sub-shapes    
576  
577     Interferences(me) 
578          returns MapOfPassKey from BOPDS; 
579     ---C++: return const &   
580     ---C++: inline 
581             ---Purpose:  
582             --- Selector
583         --- Returns the table of interferences 
584     -- 
585     -- debug
586     -- 
587     Dump(me);     
588     -- 
589     -- protected methods 
590     -- 
591     InitShape(me:out;  
592                 theIndex:Integer from Standard;
593                 theS:Shape from TopoDS; 
594                 theAllocator:out BaseAllocator from BOPCol;   
595             theMSI:out DataMapOfShapeInteger from BOPCol) 
596             is protected;  
597              
598     CheckCoincidence(me:out; 
599                 thePB1:PaveBlock from BOPDS;
600                 thePB2:PaveBlock from BOPDS)
601             returns Boolean from Standard 
602             is protected;
603  
604     SortPaveBlocks(me:out; 
605                 theCB:CommonBlock from BOPDS);
606  
607     IsToSort(me:out; 
608                 theCB:CommonBlock from BOPDS; 
609                 theI:out Integer from Standard) 
610              returns Boolean from Standard;
611      
612     IsSubShape(me:out; 
613                 theI1:Integer from Standard; 
614                 theI2:Integer from Standard) 
615              returns Boolean from Standard; 
616  
617     Paves(me:out; 
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   
622              
623      UpdateEdgeTolerance(me:out; 
624                  theIndex:Integer from Standard; 
625                  theTolerance:Real from Standard); 
626              ---Purpose: 
627              --- Updates tolerance of the sub-shapes of the shape with index <theIndex>.
628              ---
629  
630     BuildBndBoxSolid (me:out; 
631                 theIndex:Integer from Standard;  
632                 theBox:out Box from Bnd) 
633         is protected;  
634             ---Purpose: 
635             --- Computes bouding box <theBox> for the solid with DS-index <theIndex>
636             ---  
637             
638
639  
640 fields  
641     myAllocator        : BaseAllocator from BOPCol is protected;
642     myArguments        : ListOfShape from BOPCol is protected;   
643     --contents         
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;
649     -- 
650     myPaveBlocksPool   : VectorOfListOfPaveBlock from BOPDS is protected;  
651     myMapPBCB          : DataMapOfPaveBlockCommonBlock from BOPDS is protected;
652     myFaceInfoPool     : VectorOfFaceInfo  from BOPDS is protected; 
653     --                 
654     --same domain shapes 
655     myShapesSD         : DataMapOfIntegerInteger from BOPCol is protected;  
656     -- 
657     --interferences 
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;
669 end DS;