0024023: Revamp the OCCT Handle -- ambiguity
[occt.git] / src / IntTools / IntTools_Tools.cdl
1 -- Created on: 2000-11-16
2 -- Created by: Peter KURNEV
3 -- Copyright (c) 2000-2014 OPEN CASCADE SAS
4 --
5 -- This file is part of Open CASCADE Technology software library.
6 --
7 -- This library is free software; you can redistribute it and/or modify it under
8 -- the terms of the GNU Lesser General Public License version 2.1 as published
9 -- by the Free Software Foundation, with special exception defined in the file
10 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 -- distribution for complete text of the license and disclaimer of any warranty.
12 --
13 -- Alternatively, this file may be used under the terms of Open CASCADE
14 -- commercial license or contractual agreement.
15
16 class Tools from IntTools 
17
18  ---Purpose:  
19  ---  The class contains handy static functions 
20  ---  dealing with the geometry and topology. 
21          
22 uses
23     Shape   from  TopoDS, 
24     Vertex  from  TopoDS, 
25     Edge    from  TopoDS, 
26     Wire    from  TopoDS, 
27     Face    from  TopoDS,
28     Pnt2d   from  gp,   
29     Pnt     from  gp, 
30     Dir     from  gp,
31     Lin     from  gp,
32     Pln     from  gp,
33     CommonPrt         from IntTools, 
34     Curve             from IntTools, 
35     Range             from IntTools, 
36     SequenceOfCurves  from IntTools,
37     Curve   from  Geom,
38     Curve   from  Geom2d,
39     Surface from  Geom,
40     State   from  TopAbs,
41     Box from Bnd 
42     
43 is 
44     ComputeVV  (myclass;V1,V2:Vertex  from  TopoDS) 
45         returns Integer from Standard; 
46     ---Purpose:
47     --- Computes distance between vertex V1 and vertex V2,
48     --- if the distance is less than sum of vertex tolerances
49     --- returns zero,
50     --- otherwise returns negative value
51     ---
52
53     HasInternalEdge  (myclass;  
54                 aW: Wire  from  TopoDS) 
55         returns  Boolean from Standard;
56     ---Purpose:
57     --- Returns True if wire aW contains edges
58     --- with INTERNAL orientation
59     ---
60  
61     MakeFaceFromWireAndFace  (myclass; 
62                      aW: Wire from TopoDS;
63                      aF: Face from TopoDS;
64                      aFNew:out Face from TopoDS); 
65      ---Purpose:
66     --- Build a face based on surface of given face aF
67     --- and bounded by wire aW
68     ---
69      
70     ClassifyPointByFace   (myclass;  
71             aF: Face from TopoDS; 
72             P:  Pnt2d  from  gp) 
73         returns State from TopAbs;
74     ---Purpose:
75     --- 
76     ---
77  
78     IsVertex  (myclass; E: Edge    from  TopoDS; 
79                t: Real from Standard) 
80         returns Boolean from Standard;
81     ---Purpose:
82     --- Computes square distance between a point on the edge E
83     --- corresponded to parameter t and vertices of edge E.
84     --- Returns True if this distance is less than square 
85     --- tolerance of vertex, otherwise returns false.
86     ---
87        
88     IsVertex  (myclass; E: Edge    from  TopoDS;  
89                   V: Vertex  from  TopoDS; 
90                   t: Real from Standard) 
91         returns Boolean from Standard;
92     ---Purpose:
93     --- Returns True if square distance between vertex V
94     --- and a point on the edge E corresponded to parameter t
95     --- is less than square tolerance of V
96     ---
97   
98     IsVertex  (myclass;  aCmnPrt: CommonPrt from  IntTools) 
99         returns Boolean from Standard;
100     ---Purpose:
101     --- Returns True if IsVertx for middle parameter of fist range 
102     --- and first edge returns True
103     --- and if IsVertex for middle parameter of second range and 
104     --- second range returns True,
105     --- otherwise returns False
106     ---
107   
108     IsMiddlePointsEqual(myclass; 
109                 E1: Edge    from  TopoDS;             
110                 E2: Edge    from  TopoDS) 
111         returns Boolean from Standard;
112     ---Purpose:
113     --- Gets boundary of parameters of E1 and E2.
114     --- Computes 3d points on each corresponded to average parameters.
115     --- Returns True if distance between computed points is less than
116     --- sum of edge tolerance, otherwise returns False.
117     ---
118
119     IsVertex        (myclass; 
120               aP  : Pnt  from gp;  
121       aTolPV: Real from Standard; 
122               aV: Vertex  from TopoDS)  
123         returns Boolean from Standard;
124     ---Purpose:
125     --- Returns True if the distance between point aP and 
126     --- vertex aV is less or equal to sum of aTolPV and 
127     --- vertex tolerance, otherwise returns False
128     ---
129
130     IntermediatePoint (myclass; 
131                  aFirst: Real from Standard; 
132                  aLast : Real from Standard) 
133         returns  Real from Standard;
134     ---Purpose:
135     --- Returns some value between aFirst and aLast
136     ---
137     
138     SplitCurve  (myclass;  
139            aC : Curve from IntTools;  
140            aS :out SequenceOfCurves  from IntTools) 
141         returns Integer from Standard;
142     ---Purpose:
143     --- Split aC by average parameter if aC is closed in 3D.
144     --- Returns positive value if splitting has been done,
145     --- otherwise returns zero.
146     ---
147   
148     RejectLines(myclass; 
149           aSIn:     SequenceOfCurves  from IntTools; 
150           aSOut:out SequenceOfCurves  from IntTools);
151      ---Purpose:
152     --- Puts curves from aSIn to aSOut except those curves that
153     --- are coincide with first curve from aSIn.
154     ---
155     
156     IsDirsCoinside (myclass;  
157               D1:Dir from gp; 
158               D2:Dir from gp) 
159         returns Boolean from Standard;
160     ---Purpose:
161     --- Returns True if D1 and D2 coinside
162     --- 
163
164     IsDirsCoinside (myclass;  
165               D1  :Dir from gp; 
166               D2  :Dir from gp; 
167               aTol:Real from Standard) 
168         returns Boolean from Standard;
169     ---Purpose:
170     --- Returns True if D1 and D2 coinside with given tolerance  
171     ---  
172
173     IsClosed    (myclass;  
174            aC : Curve from Geom)  
175         returns Boolean from Standard;
176     ---Purpose:
177     --- Returns True if aC is BoundedCurve from Geom and
178     --- the distance between first point
179     --- of the curve aC and last point
180     --- is less than 1.e-12
181     ---
182  
183     CurveTolerance(myclass;   
184                aC   : Curve from Geom; 
185    aTolBase : Real from Standard) 
186      returns Real from Standard;
187     ---Purpose:
188     --- Returns adaptive tolerance for given aTolBase
189     --- if aC is trimmed curve and basis curve is parabola,
190     --- otherwise returns value of aTolBase
191     ---
192 --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
193      
194     CheckCurve(myclass; 
195         theC:Curve from Geom;  
196         theTol:Real from Standard; 
197         theBox:out Box from Bnd) 
198     returns Boolean from Standard;   
199      
200     IsOnPave(myclass; 
201         theT:Real from Standard;  
202         theRange:Range from IntTools; 
203         theTol: Real from Standard) 
204     returns Boolean from Standard;  
205
206     VertexParameters(myclass; 
207         theCP:CommonPrt from IntTools; 
208         theT1:out Real from Standard;  
209         theT2:out Real from Standard);  
210
211     VertexParameter(myclass; 
212         theCP:CommonPrt from IntTools; 
213         theT:out Real from Standard); 
214  
215     IsOnPave1(myclass; 
216         theT:Real from Standard;  
217         theRange:Range from IntTools; 
218         theTol: Real from Standard) 
219     returns Boolean from Standard;     
220       
221     IsInRange(myclass;
222         theRRef : Range from IntTools; 
223         theR    : Range from IntTools; 
224         theTol  : Real  from Standard) 
225     returns Boolean from Standard;      
226     ---Purpose:  Checks if the range <theR> interfere with the range <theRRef>
227     
228     SegPln(myclass; 
229         theLin   :  Lin from gp; 
230         theTLin1 :  Real from Standard; 
231         theTLin2 :  Real from Standard; 
232         theTolLin:  Real from Standard;   
233         thePln   :  Pln  from gp; 
234         theTolPln:  Real from Standard; 
235         theP     :out Pnt from gp;   
236         theT     :out Real from Standard;  
237         theTolP  :out Real from Standard; 
238         theTmin  :out Real from Standard; 
239         theTmax  :out Real from Standard) 
240     returns Integer from Standard;  
241  
242     ComputeTolerance(myclass;
243         theCurve3D : Curve from Geom;
244         theCurve2D : Curve from Geom2d;
245         theSurf    : Surface from Geom; 
246         theFirst   : Real from Standard;
247         theLast    : Real from Standard;
248         theMaxDist : out Real from Standard; 
249         theMaxPar  : out Real from Standard)
250     returns Boolean from Standard; 
251     ---Purpose:  
252     -- Computes the max distance between points  
253     -- taken from 3D and 2D curves by the same parameter
254  
255 end Tools;