541cd52f9a8e95b67a8a918a86bb0c4f8b7ec7a9
[occt.git] / src / BOPTools / BOPTools_AlgoTools.cdl
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 class AlgoTools from BOPTools 
19     ---Purpose: 
20
21 uses 
22     Pnt from gp,  
23     Pnt2d from gp,
24     Dir from gp,  
25     Plane from Geom,
26     State from TopAbs, 
27     ShapeEnum from TopAbs, 
28     Curve from IntTools, 
29     Shape from TopoDS,
30     Vertex from TopoDS, 
31     Edge from TopoDS, 
32     Face from TopoDS, 
33     Wire from TopoDS, 
34     Shell from TopoDS,  
35     Solid from TopoDS, 
36     --  
37     BaseAllocator from BOPCol,
38     ListOfShape from BOPCol,  
39     IndexedMapOfShape from BOPCol,
40     IndexedDataMapOfShapeListOfShape from BOPCol,  
41     Context from BOPInt,     
42     ListOfCoupleOfShape from BOPTools, 
43     Range from IntTools
44     
45 --raises
46
47 is  
48     ComputeVV(myclass;  
49         aV1:Vertex from TopoDS;  
50         aP2:Pnt from gp; 
51         aTolP2:Real from Standard) 
52     returns Integer from Standard; 
53
54     ComputeVV(myclass;  
55         aV1:Vertex from TopoDS;  
56         aV2:Vertex from TopoDS) 
57     returns Integer from Standard;  
58
59     MakeVertex  (myclass;  
60         aLV: out ListOfShape from BOPCol; 
61         aV : out Vertex from TopoDS); 
62  
63     MakeEdge(myclass; 
64         theCurve:Curve from IntTools; 
65         theV1: Vertex from TopoDS; 
66         theT1: Real from Standard; 
67         theV2: Vertex from TopoDS; 
68         theT2: Real from Standard; 
69         theTolR3D: Real from Standard; 
70         theE :out Edge from TopoDS);  
71   
72     MakePCurve(myclass; 
73         theE : Edge from TopoDS;
74         theF1: Face from TopoDS;
75         theF2: Face from TopoDS;
76         theCurve:Curve from IntTools;
77         thePC1:Boolean from Standard; 
78         thePC2:Boolean from Standard);  
79     
80     MakeContainer(myclass; 
81         theType:ShapeEnum from TopAbs; 
82         theShape:out Shape from TopoDS); 
83     
84        
85     IsHole(myclass;  
86         aW:  Shape from TopoDS;    
87         aF:  Shape from TopoDS) 
88     returns Boolean from Standard;
89      
90     IsSplitToReverse(myclass;  
91         theSplit   :  Shape from TopoDS; 
92         theShape   :  Shape from TopoDS; 
93         theContext:out Context from BOPInt)  
94     ---Purpose: Returns True if the shape theSplit has opposite 
95     --          direction than theShape 
96     --          theContext - cashed geometrical tools
97     returns Boolean from Standard; 
98          
99     IsSplitToReverse(myclass;  
100         theSplit  :  Face from TopoDS; 
101         theShape  :  Face from TopoDS; 
102         theContext:out Context from BOPInt) 
103     ---Purpose: Returns True if normal direction of the face   
104     --          theShape is not the same as for the face  
105     --          theSplit 
106     --          theContext - cashed geometrical tools 
107     returns Boolean from Standard; 
108      
109     IsSplitToReverse  (myclass;  
110         aE1:  Edge from TopoDS;              
111         aE2:  Edge from TopoDS; 
112         aContext:out Context from BOPInt) 
113     returns Boolean from Standard; 
114          
115      
116     AreFacesSameDomain(myclass;  
117         theF1: Face from TopoDS;             
118         theF2: Face from TopoDS; 
119         theContext:out Context from BOPInt) 
120     returns Boolean from Standard;  
121         
122     CheckSameGeom (myclass;  
123         theF1: Face from TopoDS;             
124         theF2: Face from TopoDS; 
125         theContext:out Context from BOPInt) 
126     returns Boolean from Standard; 
127  
128     Sense (myclass;  
129         theF1: Face from TopoDS;             
130         theF2: Face from TopoDS) 
131     returns Integer from Standard;  
132
133     GetEdgeOff (myclass;  
134         theEdge    :Edge  from TopoDS;  
135         theFace    :Face  from TopoDS;  
136         theEdgeOff :out Edge  from TopoDS) 
137     ---Purpose: Returns True if the face theFace contains 
138     --          the edge theEdge but with opposite orientation. 
139     --          If the method  returns True theEdgeOff is the 
140     --          edge founded     
141     returns Boolean from Standard;  
142  
143     GetFaceOff(myclass;  
144         theEdge    :Edge  from TopoDS;  
145         theFace    :Face  from TopoDS; 
146         theLCEF    :out ListOfCoupleOfShape from BOPTools; 
147         theFaceOff :out Face  from TopoDS; 
148         theContext :out Context from BOPInt)  
149     returns Boolean from Standard;  
150     
151      ---Purpose:  For the face theFace and its edge theEdge 
152      --           finds the face suitable to produce shell. 
153      --           theLCEF - set of faces to search. All faces 
154      --           from theLCEF must share edge theEdge  
155  
156     IsInternalFace(myclass; 
157         theFace  :Face from TopoDS; 
158         theEdge  :Edge from TopoDS; 
159         theFace1 :Face from TopoDS; 
160         theFace2 :Face from TopoDS; 
161         theContext:out Context from BOPInt)
162     ---Purpose: Returns True if the face theFace is inside of the  
163     --          couple of faces theFace1, theFace2. 
164     --          The faces theFace, theFace1, theFace2  must 
165     --          share the edge theEdge           
166     returns Integer from Standard; 
167  
168     IsInternalFace(myclass; 
169         theFace :Face  from TopoDS; 
170         theEdge :Edge  from TopoDS; 
171         theLF   :out ListOfShape from BOPCol; 
172         theContext:out Context from BOPInt)  
173     ---Purpose: Returns True if the face theFace is inside of the  
174     --          appropriate couple of faces (from the set theLF)    . 
175     --          The faces of the set theLF and theFace  must 
176     --          share the edge theEdge          
177     returns Integer from Standard;  
178  
179     IsInternalFace(myclass; 
180         theFace  :Face  from TopoDS; 
181         theSolid :Solid from TopoDS; 
182         theMEF   :out IndexedDataMapOfShapeListOfShape from BOPCol;
183         theTol   :Real from Standard;       
184         theContext:out Context from BOPInt)  
185     ---Purpose: Returns True if the face theFace is inside the  
186     --          solid theSolid. 
187     --          theMEF - Map Edge/Faces for theSolid              
188     --          theTol - value of precision of computation   
189     --          theContext- cahed geometrical tools   
190    returns Integer from Standard;  
191  
192  
193     GetEdgeOnFace (myclass;  
194         theEdge    :Edge  from TopoDS;  
195         theFace    :Face  from TopoDS;  
196         theEdgeOnF :out Edge  from TopoDS)  
197     ---Purpose: For the face theFace gets the edge theEdgeOnF 
198     --          that is the same as theEdge 
199     --          Returns True if such edge exists         
200     --          Returns False if there is no such edge           
201     returns Boolean from Standard;  
202    
203     ComputeState(myclass; 
204         thePoint :Pnt  from gp;  
205         theSolid :Solid from TopoDS;  
206         theTol   :Real from Standard;       
207         theContext:out Context from BOPInt) 
208     ---Purpose: Computes the 3-D state of the point thePoint 
209     --          toward solid theSolid. 
210     --          theTol - value of precision of computation   
211     --          theContext- cahed geometrical tools  
212     --          Returns 3-D state. 
213     returns State from TopAbs;  
214
215     ComputeState(myclass; 
216         theVertex:Vertex from TopoDS;  
217         theSolid :Solid from TopoDS;  
218         theTol   :Real from Standard;       
219         theContext:out Context from BOPInt) 
220     ---Purpose: Computes the 3-D state of the vertex theVertex 
221     --          toward solid theSolid. 
222     --          theTol - value of precision of computation   
223     --          theContext- cahed geometrical tools  
224     --          Returns 3-D state. 
225     returns State from TopAbs;  
226
227     ComputeState(myclass; 
228         theEdge  :Edge  from TopoDS;  
229         theSolid :Solid from TopoDS;  
230         theTol   :Real from Standard;       
231         theContext:out Context from BOPInt) 
232     ---Purpose: Computes the 3-D state of the edge theEdge 
233     --          toward solid theSolid. 
234     --          theTol - value of precision of computation   
235     --          theContext- cahed geometrical tools  
236     --          Returns 3-D state. 
237     returns State from TopAbs;  
238         
239     ComputeState(myclass; 
240         theFace  :Face  from TopoDS;  
241         theSolid :Solid from TopoDS;  
242         theTol   :Real from Standard;     
243         theBounds:out IndexedMapOfShape from BOPCol;
244         theContext:out Context from BOPInt)            
245     ---Purpose: Computes the 3-D state of the face theFace 
246     --          toward solid theSolid. 
247     --          theTol - value of precision of computation   
248     --          theBounds - set of edges of theFace to avoid          
249     --          theContext- cahed geometrical tools  
250     --          Returns 3-D state. 
251     returns State from TopAbs; 
252
253     ComputeStateByOnePoint(myclass; 
254         theShape :Shape from TopoDS;  
255         theSolid :Solid from TopoDS;  
256         theTol   :Real from Standard;       
257         theContext:out Context from BOPInt) 
258     ---Purpose: Computes the 3-D state of the shape theShape 
259     --          toward solid theSolid. 
260     --          theTol - value of precision of computation   
261     --          theContext- cahed geometrical tools  
262     --          Returns 3-D state. 
263     returns State from TopAbs; 
264  
265     MakeConnexityBlock(myclass; 
266         theLS      :out ListOfShape from BOPCol;   
267         theMapAvoid:out IndexedMapOfShape from BOPCol;        
268         theLSCB    :out ListOfShape from BOPCol; 
269         theAllocator:BaseAllocator from BOPCol);   
270     ---Purpose: For the list of faces theLS build block  
271     --          theLSCB in terms of connexity by edges   
272     --          theMapAvoid - set of edges to avoid for 
273     --          the treatment  
274      
275     MakeConnexityBlocks(myclass; 
276         theS       :Shape from TopoDS;   
277         theType1   :ShapeEnum from TopAbs;               
278         theType2   :ShapeEnum from TopAbs;               
279         theLCB     :out ListOfShape from BOPCol);   
280     ---Purpose: For the compound theS build the blocks  
281     --          theLCB (as list of compounds) 
282     --          in terms of connexity by the shapes of theType  
283
284     OrientFacesOnShell (myclass; 
285         theS   :out Shape from TopoDS); 
286      
287     CorrectTolerances (myclass;  
288         theS: Shape  from  TopoDS; 
289          theTolMax: Real from Standard =0.0001);  
290     ---Purpose:  
291     --- Provides valid values of tolerances for the shape <theS>         
292     --- <theTolMax> is max value of the tolerance that can be 
293     --- accepted for correction.  If real value of the tolerance 
294     --- will be greater than  <aTolMax>, the correction does not 
295     --- perform. 
296     ---
297     CorrectCurveOnSurface  (myclass;  
298          theS: Shape  from  TopoDS; 
299          theTolMax: Real from Standard =0.0001); 
300     ---Purpose:  
301     --- Provides valid values of tolerances for the shape <theS> 
302     --- in  terms of BRepCheck_InvalidCurveOnSurface.   
303     ---
304     CorrectPointOnCurve    (myclass;  
305          theS: Shape  from  TopoDS; 
306          theTolMax: Real from Standard =0.0001);         
307     ---Purpose:  
308     --- Provides valid values of tolerances for the shape <theS> 
309     --- in  terms of BRepCheck_InvalidPointOnCurve.   
310     ---
311     --fields 
312  
313     --copy from BOPTools_AlgoTools.cdl
314     MakeNewVertex  (myclass;  
315         aP1 : Pnt  from  gp;  
316         aTol: Real from Standard;
317         aNewVertex:out Vertex from TopoDS); 
318     ---Purpose: 
319     --- Make a vertex using 3D-point <aP1> and 3D-tolerance value <aTol>  
320     ---
321     MakeNewVertex  (myclass;  
322         aV1,aV2:   Vertex from TopoDS; 
323         aNewVertex:out Vertex from TopoDS);                                                  
324     ---Purpose: 
325     --- Make a vertex using couple of vertices  <aV1, aV2>     
326     ---
327     MakeNewVertex  (myclass;  
328         aE1: Edge from TopoDS; 
329         aP1: Real from Standard; 
330         aE2: Edge from TopoDS; 
331         aP2: Real from Standard; 
332         aNewVertex:out Vertex from TopoDS);                                      
333     ---Purpose: 
334     --- Make a vertex in place of intersection between two edges 
335     --- <aE1, aE2> with parameters <aP1, aP2>     
336     ---
337     MakeNewVertex  (myclass;  
338         aE1: Edge from TopoDS; 
339         aP1: Real from Standard; 
340         aF2: Face from TopoDS; 
341         aNewVertex:out Vertex from TopoDS);         
342     ---Purpose: 
343     --- Make a vertex in place of intersection between the edge <aE1> 
344     --- with parameter <aP1> and the face <aF2> 
345     ---
346     PointOnEdge    (myclass;   
347         aEdge: Edge from TopoDS; 
348         aPrm: Real from Standard; 
349         aP:out Pnt  from  gp);
350     ---Purpose: 
351     --- Compute a 3D-point on the edge <aEdge> at parameter <aPrm> 
352     ---
353     MakeSplitEdge  (myclass;  
354         aE1: Edge from TopoDS; 
355         aV1: Vertex from TopoDS;             
356         aP1: Real from Standard; 
357         aV2: Vertex from TopoDS; 
358         aP2: Real from Standard; 
359         aNewEdge:out Edge from TopoDS);          
360     ---Purpose: 
361     --- Make the edge from base edge <aE1> and two vertices <aV1,aV2>  
362     --- at parameters <aP1,aP2>  
363     ---
364     MakeSectEdge   (myclass;  
365         aIC: Curve  from IntTools; 
366         aV1: Vertex from TopoDS;             
367         aP1: Real from Standard; 
368         aV2: Vertex from TopoDS; 
369         aP2: Real from Standard; 
370         aNewEdge:out Edge from TopoDS);             
371     ---Purpose: 
372     --- Make the edge from 3D-Curve <aIC>  and two vertices <aV1,aV2>  
373     --- at parameters <aP1,aP2>  
374     ---
375     UpdateVertex   (myclass;  
376         aIC: Curve  from IntTools; 
377         aT : Real from Standard;  
378         aV : Vertex from TopoDS); 
379     ---Purpose:   
380     --- Update the tolerance value for vertex  <aV> 
381     --- taking into account the fact that <aV> lays on   
382     --- the curve <aIC>   
383     ---
384     UpdateVertex   (myclass;  
385         aE : Edge from TopoDS;  
386         aT : Real from Standard;  
387         aV : Vertex from TopoDS);              
388     ---Purpose:  
389     --- Update the tolerance value for vertex  <aV> 
390     --- taking into account the fact that <aV> lays on   
391     --- the edge <aE>   
392     ---
393     UpdateVertex   (myclass;  
394         aVF : Vertex from TopoDS; 
395         aVN : Vertex from TopoDS);         
396     ---Purpose:  
397     --- Update the tolerance value for vertex  <aVN> 
398     --- taking into account the fact that <aVN> should   
399     --- cover tolerance zone of <aVF>    
400     ---
401  
402     CorrectRange   (myclass;  
403         aE1:   Edge from TopoDS;    
404         aE2:   Edge from TopoDS;   
405         aSR:   Range from IntTools;                        
406         aNewSR:out  Range from IntTools);  
407     ---Purpose:  
408     --- Correct shrunk range <aSR> taking into account 3D-curve      
409     --- resolution and corresp. tolerances' values of <aE1>, <aE2>   
410     ---
411     CorrectRange   (myclass;  
412         aE:   Edge from TopoDS;    
413         aF:   Face from TopoDS;   
414         aSR:  Range from IntTools;                        
415         aNewSR:out  Range from IntTools); 
416     ---Purpose:  
417     --- Correct shrunk range <aSR> taking into account 3D-curve      
418     --- resolution and corresp. tolerances' values of <aE>, <aF>
419     ---
420  
421     IsBlockInOnFace(myclass;   
422         aShR  : Range from IntTools; 
423         aF    : Face from TopoDS;  
424         aE    : Edge from TopoDS;  
425         aContext:out Context from BOPInt)
426       returns Boolean from Standard;               
427     ---Purpose:  
428     --- Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e 
429     --- the <PB> is IN or ON in 2D of <aF> 
430      
431     IsMicroEdge(myclass; 
432         theEdge    : Edge from TopoDS; 
433         theContext : Context from BOPInt)  
434       returns Boolean from Standard; 
435     ---Purpose: 
436     --- Checks if it is possible to compute shrunk range for the edge <aE>. 
437     ---  
438  
439     CorrectShapeTolerances (myclass;
440         theS: Shape from TopoDS);
441     ---Purpose: 
442     --- Corrects tolerance values of the sub-shapes of the shape <theS> if needed. 
443     ---
444  
445     Dimension(myclass; 
446         theS:Shape from TopoDS) 
447     returns Integer from Standard;
448     ---Purpose: 
449     --- Retutns dimension of the shape <theS>. 
450      
451     IsOpenShell(myclass; 
452             theShell:Shell from TopoDS)  
453         returns Boolean from Standard;  
454         ---Purpose: Returns true if the  shell <theShell> is open  
455      
456     IsInvertedSolid(myclass; 
457             theSolid:Solid from TopoDS)  
458         returns Boolean from Standard;  
459         ---Purpose: Returns true if the solid <theSolid> is inverted    
460  
461 end AlgoTools;