0024023: Revamp the OCCT Handle -- general
[occt.git] / src / Geom / Geom_SurfaceOfRevolution.cdl
1 -- Created on: 1993-03-10
2 -- Created by: JCV
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 class SurfaceOfRevolution from Geom inherits SweptSurface from Geom
18
19         ---Purpose : Describes a surface of revolution (revolved surface).
20         -- Such a surface is obtained by rotating a curve (called
21         -- the "meridian") through a complete revolution about
22         -- an axis (referred to as the "axis of revolution"). The
23         -- curve and the axis must be in the same plane (the
24         -- "reference plane" of the surface).
25         -- Rotation around the axis of revolution in the
26         -- trigonometric sense defines the u parametric
27         -- direction. So the u parameter is an angle, and its
28         -- origin is given by the position of the meridian on the surface.
29         -- The parametric range for the u parameter is: [ 0, 2.*Pi ]
30         -- The v parameter is that of the meridian.
31         -- Note: A surface of revolution is built from a copy of the
32         -- original meridian. As a result the original meridian is
33         -- not modified when the surface is modified.
34         -- The form of a surface of revolution is typically a
35         -- general revolution surface
36         -- (GeomAbs_RevolutionForm). It can be:
37         -- - a conical surface, if the meridian is a line or a
38         --   trimmed line (GeomAbs_ConicalForm),
39         -- - a cylindrical surface, if the meridian is a line or a
40         --   trimmed line parallel to the axis of revolution
41         --   (GeomAbs_CylindricalForm),
42         -- - a planar surface if the meridian is a line or a
43         --   trimmed line perpendicular to the axis of revolution
44         --   of the surface (GeomAbs_PlanarForm),
45         -- - a toroidal surface, if the meridian is a circle or a
46         --   trimmed circle (GeomAbs_ToroidalForm), or
47         -- - a spherical surface, if the meridian is a circle, the
48         --   center of which is located on the axis of the
49         --   revolved surface (GeomAbs_SphericalForm).
50         --   Warning
51         -- Be careful not to construct a surface of revolution
52         -- where the curve and the axis or revolution are not
53         -- defined in the same plane. If you do not have a
54         -- correct configuration, you can correct your initial
55         -- curve, using a cylindrical projection in the reference plane.
56         
57         
58         
59 uses Ax1         from gp, 
60      Ax2         from gp,
61      Dir         from gp,
62      Pnt         from gp,
63      Trsf        from gp,
64      GTrsf2d     from gp,
65      Vec         from gp,
66      Curve       from Geom,
67      Geometry    from Geom,
68      Shape       from GeomAbs,
69     BSplineCurve from Geom  
70
71 raises ConstructionError   from Standard,
72        RangeError          from Standard, 
73        UndefinedDerivative from Geom
74  
75
76 is
77
78
79   Create (C : Curve; A1 : Ax1)   returns SurfaceOfRevolution;
80         ---Purpose :
81         --  C : is the meridian  or the referenced curve.
82         --  A1 is the axis of revolution. 
83         --  The form of a SurfaceOfRevolution can be :
84         --  . a general revolution surface (RevolutionForm),
85         --  . a conical surface if the meridian is a line or a trimmed line
86         --    (ConicalForm),
87         --  . a cylindrical surface if the meridian is a line or a trimmed
88         --    line parallel to the revolution axis (CylindricalForm),
89         --  . a planar surface if the meridian is a line perpendicular to
90         --    the revolution axis of the surface (PlanarForm).  
91         --  . a spherical surface,
92         --  . a toroidal surface,
93         --  . a quadric surface.
94         -- Warnings :
95         --  It is not checked that the curve C is planar and that the
96         --  surface axis is in the plane of the curve.
97         --  It is not checked that the revolved curve C doesn't 
98         --  self-intersects.
99
100
101   SetAxis (me : mutable; A1 : Ax1);
102         ---Purpose : Changes the axis of revolution.
103         -- Warnings :
104         --  It is not checked that the axis is in the plane of the 
105         --  revolved curve.
106
107
108   SetDirection (me : mutable; V : Dir);
109         ---Purpose : Changes the direction of the revolution axis.
110         -- Warnings :
111         --  It is not checked that the axis is in the plane of the 
112         --  revolved curve.
113
114
115
116   SetBasisCurve (me : mutable; C : Curve);
117         ---Purpose : Changes the revolved curve of the surface.
118         -- Warnings :
119         --  It is not checked that the curve C is planar and that the
120         --  surface axis is in the plane of the curve.
121         --  It is not checked that the revolved curve C doesn't 
122         --  self-intersects.
123
124
125   SetLocation (me : mutable; P : Pnt);
126         ---Purpose : Changes the location point of the revolution axis.
127         -- Warnings :
128         --  It is not checked that the axis is in the plane of the 
129         --  revolved curve.
130
131
132   Axis (me)  returns Ax1;
133         ---Purpose : Returns the revolution axis of the surface.
134
135
136   Location (me)  returns Pnt;
137         ---Purpose :
138         --  Returns the location point of the axis of revolution.
139         ---C++: return const&
140
141
142   ReferencePlane (me)   returns Ax2
143         ---Purpose :
144         --  Computes the position of the reference plane of the surface
145         --  defined by the basis curve and the symmetry axis.
146         --  The location point is the location point of the revolution's
147         --  axis, the XDirection of the plane is given by the revolution's
148         --  axis and the orientation of the normal to the plane is given
149         --  by the sense of revolution.
150      raises ConstructionError;
151         ---Purpose :
152         --  Raised if the revolved curve is not planar or if the revolved 
153         --  curve and the symmetry axis are not in the same plane or if 
154         --  the maximum of distance between the axis and the revolved
155         --  curve is lower or equal to Resolution from gp.
156
157
158   UReverse (me : mutable);
159         ---Purpose : Changes the orientation of this surface of revolution
160         -- in the u  parametric direction. The bounds of the
161         -- surface are not changed but the given parametric
162         -- direction is reversed. Hence the orientation of the
163         -- surface is reversed.
164         -- As a consequence:
165         -- - UReverse reverses the direction of the axis of
166         --   revolution of this surface,
167
168
169   UReversedParameter ( me; U : Real) returns Real;
170         ---Purpose: Computes the u  parameter on the modified
171         -- surface, when reversing its u  parametric
172         -- direction, for any point of u parameter U  on this surface of revolution.
173         -- In the case of a revolved surface:
174         -- - UReversedParameter returns 2.*Pi - U
175
176   
177   VReverse (me : mutable);
178         ---Purpose : Changes the orientation of this surface of revolution
179         -- in the v parametric direction. The bounds of the
180         -- surface are not changed but the given parametric
181         -- direction is reversed. Hence the orientation of the
182         -- surface is reversed.
183         -- As a consequence:
184         -- - VReverse reverses the meridian of this surface of revolution. 
185
186   VReversedParameter (me; V : Real) returns Real;
187         ---Purpose: Computes the  v parameter on the modified
188         -- surface, when reversing its  v parametric
189         -- direction, for any point of v parameter V on this surface of revolution.
190         -- In the case of a revolved surface:
191         -- - VReversedParameter returns the reversed
192         --   parameter given by the function
193         --   ReversedParameter called with V on the meridian.
194
195   TransformParameters(me; U,V : in out Real; T : Trsf from gp)
196         ---Purpose: Computes the  parameters on the  transformed  surface for
197         --          the transform of the point of parameters U,V on <me>.
198         --          
199         --          me->Transformed(T)->Value(U',V')
200         --          
201         --          is the same point as
202         --          
203         --          me->Value(U,V).Transformed(T)
204         --          
205         --          Where U',V' are the new values of U,V after calling
206         --          
207         --          me->TranformParameters(U,V,T)
208         --          
209         --          This methods multiplies V by 
210         --          BasisCurve()->ParametricTransformation(T)
211      is redefined;  
212
213   ParametricTransformation(me; T : Trsf from gp) returns GTrsf2d from gp
214         ---Purpose: Returns a 2d transformation  used to find the  new
215         --          parameters of a point on the transformed surface.
216         --          
217         --          me->Transformed(T)->Value(U',V')
218         --          
219         --          is the same point as
220         --          
221         --          me->Value(U,V).Transformed(T)
222         --          
223         --          Where U',V' are  obtained by transforming U,V with
224         --          th 2d transformation returned by
225         --          
226         --          me->ParametricTransformation(T)
227         --          
228         --          This  methods  returns  a scale  centered  on  the
229         --          U axis with BasisCurve()->ParametricTransformation(T)
230      is redefined;  
231   
232   Bounds (me; U1, U2, V1, V2 : out Real);
233         ---Purpose : Returns the parametric bounds U1, U2 , V1 and V2 of this surface.
234         -- A surface of revolution is always complete, so U1 = 0, U2 = 2*PI.
235
236
237   IsUClosed (me) returns Boolean;
238         ---Purpose : IsUClosed always returns true.
239
240
241   IsVClosed (me)  returns Boolean;
242         ---Purpose : IsVClosed returns true if the meridian of this
243         --   surface of revolution is closed.
244
245
246   IsCNu (me; N : Integer)  returns Boolean;
247         ---Purpose : IsCNu always returns true.
248
249
250   IsCNv (me; N : Integer)  returns Boolean
251         ---Purpose : IsCNv returns true if the degree of continuity of the
252         --   meridian of this surface of revolution is at least N.
253      raises RangeError;
254         ---Purpose : Raised if N < 0.
255
256
257   IsUPeriodic (me)   returns Boolean;
258         ---Purpose : Returns True.
259
260
261   IsVPeriodic (me)  returns Boolean;
262         ---Purpose :  IsVPeriodic returns true if the meridian of this
263         --   surface of revolution is periodic.
264
265
266   UIso (me; U : Real)   returns Curve;
267         ---Purpose :  Computes the U isoparametric curve of this surface
268         -- of revolution. It is the curve obtained by rotating the
269         -- meridian through an angle U about the axis of revolution.
270
271
272   VIso (me; V : Real)  returns Curve;
273         ---Purpose :  Computes the U isoparametric curve of this surface
274         -- of revolution. It is the curve obtained by rotating the
275         -- meridian through an angle U about the axis of revolution.
276
277
278   D0 (me; U, V : Real; P : out Pnt);
279         ---Purpose :  Computes the  point P (U, V) on the surface.
280         --  U is the angle of the rotation around the revolution axis.
281         --  The direction of this axis gives the sense of rotation.
282         --  V is the parameter of the revolved curve.
283
284   
285   D1 (me; U, V : Real; P : out Pnt; D1U, D1V : out Vec)
286         ---Purpose :
287         --  Computes the current point and the first derivatives 
288         --  in the directions U and V.
289      raises UndefinedDerivative;
290         ---Purpose : Raised if the continuity of the surface is not C1.
291
292
293   D2 (me; U, V : Real; P : out Pnt; D1U, D1V, D2U, D2V, D2UV : out Vec)
294         ---Purpose :
295         --  Computes the current point, the first and the second derivatives
296         --  in the directions U and V.
297      raises UndefinedDerivative;
298         ---Purpose : Raised if the continuity of the surface is not C2.
299
300
301   D3 (me; U, V : Real; P : out Pnt; 
302       D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV : out Vec)
303         ---Purpose :
304         --  Computes the current point, the first,the second and the third 
305         --  derivatives in the directions U and V.
306      raises UndefinedDerivative;
307         ---Purpose : Raised if the continuity of the surface is not C3.
308
309
310   DN (me; U, V : Real; Nu, Nv : Integer)
311         ---Purpose :
312         --  Computes the derivative of order Nu in the direction u and 
313         --  Nv in the direction v.
314      returns Vec
315      raises UndefinedDerivative,
316         ---Purpose : 
317         --  Raised if the continuity of the surface is not CNu in the u
318         --  direction and CNv in the v direction.
319             RangeError;
320         ---Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
321
322
323
324         ---Purpose : The following  functions  evaluates the  local 
325         -- derivatives on surface. Useful to manage discontinuities 
326         -- on the surface. 
327         --           if    Side  =  1  ->  P  =  S( U+,V ) 
328         --           if    Side  = -1  ->  P  =  S( U-,V ) 
329         --           else  P  is betveen discontinuities   
330         --           can be evaluated using methods  of  
331         --           global evaluations    P  =  S( U ,V )      
332    
333   LocalD0 (me; U, V : Real; USide : Integer;
334                P : out Pnt);
335  
336   LocalD1 (me; U, V : Real;  USide : Integer;
337           P : out Pnt; D1U, D1V : out Vec);
338  
339   LocalD2 (me; U, V : Real; USide : Integer;
340            P : out Pnt; D1U, D1V, D2U, D2V, D2UV : out Vec);
341  
342   LocalD3 (me; U, V : Real; USide : Integer;
343            P : out Pnt; D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV :
344            out Vec);
345   
346   LocalDN (me; U, V : Real; USide : Integer; 
347            Nu, Nv : Integer)
348      returns Vec;
349
350   Transform (me : mutable; T : Trsf);
351         ---Purpose: Applies the transformation T to this surface of revolution.
352    Copy (me)  returns like me;
353         ---Purpose: Creates a new object which is a copy of this surface of revolution.
354 fields
355
356   loc  : Pnt;
357
358 end;