0024157: Parallelization of assembly part of BO
[occt.git] / src / TopOpeBRepTool / TopOpeBRepTool_TOOL.cdl
1 -- Created on: 1998-11-26
2 -- Created by: Xuan PHAM PHU
3 -- Copyright (c) 1998-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22 class TOOL from TopOpeBRepTool
23 uses
24     Pnt2d from gp,
25     Dir2d from gp,
26     Vec2d from gp,
27     Pnt from gp,
28     Vec from gp,
29     Dir from gp,
30     State from TopAbs,
31     Curve from Geom2d,
32     Shape from TopoDS,
33     Vertex from TopoDS,
34     Edge from TopoDS,
35     Face from TopoDS,
36     Curve from BRepAdaptor,
37     Array1OfShape from TopTools,
38     ListOfShape from TopTools,
39     DataMapOfShapeListOfShape from TopTools,
40     C2DF from TopOpeBRepTool
41 is
42
43     -- 
44     -- orientation in subshapes :
45     -- 
46     
47     OriinSor(myclass; sub, S : Shape from TopoDS; checkclo : Boolean = Standard_False)
48     returns Integer;
49     -- returns 0 if <sub> is not subshape of <S>
50     -- returns 1 if <sub> is FORWARD in <S>
51     --         2             REVERSED
52     --         3             INTERNAL
53     --         4             EXTERNAL
54     -- returns 5             CLOSING shape for <S>, if (checkclo=true)
55     OriinSorclosed(myclass; sub, S : Shape from TopoDS)
56     returns Integer;
57     -- returns 0 if <sub> is not subshape of <S>
58     -- returns 1 if <sub> is FORWARD in <S>
59     --         2             REVERSED
60
61     -- 
62     -- is closing shape :
63     -- 
64
65     ClosedE(myclass; E : Edge from TopoDS; vclo : out Vertex from TopoDS)       
66     returns Boolean;
67
68     ClosedS(myclass; F : Face from TopoDS)      
69     returns Boolean;
70
71
72     IsClosingE(myclass; E : Edge from TopoDS; F : Face from TopoDS)
73     returns Boolean;
74
75     IsClosingE(myclass; E : Edge from TopoDS; W : Shape from TopoDS; F : Face from TopoDS)
76     returns Boolean;
77
78     --
79     -- parameters on edge / face :
80     --  
81
82     Vertices(myclass; E : Edge from TopoDS; Vces : out Array1OfShape from TopTools);
83     
84     Vertex(myclass; Iv : Integer; E : Edge from TopoDS)
85     returns Vertex from TopoDS;
86
87     ParE(myclass; Iv : Integer; E : Edge from TopoDS)
88     returns Real;
89
90     OnBoundary(myclass; par : Real; E : Edge from TopoDS)
91     returns Integer;
92     -- returns 0 : if par is not in [first,last] - <e>'s parameter range
93     --         1 :           on first par
94     --         2 :           on last par.
95     --         3 :           in [first,last] range
96     --         5 :           on first/ last and <e> is closed.
97
98     UVF(myclass; par : Real; C2DF : C2DF from TopOpeBRepTool)
99     returns Pnt2d from gp;
100
101     ParISO(myclass; p2d : Pnt2d from gp; e : Edge from TopoDS; f : Face from TopoDS;
102            pare : out Real)
103     returns Boolean;
104     -- <par> = parameter of Pt(<p2d>,<f>) on Iso(<e>,<f>)
105     -- returns false if 2drep(<e>,<f>) is null or is not iso.
106
107     ParE2d(myclass; p2d : Pnt2d from gp; e : Edge from TopoDS; f : Face from TopoDS;
108            par,dist : out Real)
109     returns Boolean;
110     -- <par> = parameter of projected point pproj2d of p2d on 2drep(e,f)
111     -- avoid projections if 2drep(e,f) is uviso.
112     -- returns false if the projection fails.
113     
114     Getduv(myclass; f : Face from TopoDS; uv : Pnt2d from gp;
115            dir : Vec from gp; factor : Real; duv : out Dir2d from gp)
116     returns Boolean;
117     -- For <f> on quadratic surface. <dir> is normal to <f> at Pt(<f>,<uv>),
118     -- Pt( <uv>)+factor*<dir> ) is Pt( <uv>+factoruv*<duv> )
119     
120     uvApp(myclass; f : Face from TopoDS; e : Edge from TopoDS; par,eps : Real;
121           uvapp : out Pnt2d from gp)
122     returns Boolean;
123     -- uvapp = uv+eps*dxx, (dxx=duvmax in direction dxx2d, uv=pt2d(par,e))
124
125     --     
126     -- boundaries :
127     --     
128          
129     TolUV(myclass; F : Face from TopoDS; tol3d : Real) 
130     returns Real;
131
132     TolP(myclass; E : Edge from TopoDS; F : Face from TopoDS)
133     returns Real;
134          
135     minDUV(myclass; F : Face from TopoDS)
136     returns Real;
137
138     outUVbounds(myclass; uv : Pnt2d from gp; F : Face from TopoDS)
139     returns Boolean; 
140
141     stuvF(myclass; uv : Pnt2d from gp; F : Face from TopoDS;
142           onU,onV : out Integer);                
143     -- onX = -1 : if x < xf      
144     -- onX = -2 : if x > xl      
145     -- onX =  1 : if x = xf (a tolx de la face)          
146     -- onX =  2 : if x = xl (a tolx de la face)  
147     -- onX =  0 : RAS
148
149     --
150     -- tangents :
151     -- 
152
153     TggeomE(myclass; par : Real; BC : Curve from BRepAdaptor; Tg : out Vec from gp)    
154     returns Boolean;
155
156     TggeomE(myclass; par : Real; E : Edge from TopoDS; Tg : out Vec from gp)    
157     returns Boolean;
158     -- Computes tangent vector to <E> at <par>, 
159     -- if      <E> is degenerated returns null vector
160     -- else if <par> is boundary of <E> bspline, approximate vector
161     --
162     -- returns true if the compute succeeds.
163
164     TgINSIDE(myclass; v : Vertex from TopoDS; E : Edge from TopoDS; 
165              Tg : out Vec from gp; OvinE : out Integer)    
166     returns Boolean;
167     -- Computes tangent vector to <E> at <v>, oriented INSIDE 1d<E>,
168     -- if <OvinE> is CLOSING <Tg> is tg(vFORWARD,<E>)
169
170     Tg2d(myclass; iv : Integer; E : Edge from TopoDS;
171          C2DF : C2DF from TopOpeBRepTool)
172     returns Vec2d from gp;
173     -- Computes tangent vector at bound <iv>
174     --  ex : E is FORWARD, iv = 1 (vertex FORWARD in EFOR) -> tggeom2d(v,E)
175     --            REVERSED,iv = 1 (vertex REVERSED in EFOR)-> -tggeom2d(v,E)
176
177     Tg2dApp(myclass; iv : Integer; E : Edge from TopoDS;
178             C2DF : C2DF from TopOpeBRepTool; factor : Real)
179     returns Vec2d from gp;
180     --  Approximate tangent vector near  bound   <iv> of <C2DF>.
181     --  If <factor> is  null computes tangent vector at  bound
182     -- <iv> (iv=1..2)
183
184     tryTg2dApp(myclass; iv : Integer; E : Edge from TopoDS;
185                C2DF : C2DF from TopOpeBRepTool; factor : Real)
186     returns Vec2d from gp;
187     -- Approximates tangent vector only is <C2DF> gives quadratic pcurve.
188
189
190     --
191     -- normals :
192     -- 
193
194     XX(myclass; uv : Pnt2d from gp; f : Face from TopoDS; 
195        par : Real; e : Edge from TopoDS;
196        xx : out Dir from gp)
197     returns Boolean;
198
199     Nt(myclass; uv : Pnt2d from gp; f : Face from TopoDS; normt : out Dir from gp)
200     returns Boolean;
201
202     NggeomF(myclass; uv : Pnt2d from gp; F : Face from TopoDS;
203             ng : out Vec from gp)
204     returns Boolean;
205
206     NgApp(myclass; par : Real; E : Edge from TopoDS; F : Face from TopoDS; tola : Real;
207           ngApp : out Dir from gp)
208     returns Boolean;
209     -- Approximates geometric normal <ngApp>  to <F> at point(par,E), 
210     -- purpose : !( ng.IsEqual(ngApp, tola) )
211     
212     tryNgApp(myclass; par : Real; E : Edge from TopoDS; F : Face from TopoDS; tola : Real;
213              ng : out Dir from gp)       
214     returns Boolean;   
215     -- if ::NgApp fails, returns ng(par,E,F)
216
217     --
218     -- orientations of subshapes :
219     -- 
220
221     tryOriEinF(myclass; par : Real; E : Edge from TopoDS; F : Face from TopoDS)
222     returns Integer;
223     -- prequesitory : <E> has 2d rep on <F>
224     -- purpose : the compute of orientation(<E>, <F>)
225     --           if <E> is not edge of <F>, uses its pcurve and <par>      
226     -- returns 0 if <sub> is not subshape of <S>
227     -- returns 1 if <sub> is FORWARD in <S>
228     --         2             REVERSED
229     --         3             INTERNAL
230     --         4             EXTERNAL
231     -- returns 5             CLOSING shape for <S>, if (checkclo=true)
232
233     --
234     -- curvatures.. :     
235     --      
236
237     IsQuad(myclass; E : Edge from TopoDS)
238     returns Boolean;
239     -- returns true if <E>'s geometry is quadratic.
240                 
241     IsQuad(myclass; F : Face from TopoDS)
242     returns Boolean;
243     -- returns true if <E>'s geometry is quadratic.     
244
245     CurvE(myclass; E : Edge from TopoDS; par : Real; tg0 : Dir from gp; Curv : out Real)        
246     returns Boolean;
247     -- compute for <Curv> = curvature of <E> in the plane normal to Pt(par,E)
248     --                      with normal direction <tg0>
249     -- NYI                     
250         
251     CurvF(myclass; F : Face from TopoDS; uv : Pnt2d from gp; tg0 : Dir from gp; 
252           Curv : out Real; direct : out Boolean)        
253     returns Boolean;
254     -- compute for <Curv> = curvature of intersection curve 
255     --                      (<F>,plane normal to Pt(par,E) with normal direction <tg0>)
256     -- NYI 
257         
258     -- uviso
259     -- 
260     UVISO(myclass; PC : Curve from Geom2d;
261           isou,isov : out Boolean; d2d : out Dir2d from gp; o2d : out Pnt2d from gp)
262     returns Boolean;
263     UVISO(myclass; C2DF : C2DF from TopOpeBRepTool; 
264           isou,isov : out Boolean; d2d : out Dir2d from gp; o2d : out Pnt2d from gp)
265     returns Boolean;    
266     UVISO(myclass; E : Edge from TopoDS; F : Face from TopoDS;
267           isou,isov : out Boolean; d2d : out Dir2d from gp; o2d : out Pnt2d from gp)
268     returns Boolean;    
269         
270     -- closing  
271     -- 
272     IsonCLO(myclass; PC : Curve from Geom2d;
273             onU : Boolean; xfirst,xperiod,xtol : Real)
274     returns Boolean;
275     IsonCLO(myclass; C2DF : C2DF from TopOpeBRepTool; 
276             onU : Boolean; xfirst,xperiod,xtol : Real)
277     returns Boolean;
278
279     -- translation
280     -- 
281     TrslUV(myclass; t2d : Vec2d from gp; C2DF : in out C2DF from TopOpeBRepTool);
282     TrslUVModifE(myclass; t2d : Vec2d from gp; F : Face from TopoDS; E : in out Edge from TopoDS)
283     returns Boolean;
284
285
286     -- matter angles :
287     -- 
288     Matter(myclass; d1,d2,ref : Vec from gp) 
289     returns Real; 
290     -- prequesitory : e1,e2 are edges connexed by vertex v, oriented FORWARD
291     --                on the same face.
292     --                v is oriented FORWARD in e1 and REVERSED in e2
293     --                d1 = tggeom(v,e1), d2 = tggeom(v,e2)
294     -- return the 2d angle matter described between d1 and d2 (in range [0.2PI])
295     
296     Matter(myclass; d1,d2 : Vec2d from gp) 
297     returns Real; 
298
299     Matter(myclass; xx1,nt1, xx2,nt2 : Dir from gp; tola : Real; Ang : out Real)
300     returns Boolean;
301     -- Give us faces f1,f2 sharing edge e, pt = point on e 
302     -- xxi : tangent to face fi at pt oriented INSIDE 2d(fi)
303     --       normal to tg(pt,e)
304     -- nti : topological normal to fi at pt.
305     -- 
306     -- If [ 3d(f1,f2) is smaller than 3d(fi), i=1..2 ]
307     --   Ang = the 3d angle of matter described between f1 and f2
308     -- Elsewhere, returns false  
309
310     Matter(myclass; f1,f2 : Face from TopoDS; 
311            e : Edge from TopoDS; pare : Real;
312            tola : Real; Ang : out Real)
313     returns Boolean;
314     
315     MatterKPtg(myclass; f1,f2 : Face from TopoDS; e : Edge from TopoDS;
316                Ang : out Real)
317     returns Boolean;
318     -- <f1> and <f2> are tangent on edge <e>, compute the matter angle 
319     -- between the 2 faces (0. or 2PI) 
320
321     --
322     -- general
323     --     
324
325     Getstp3dF(myclass; p : Pnt from gp; f : Face from TopoDS; 
326               uv : out Pnt2d from gp; st : out State from TopAbs)
327     returns Boolean;
328     -- expensive : uses projections
329
330
331     SplitE(myclass; Eanc : Edge from TopoDS; Splits : out ListOfShape from TopTools)
332     returns Boolean;
333     -- Splits edge <Eanc> on its INTERNAL vertices if any. Returns true if split succeeds.          
334             
335     MkShell(myclass; lF : ListOfShape from TopTools; She : out Shape from TopoDS);          
336
337     Remove(myclass; loS : in out ListOfShape from TopTools; 
338            toremove : Shape from TopoDS)
339     returns Boolean;
340     -- Removes all shapes equal to <toremove> from list <loS>
341     -- returns true if suceeds.
342     
343     WireToFace(myclass; Fref : Face from TopoDS; 
344                mapWlow : DataMapOfShapeListOfShape from TopTools;
345                lFs : out ListOfShape from TopTools)
346     returns Boolean;    
347     -- <mapWlow> = {(W,low)}
348     -- Builds up <lFs> = {a face built on <Fref> with bounds W,low}  
349
350     EdgeONFace(myclass; par : Real; ed : Edge from TopoDS; 
351                uv : Pnt2d from gp; fa : Face from TopoDS;
352                isonfa : out Boolean)
353     returns Boolean;
354     -- !!! pas encore fini xpu100299
355     -- prequesitory : Pnt(<par>, <ed>) = Pnt(<uv>,<fa>)
356     -- <isonfa> is true if <ed> is IN <fa>'s geometry.
357     -- returns true if <isonfa>'s compute succeds.
358     
359 end TOOL;