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