fdc4666f0144e22833827107f6d4c00ba9af812a
[occt.git] / src / GeomAdaptor / GeomAdaptor_Surface.cdl
1 -- File:      GeomAdaptor_Surface.cdl
2 -- Created:   Fri May 14 15:08:27 1993
3 -- Author:    Bruno DUMORTIER
4 ---Copyright: Matra Datavision 1993
5
6 class Surface from GeomAdaptor inherits Surface from Adaptor3d
7
8         ---Purpose: An interface between the services provided by any
9         -- surface from the package Geom and those required
10         -- of the surface by algorithms which use it.
11         
12 uses
13      Pnt              from gp,
14      Vec              from gp,
15      Dir              from gp,
16      Pln              from gp,
17      Cone             from gp,
18      Cylinder         from gp,
19      Sphere           from gp,
20      Torus            from gp,
21      Ax1              from gp,
22      Array1OfReal     from TColStd,
23      Surface          from Geom,
24      BezierSurface    from Geom,
25      BSplineSurface   from Geom,
26      SurfaceType      from GeomAbs,
27      Shape            from GeomAbs,
28      Curve            from GeomAdaptor,
29      HCurve           from Adaptor3d,
30      HSurface         from Adaptor3d
31
32 raises
33     NoSuchObject      from Standard,
34     OutOfRange        from Standard,
35     ConstructionError from Standard,
36     DomainError       from Standard
37
38 is
39
40     Create returns Surface from GeomAdaptor;
41         ---C++: inline
42     
43     Create( S : Surface from Geom) returns Surface from GeomAdaptor;
44         ---C++: inline
45     
46     Create( S : Surface from Geom; UFirst,ULast,VFirst,VLast : Real; 
47             TolU  :  Real  =  0.0; 
48             TolV  :  Real  =  0.0) 
49     returns  Surface from GeomAdaptor
50     raises ConstructionError from Standard;
51         ---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast
52         ---C++: inline
53
54     Load(me : in out; S : Surface from Geom);
55         ---C++: inline
56     
57     Load(me : in out; S : Surface from Geom; 
58                       UFirst,ULast,VFirst,VLast :  Real; 
59                       TolU  :  Real  =  0.0; 
60                       TolV  :  Real  =  0.0)
61     raises ConstructionError from Standard;
62         ---C++: inline
63         ---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast
64
65     Surface(me) returns Surface from Geom
66         ---C++: return const&
67         ---C++: inline
68     is static;
69     
70     
71     --
72     --     Global methods - Apply to the whole surface.
73     --     
74     
75     FirstUParameter(me) returns Real
76          ---C++:inline
77     is redefined static;
78
79     LastUParameter(me) returns Real
80          ---C++:inline
81     is redefined static;
82     
83     FirstVParameter(me) returns Real
84          ---C++:inline
85     is redefined static;
86
87     LastVParameter(me) returns Real
88          ---C++:inline
89     is redefined static;
90     
91     UContinuity(me) returns Shape from GeomAbs
92     is redefined static;
93     
94     VContinuity(me) returns Shape from GeomAbs
95     is redefined static;
96     
97     NbUIntervals(me; S : Shape from GeomAbs) returns Integer
98         ---Purpose: Returns the number of U intervals for  continuity
99         --          <S>. May be one if UContinuity(me) >= <S>
100     is redefined static;
101     
102     NbVIntervals(me; S : Shape from GeomAbs) returns Integer
103         ---Purpose: Returns the number of V intervals for  continuity
104         --          <S>. May be one if VContinuity(me) >= <S>
105     is redefined static;
106     
107     UIntervals(me; T : in out Array1OfReal from TColStd; 
108                 S : Shape from GeomAbs ) 
109         ---Purpose: Returns the  intervals with the requested continuity
110         --          in the U direction.
111     raises
112         OutOfRange from Standard -- if the Length of the array does
113                                  -- have enought slots to accomodate
114                                  -- the result.
115     is redefined static;
116
117     VIntervals(me; T : in out Array1OfReal from TColStd; 
118                 S : Shape from GeomAbs ) 
119         ---Purpose: Returns the  intervals with the requested continuity
120         --          in the V direction.
121     raises
122         OutOfRange from Standard -- if the Length of the array does
123                                  -- have enought slots to accomodate
124                                  -- the result.
125     is redefined static;
126     
127     UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
128         ---Purpose: Returns    a  surface trimmed in the U direction
129         --           equivalent   of  <me>  between
130         --          parameters <First>  and <Last>. <Tol>  is used  to
131         --          test for 3d points confusion.
132     raises
133         OutOfRange from Standard
134         ---Purpose: If <First> >= <Last> 
135     is redefined static ;
136     
137     VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
138         ---Purpose: Returns    a  surface trimmed in the V direction  between
139         --          parameters <First>  and <Last>. <Tol>  is used  to
140         --          test for 3d points confusion.
141     raises
142         OutOfRange from Standard
143         ---Purpose: If <First> >= <Last> 
144     is redefined static ;
145
146     IsUClosed(me) returns Boolean
147     is redefined static;
148      
149     IsVClosed(me) returns Boolean
150     is redefined static;
151      
152     IsUPeriodic(me) returns Boolean
153     is redefined static;
154     
155     UPeriod(me) returns Real
156     raises
157         DomainError from Standard -- if the curve is not periodic
158     is redefined static;
159      
160     IsVPeriodic(me) returns Boolean
161     is redefined static;
162     
163     VPeriod(me) returns Real
164     raises
165         DomainError from Standard -- if the curve is not periodic
166     is redefined static;
167      
168     Value (me; U, V : Real)  returns Pnt from gp
169         --- Purpose : Computes the point of parameters U,V on the surface.
170     is redefined static;
171
172     D0 (me; U, V :     Real; 
173             P    : out Pnt  from gp)
174         --- Purpose : Computes the point of parameters U,V on the surface.
175     is redefined static;
176
177     D1 (me; U, V     :     Real; 
178             P        : out Pnt from gp; 
179             D1U, D1V : out Vec from gp)
180         --- Purpose : Computes the point  and the first derivatives on
181         --  the surface.
182         --  
183         --  Warning : On the specific case of BSplineSurface:
184         --  if the surface is cut in interval of continuity at least C1, 
185         --  the derivatives are computed on the current interval.
186         --  else the derivatives are computed on the basis surface.
187     is redefined static;
188
189     D2 (me; U, V         : Real; 
190             P        : out Pnt  from gp; 
191             D1U, D1V : out Vec  from gp;
192             D2U, D2V : out Vec  from gp; 
193             D2UV     : out Vec  from gp)
194         --- Purpose  :  Computes   the point,  the  first  and  second
195         --  derivatives on the surface.
196         --  
197         --  Warning : On the specific case of BSplineSurface:
198         --  if the surface is cut in interval of continuity at least C2, 
199         --  the derivatives are computed on the current interval.
200         --  else the derivatives are computed on the basis surface.
201     is redefined static;
202
203     D3 (me; U, V         :     Real;
204             P            : out Pnt  from gp; 
205             D1U, D1V     : out Vec  from gp;
206             D2U, D2V     : out Vec  from gp;
207             D2UV         : out Vec  from gp;
208             D3U, D3V     : out Vec  from gp;
209             D3UUV, D3UVV : out Vec  from gp)
210         --- Purpose : Computes the point,  the first, second and third
211         --  derivatives on the surface.
212         --  
213         --  Warning : On the specific case of BSplineSurface:
214         --  if the surface is cut in interval of continuity at least C3, 
215         --  the derivatives are computed on the current interval.
216         --  else the derivatives are computed on the basis surface.
217     is redefined static;
218
219     DN (me; U, V : Real; Nu, Nv : Integer)   
220     returns Vec from gp
221         --- Purpose :  Computes the derivative of order Nu in the 
222         --  direction U and Nv in the direction V at the point P(U, V).
223         --  
224         --  Warning : On the specific case of BSplineSurface:
225         --  if the surface is cut in interval of continuity CN, 
226         --  the derivatives are computed on the current interval.
227         --  else the derivatives are computed on the basis surface.
228     raises 
229         OutOfRange from Standard
230         --- Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
231     is redefined static;
232   
233     UResolution(me; R3d : Real ) returns Real
234          ---Purpose :  Returns the parametric U  resolution corresponding
235          --         to the real space resolution <R3d>.
236     is redefined static;
237   
238     VResolution(me; R3d : Real ) returns Real
239          ---Purpose :  Returns the parametric V  resolution corresponding
240          --         to the real space resolution <R3d>.
241     is redefined static;
242   
243     GetType(me) returns SurfaceType from GeomAbs
244         ---Purpose: Returns the type of the surface : Plane, Cylinder,
245         --          Cone,      Sphere,        Torus,    BezierSurface,
246         --          BSplineSurface,               SurfaceOfRevolution,
247         --          SurfaceOfExtrusion, OtherSurface
248         ---C++:inline
249     is redefined static;
250     
251     --
252     --     The following methods must  be called when GetType returned
253     --     the corresponding type.
254     --     
255
256     Plane(me) returns Pln from gp
257       raises NoSuchObject from Standard
258     is redefined static;
259     
260     Cylinder(me) returns Cylinder from gp
261       raises NoSuchObject from Standard
262     is redefined static;
263     
264     Cone(me) returns Cone from gp
265       raises NoSuchObject from Standard
266     is redefined static;
267     
268     Sphere(me) returns Sphere from gp
269       raises NoSuchObject from Standard
270     is redefined static;
271     
272     Torus(me) returns Torus from gp
273       raises NoSuchObject from Standard
274     is redefined static;
275
276     UDegree(me) returns Integer
277      raises NoSuchObject from Standard
278     is redefined static;
279
280     NbUPoles(me) returns Integer
281      raises NoSuchObject from Standard
282     is redefined static;
283
284     VDegree(me) returns Integer
285      raises NoSuchObject from Standard
286     is redefined static;
287
288     NbVPoles(me) returns Integer
289      raises NoSuchObject from Standard
290     is redefined static;
291     
292     NbUKnots(me) returns Integer
293     raises 
294        NoSuchObject from Standard
295     is redefined static;
296     
297     
298     NbVKnots(me) returns Integer
299     raises 
300        NoSuchObject from Standard
301     is redefined static;
302     
303     
304     IsURational(me) returns Boolean
305     raises
306         NoSuchObject from Standard
307     is redefined static;
308     
309     IsVRational(me) returns Boolean
310     raises
311         NoSuchObject from Standard
312     is redefined static;
313
314
315     Bezier(me) returns BezierSurface from Geom
316         ---Purpose: This will NOT make a copy of the
317         --           Bezier Surface : If you want to modify
318         --           the Surface please make a copy yourself
319         --           Also it will NOT trim the surface to
320         --           myU/VFirst/Last.
321     raises 
322         NoSuchObject from Standard
323     is redefined static;
324
325     BSpline(me) returns BSplineSurface from Geom
326         ---Purpose:  This will NOT make a copy of the
327         --           BSpline Surface : If you want to modify
328         --           the Surface please make a copy yourself
329         --           Also it will NOT trim the surface to
330         --           myU/VFirst/Last.
331     raises 
332         NoSuchObject from Standard
333     is redefined static;
334     
335     AxeOfRevolution(me) returns Ax1 from gp
336     raises 
337        NoSuchObject from Standard -- only for SurfaceOfRevolution
338     is redefined static;
339
340     Direction(me) returns Dir from gp
341     raises 
342        NoSuchObject from Standard -- only for SurfaceOfExtrusion
343     is redefined static;
344
345     BasisCurve(me) returns HCurve from Adaptor3d
346     raises 
347        NoSuchObject from Standard -- only for SurfaceOfExtrusion
348     is redefined static;
349     
350     
351     BasisSurface(me) returns HSurface from Adaptor3d
352     raises 
353        NoSuchObject from Standard -- only for Offset Surface
354     is redefined static;
355
356     OffsetValue(me) returns Real from Standard
357     raises 
358        NoSuchObject from Standard -- only for Offset Surface
359     is redefined static;
360   
361   
362     Span (me;Side :Integer; Ideb,Ifin:Integer; 
363              OutIdeb,OutIfin:out Integer; 
364              NbKnots : Integer ) 
365     is  private; 
366
367     IfUVBound (me;U,V :Real;Ideb,Ifin,IVdeb,IVfin :out Integer; 
368                   USide,VSide:  Integer)  
369         returns  Boolean  from  Standard                                    
370     is  private;
371     
372     load (me : in out; S : Surface from Geom; 
373                        UFirst,ULast,VFirst,VLast :  Real; 
374                        TolU  :  Real  =  0.0; 
375                        TolV  :  Real  =  0.0)
376     is private;
377
378 fields
379
380     mySurface            : Surface          from Geom;
381     mySurfaceType        : SurfaceType      from GeomAbs;
382     myUFirst             : Real             from Standard;
383     myULast              : Real             from Standard;
384     myVFirst             : Real             from Standard;
385     myVLast              : Real             from Standard; 
386     myTolU,  myTolV      : Real             from Standard;
387
388 end Surface;