d4db6710b6b6d705e063fbbbb6f7db96c78d59b6
[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             theRunParallel: Boolean from Standard=Standard_False);   
291  
292     ---Purpose:  
293     --- Provides valid values of tolerances for the shape <theS>         
294     --- <theTolMax> is max value of the tolerance that can be 
295     --- accepted for correction.  If real value of the tolerance 
296     --- will be greater than  <aTolMax>, the correction does not 
297     --- perform. 
298     ---
299     CorrectCurveOnSurface  (myclass;  
300             theS: Shape  from  TopoDS; 
301             theTolMax: Real from Standard =0.0001; 
302             theRunParallel: Boolean from Standard=Standard_False);   
303     ---Purpose:  
304     --- Provides valid values of tolerances for the shape <theS> 
305     --- in  terms of BRepCheck_InvalidCurveOnSurface.   
306     ---
307     CorrectPointOnCurve    (myclass;  
308             theS: Shape  from  TopoDS; 
309             theTolMax: Real from Standard =0.0001; 
310             theRunParallel: Boolean from Standard=Standard_False);   
311     ---Purpose:  
312     --- Provides valid values of tolerances for the shape <theS> 
313     --- in  terms of BRepCheck_InvalidPointOnCurve.   
314     ---
315     --fields 
316  
317     --copy from BOPTools_AlgoTools.cdl
318     MakeNewVertex  (myclass;  
319             aP1 : Pnt  from  gp;  
320             aTol: Real from Standard;
321             aNewVertex:out Vertex from TopoDS); 
322     ---Purpose: 
323     --- Make a vertex using 3D-point <aP1> and 3D-tolerance value <aTol>  
324     ---
325     MakeNewVertex  (myclass;  
326         aV1,aV2:   Vertex from TopoDS; 
327         aNewVertex:out Vertex from TopoDS);                                                  
328     ---Purpose: 
329     --- Make a vertex using couple of vertices  <aV1, aV2>     
330     ---
331     MakeNewVertex  (myclass;  
332             aE1: Edge from TopoDS; 
333             aP1: Real from Standard; 
334             aE2: Edge from TopoDS; 
335             aP2: Real from Standard; 
336             aNewVertex:out Vertex from TopoDS);                                      
337     ---Purpose: 
338     --- Make a vertex in place of intersection between two edges 
339     --- <aE1, aE2> with parameters <aP1, aP2>     
340     ---
341     MakeNewVertex  (myclass;  
342             aE1: Edge from TopoDS; 
343             aP1: Real from Standard; 
344             aF2: Face from TopoDS; 
345             aNewVertex:out Vertex from TopoDS);         
346     ---Purpose: 
347     --- Make a vertex in place of intersection between the edge <aE1> 
348     --- with parameter <aP1> and the face <aF2> 
349     ---
350     PointOnEdge    (myclass;   
351             aEdge: Edge from TopoDS; 
352             aPrm: Real from Standard; 
353             aP:out Pnt  from  gp);
354     ---Purpose: 
355     --- Compute a 3D-point on the edge <aEdge> at parameter <aPrm> 
356     ---
357     MakeSplitEdge  (myclass;  
358             aE1: Edge from TopoDS; 
359             aV1: Vertex from TopoDS;             
360             aP1: Real from Standard; 
361             aV2: Vertex from TopoDS; 
362             aP2: Real from Standard; 
363             aNewEdge:out Edge from TopoDS);          
364     ---Purpose: 
365     --- Make the edge from base edge <aE1> and two vertices <aV1,aV2>  
366     --- at parameters <aP1,aP2>  
367     ---
368     MakeSectEdge   (myclass;  
369             aIC: Curve  from IntTools; 
370             aV1: Vertex from TopoDS;             
371             aP1: Real from Standard; 
372             aV2: Vertex from TopoDS; 
373             aP2: Real from Standard; 
374             aNewEdge:out Edge from TopoDS);             
375     ---Purpose: 
376     --- Make the edge from 3D-Curve <aIC>  and two vertices <aV1,aV2>  
377     --- at parameters <aP1,aP2>  
378     ---
379     UpdateVertex   (myclass;  
380             aIC: Curve  from IntTools; 
381             aT : Real from Standard;  
382             aV : Vertex from TopoDS); 
383     ---Purpose:   
384     --- Update the tolerance value for vertex  <aV> 
385     --- taking into account the fact that <aV> lays on   
386     --- the curve <aIC>   
387     ---
388     UpdateVertex   (myclass;  
389             aE : Edge from TopoDS;  
390             aT : Real from Standard;  
391             aV : Vertex from TopoDS);              
392     ---Purpose:  
393     --- Update the tolerance value for vertex  <aV> 
394     --- taking into account the fact that <aV> lays on   
395     --- the edge <aE>   
396     ---
397     UpdateVertex   (myclass;  
398             aVF : Vertex from TopoDS; 
399             aVN : Vertex from TopoDS);         
400     ---Purpose:  
401     --- Update the tolerance value for vertex  <aVN> 
402     --- taking into account the fact that <aVN> should   
403     --- cover tolerance zone of <aVF>    
404     ---
405  
406     CorrectRange   (myclass;  
407             aE1:   Edge from TopoDS;    
408             aE2:   Edge from TopoDS;   
409             aSR:   Range from IntTools;                        
410             aNewSR:out  Range from IntTools);  
411     ---Purpose:  
412     --- Correct shrunk range <aSR> taking into account 3D-curve      
413     --- resolution and corresp. tolerances' values of <aE1>, <aE2>   
414     ---
415     CorrectRange   (myclass;  
416             aE:   Edge from TopoDS;    
417             aF:   Face from TopoDS;   
418             aSR:  Range from IntTools;                        
419             aNewSR:out  Range from IntTools); 
420     ---Purpose:  
421     --- Correct shrunk range <aSR> taking into account 3D-curve      
422     --- resolution and corresp. tolerances' values of <aE>, <aF>
423     ---
424  
425     IsBlockInOnFace(myclass;   
426             aShR  : Range from IntTools; 
427             aF    : Face from TopoDS;  
428             aE    : Edge from TopoDS;  
429             aContext:out Context from BOPInt)
430         returns Boolean from Standard;               
431     ---Purpose:  
432     --- Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e 
433     --- the <PB> is IN or ON in 2D of <aF> 
434      
435     IsMicroEdge(myclass; 
436             theEdge    : Edge from TopoDS; 
437             theContext : Context from BOPInt)  
438         returns Boolean from Standard; 
439     ---Purpose: 
440     --- Checks if it is possible to compute shrunk range for the edge <aE>. 
441     ---  
442  
443     CorrectShapeTolerances (myclass;
444             theS: Shape from TopoDS; 
445             theRunParallel: Boolean from Standard=Standard_False);   
446     ---Purpose: 
447     --- Corrects tolerance values of the sub-shapes of the shape <theS> if needed. 
448     ---
449  
450     Dimension(myclass; 
451             theS:Shape from TopoDS) 
452         returns Integer from Standard;
453     ---Purpose: 
454     --- Retutns dimension of the shape <theS>. 
455      
456     IsOpenShell(myclass; 
457             theShell:Shell from TopoDS)  
458         returns Boolean from Standard;  
459      ---Purpose: Returns true if the  shell <theShell> is open  
460      
461     IsInvertedSolid(myclass; 
462             theSolid:Solid from TopoDS)  
463         returns Boolean from Standard;  
464     ---Purpose: Returns true if the solid <theSolid> is inverted 
465      
466 end AlgoTools;