Adding of testing cases from subgroups 937 940 and 941 of CHL group
[occt.git] / src / BooleanOperations / BooleanOperations_ShapesDataStructure.cdl
1 -- Created on: 2000-08-10
2 -- Created by: Vincent DELOS
3 -- Copyright (c) 2000-2012 OPEN CASCADE SAS
4 --
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
9 --
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 --
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
19
20
21
22 class ShapesDataStructure from BooleanOperations 
23
24         ---Purpose: 
25
26 uses
27     Box                    from Bnd,
28     Shape                  from TopoDS,
29     ShapeEnum              from TopAbs,
30     Orientation            from TopAbs,
31     StateOfShape           from BooleanOperations, 
32 --modified by NIZNHY-PKV Wed Feb  2 14:20:09 2005f 
33 --    InterferencesList      from BooleanOperations,
34 --    InterferenceResult     from BooleanOperations, 
35 --modified by NIZNHY-PKV Wed Feb  2 14:20:14 2005t
36     ShapeAndInterferences  from BooleanOperations,
37     AncestorsAndSuccessors from BooleanOperations,
38     PShapeAndInterferences from BooleanOperations,
39     IndexedMapOfInteger    from TColStd,
40     IndexedMapOfShape      from TopTools,
41     IndexedMapOfOrientedShape    from TopTools,
42     AncestorsSeqAndSuccessorsSeq from BooleanOperations,
43     IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations, 
44     IndexedDataMapOfShapeInteger from BooleanOperations, 
45     CArray1OfInteger from BOPTColStd 
46      
47 --raises
48
49 is
50     Create  
51         returns ShapesDataStructure;
52     ---C++: alias "Standard_EXPORT virtual ~BooleanOperations_ShapesDataStructure();" 
53 --modified by NIZNHY-PKV Wed Feb  2 11:34:40 2005ft     
54     Create (Object,Tool: Shape from TopoDS)  
55         returns ShapesDataStructure; 
56         
57 --modified by NIZNHY-PKV Wed Feb  2 11:34:46 2005ft    
58     Destroy(me: in out) 
59         is  protected;
60 --    --C++: alias ~
61
62     ReInit (me:in out)  
63         is private;
64     
65     InsertShapeAndAncestorsSuccessors (me:in out;  
66                                        S: Shape from TopoDS;  
67                                        AncSuc: AncestorsSeqAndSuccessorsSeq;  
68                                        shift: Integer=0);
69     ---Purpose: fill  a line of the  data structure, the shift is used
70     --          for the numbers of the shapes of the Tool. 
71     
72
73        
74     FillIndexedMapOfShapesAncestorsAndSuccessors (me;  
75                                                   Sha: Shape from TopoDS;  
76                                                   IndDatMap:out IndexedDataMapOfShapeAncestorsSuccessors);
77     ---Purpose: to find the   data  structure we first decompose  the
78     --          Object and Tool in the indexed data map of shapes.    
79
80     FindSubshapes (me;  
81                     Sha: Shape from TopoDS;  
82                     TotalNumberOfShapes:out Integer from Standard;  
83                     IndDatMap:out IndexedDataMapOfShapeAncestorsSuccessors);
84     ---Purpose: to  find all the subshapes  of  Sha and  store them in
85     --          IndDatMap if they had not been already taken into account.
86
87     Dump (me;  
88         S : in out OStream);
89     ---Purpose:  dump the content of the fields.
90     LightDump (me;  
91         S : in out OStream);
92     ---Purpose:  dump the types of the shapes.
93
94     --------------------
95     -- INLINE METHODS --
96     --------------------
97     GetShape       (me;  
98         index: Integer from Standard)  
99         returns Shape from TopoDS;
100     ---C++: return const & 
101     
102     Shape       (me;  
103         anIndex: Integer from Standard)  
104         returns Shape from TopoDS;
105     ---C++: return const & 
106      
107     
108         
109     GetShapeType   (me;  
110             index: Integer from Standard)  
111         returns ShapeEnum from TopAbs;
112     
113     GetBoundingBox (me;  
114             index: Integer from Standard)  
115         returns Box;
116     ---C++: return const &
117
118     GetState (me;  
119             index: Integer from Standard)  
120         returns StateOfShape from BooleanOperations;
121
122     SetState (me:in out;  
123                 index: Integer from Standard;  
124                 theState: StateOfShape from BooleanOperations);
125     
126     GetAncestor(me;  
127                     index: Integer from Standard;  
128                     ancestorNumber: Integer from Standard)  
129         returns Integer from Standard;
130
131     GetSuccessor(me;  
132                     index: Integer from Standard;  
133                     successorNumber: Integer from Standard)  
134         returns Integer from Standard;
135
136     GetAncestors (me;  
137                     index: Integer from Standard;  
138                     theArrayOfAncestors: out Address from Standard;  
139                     AncestorsSize:out Integer from Standard);
140
141     GetSuccessors (me;  
142             index: Integer from Standard;  
143             theArrayOfSuccessors:out Address from Standard; 
144             SuccessorsSize:out Integer from Standard);
145
146     
147
148     NumberOfAncestors  (me;  
149             index: Integer from Standard)  
150         returns Integer from Standard;
151
152     NumberOfSuccessors (me;  
153             index: Integer from Standard)  
154         returns Integer from Standard;
155
156     
157     
158
159     NumberOfShapesOfTheTool   (me)  
160         returns Integer from Standard;
161
162     NumberOfShapesOfTheObject (me)  
163         returns Integer from Standard;
164      
165     --
166     NumberOfSourceShapes  (me) 
167         returns Integer from Standard ;
168      
169     IsNewShape (me; 
170                 index: Integer from Standard) 
171         returns Boolean from Standard ; 
172
173     --NumberOfShapesOfTheTool+NumberOfShapesOfTheObject+NewShapes
174     NumberOfInsertedShapes(me) 
175         returns Integer from Standard ;  
176      
177     NumberOfNewShapes(me) 
178         returns Integer from Standard ;   
179      
180     Line  (me; index: Integer from  Standard) 
181         returns ShapeAndInterferences from BooleanOperations; 
182     ---C++: return const &  
183
184
185     ShapeIndexMap (me;   
186             iRank:Integer from Standard) 
187         returns IndexedDataMapOfShapeInteger from BooleanOperations;  
188     ---C++:  return const &  
189
190     ShapeIndex  (me;  
191             aS:Shape from TopoDS; 
192             iRank:Integer from Standard) 
193         returns Integer from Standard  
194         is virtual;--modified by NIZNHY-PKV Thu Feb  5 14:20:31 2004
195         
196     Object  (me) 
197         returns Shape from TopoDS; 
198     ---C++:  return const & 
199
200     Tool    (me) 
201         returns Shape from TopoDS; 
202     ---C++:  return const &
203    
204     ObjectRange (me; 
205             iFirst:out Integer from Standard; 
206             iLast :out Integer from Standard); 
207                  
208     ToolRange   (me; 
209             iFirst:out Integer from Standard; 
210             iLast :out Integer from Standard);   
211    
212     Rank (me; 
213             anIndex:Integer from Standard) 
214         returns Integer from Standard      --  1-Object,  2-Tool,  3-New  0-?  
215         is virtual;                          --XX
216         
217     RefEdge(me; 
218             anIndex:Integer from Standard) 
219         returns Integer from Standard;  
220     ---Purpose: for given index "anIndex" of an edge in DS get  
221     ---         reference index of an edge 
222      
223     NbEdges(me) 
224         returns Integer from Standard; 
225     ---Purpose: returns number of edges from source shapes       
226      
227     GetOrientation (me;  
228             index: Integer from Standard;  
229             successorNumber: Integer from Standard)  
230         returns Orientation;
231
232     GetOrientations (me;  
233             index: Integer from Standard;  
234             theArrayOfOrientations:out Address; 
235             OrientationsSize:out Integer from Standard); 
236
237 --modified by NIZNHY-PKV Thu Feb  3 11:17:25 2005f  
238 --    InsertInterference (me:in out;  
239 --                        index: Integer; IR: InterferenceResult);
240 --    GetInterference       (me;  
241 --                          index: Integer from Standard;  
242 --                          interfNumber: Integer from Standard)  
243 --      returns InterferenceResult;
244 --    --C++: return const & 
245 --    GetIntersectedShape   (me;  
246 --          index: Integer from Standard;  
247 --          interfNumber: Integer from Standard)  
248 --      returns Integer from Standard;
249
250 --    GetIntersectionResult (me;  
251 --          index: Integer from Standard;  
252 --          interfNumber: Integer from Standard)  
253 --      returns Integer from Standard;
254
255 --    NumberOfInterferences (me; index: Integer)  
256 --      returns Integer from Standard;
257 --modified by NIZNHY-PKV Wed Feb  2 14:18:57 2005t  
258
259 fields
260
261     myListOfShapeAndInterferences : PShapeAndInterferences  from BooleanOperations is protected;
262     ---Purpose: gives the number of interferences inserted in myListOfInterferences.
263
264     myNumberOfShapesOfTheObject : Integer is protected;
265     ---Purpose: the total number of the shapes of the Object.
266
267     myNumberOfShapesOfTheTool : Integer is protected;
268     ---Purpose: the total number of the shapes of the Tool.
269
270     myNumberOfInsertedShapes : Integer is protected;
271     ---Purpose: the  total number of  the  shapes of  the Object, Tool and
272     --          also the shapes created by interferences.
273     myLength : Integer is protected;
274     ---Purpose: the total number of allocated space to store.
275
276     --
277     myObject : Shape from TopoDS is protected; 
278
279     myTool   : Shape from TopoDS is protected;  
280     --
281     myShapeIndexMapObj :  IndexedDataMapOfShapeInteger from BooleanOperations is protected;   
282
283     myShapeIndexMapTool:  IndexedDataMapOfShapeInteger from BooleanOperations is protected;   
284
285     --
286     myRefEdges:  CArray1OfInteger from BOPTColStd is protected; 
287      
288     myNbEdges :  Integer from Standard is protected;        
289     --
290
291 friends 
292
293     class Explorer from BooleanOperations,
294     class OnceExplorer from BooleanOperations
295
296 end ShapesDataStructure;