0024830: Remove redundant keyword 'mutable' in CDL declarations
[occt.git] / src / Geom / Geom_ConicalSurface.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 ConicalSurface from Geom inherits ElementarySurface from Geom
18
19         ---Purpose :  Describes a cone.
20         --    A cone is defined by the half-angle at its apex, and
21         --    is positioned in space by a coordinate system (a
22         --    gp_Ax3 object) and a reference radius as follows:
23         -- - The "main Axis" of the coordinate system is the
24         --   axis of revolution of the cone.
25         -- - The plane defined by the origin, the "X Direction"
26         --   and the "Y Direction" of the coordinate system is
27         --   the reference plane of the cone. The intersection
28         --   of the cone with this reference plane is a circle of
29         --   radius equal to the reference radius.
30         -- - The apex of the cone is on the negative side of
31         --   the "main Axis" of the coordinate system if the
32         --   half-angle is positive, and on the positive side if
33         --   the half-angle is negative.
34         --   This coordinate system is the "local coordinate
35         --   system" of the cone. The following apply:
36         -- - Rotation around its "main Axis", in the
37         --   trigonometric sense given by the "X Direction"
38         --   and the "Y Direction", defines the u parametric direction.
39         -- - Its "X Axis" gives the origin for the u parameter.
40         -- - Its "main Direction" is the v parametric direction of the cone.
41         -- - Its origin is the origin of the v parameter.
42         --   The parametric range of the two parameters is:
43         -- - [ 0, 2.*Pi ] for u, and - ] -infinity, +infinity [ for v
44         --   The parametric equation of the cone is:  P(u, v) =
45         --   O + (R + v*sin(Ang)) * (cos(u)*XDir + sin(u)*YDir) + v*cos(Ang)*ZDir where:
46         -- - O, XDir, YDir and ZDir are respectively
47         --   the origin, the "X Direction", the "Y Direction" and
48         --   the "Z Direction" of the cone's local coordinate system,
49         -- - Ang is the half-angle at the apex of the cone,   and
50         -- - R is the reference radius.
51         
52
53 uses Ax3      from gp,
54      Cone     from gp,
55      Pnt      from gp,
56      Trsf     from gp,
57      GTrsf2d  from gp,
58      Vec      from gp,
59      Curve    from Geom, 
60      Geometry from Geom
61
62 raises ConstructionError from Standard,
63        RangeError        from Standard
64
65 is
66
67   Create (A3 : Ax3; Ang : Real; Radius : Real) 
68      returns ConicalSurface
69         ---Purpose :
70         --  A3 defines the local coordinate system of the conical surface.
71         --  Ang is the conical surface semi-angle ]0, PI/2[.
72         --  Radius is the radius of the circle Viso in the placement plane 
73         --  of the conical surface defined with "XAxis" and "YAxis".
74         --  The "ZDirection" of A3 defines the direction of the surface's
75         --  axis of symmetry.
76         --  If the location point of A3 is the apex of the surface 
77         --  Radius = 0 .
78         --  At the creation the parametrization of the surface is defined
79         --  such that the normal Vector (N = D1U ^ D1V) is oriented towards
80         --  the "outside region" of the surface. 
81      raises ConstructionError;
82         ---Purpose :
83         --  Raised if Radius < 0.0 or Ang < Resolution from gp or 
84         --  Ang >= PI/2 - Resolution
85
86
87   Create (C : Cone)   returns ConicalSurface;
88         ---Purpose :
89         --  Creates a ConicalSurface from a non transient Cone from 
90         --  package gp.
91
92
93   SetCone (me : mutable; C : Cone);
94         ---Purpose :
95         --  Set <me> so that <me> has the same geometric properties as C.
96
97
98   SetRadius (me : mutable; R : Real)
99         ---Purpose :
100         --  Changes the radius of the conical surface in the placement
101         --  plane (Z = 0, V = 0).  The local coordinate system is not
102         --  modified.
103      raises ConstructionError;
104         ---Purpose : Raised if R < 0.0
105
106
107   SetSemiAngle (me : mutable; Ang : Real)
108         ---Purpose :
109         --  Changes the semi angle of the conical surface.
110      raises ConstructionError;
111         ---Purpose :
112         --  Raised if Ang < Resolution or Ang >= PI/2 - Resolution 
113
114
115   Cone (me) returns Cone;
116         ---Purpose :
117         --  returns a non transient cone with the same geometric properties
118         --  as <me>.
119
120
121   UReversedParameter (me; U : Real ) returns Real;
122         ---Purpose: return 2.PI - U.
123
124
125   VReversedParameter (me; V : Real ) returns Real;
126         ---Purpose: Computes the u (or v) parameter on the modified
127         -- surface, when reversing its u (or v) parametric
128         -- direction, for any point of u parameter U (or of v
129         -- parameter V) on this cone.
130         -- In the case of a cone, these functions return respectively:
131         -- - 2.*Pi - U, -V.
132   
133   
134   VReverse (me : mutable)
135         ---Purpose : Changes the orientation of this cone in the v
136         -- parametric direction. The bounds of the surface are
137         -- not changed but the v parametric direction is reversed.
138         -- As a consequence, for a cone:
139         -- - the "main Direction" of the local coordinate system
140         --   is reversed, and
141         -- - the half-angle at the apex is inverted.
142   is redefined;
143
144   TransformParameters(me; U,V : in out Real; T : Trsf from gp)
145         ---Purpose: Computes the  parameters on the  transformed  surface for
146         --          the transform of the point of parameters U,V on <me>.
147         --          
148         --          me->Transformed(T)->Value(U',V')
149         --          
150         --          is the same point as
151         --          
152         --          me->Value(U,V).Transformed(T)
153         --          
154         --          Where U',V' are the new values of U,V after calling
155         --          
156         --          me->TranformParameters(U,V,T)
157         --          
158         --          This methods multiplies V by T.ScaleFactor()
159      is redefined;  
160
161   ParametricTransformation(me; T : Trsf from gp) returns GTrsf2d from gp
162         ---Purpose: Returns a 2d transformation  used to find the  new
163         --          parameters of a point on the transformed surface.
164         --          
165         --          me->Transformed(T)->Value(U',V')
166         --          
167         --          is the same point as
168         --          
169         --          me->Value(U,V).Transformed(T)
170         --          
171         --          Where U',V' are  obtained by transforming U,V with
172         --          th 2d transformation returned by
173         --          
174         --          me->ParametricTransformation(T)
175         --          
176         --          This  methods  returns  a scale  centered  on  the
177         --          U axis with T.ScaleFactor
178      is redefined;  
179
180   Apex (me)  returns Pnt;
181         ---Purpose : Computes the apex of this cone. It is on the negative
182         -- side of the axis of revolution of this cone if the
183         -- half-angle at the apex is positive, and on the positive
184         -- side of the "main Axis" if the half-angle is negative.
185      
186
187
188   Bounds (me; U1, U2, V1, V2 : out Real);
189         ---Purpose :
190         --  The conical surface is infinite in the V direction so 
191         --  V1 = Realfirst from Standard and V2 = RealLast.  
192         --  U1 = 0 and U2 = 2*PI.
193
194
195   Coefficients (me; A1, A2, A3, B1, B2, B3, C1, C2, C3, D : out Real);
196         ---Purpose :
197         --  Returns the coefficients of the implicit equation of the
198         --  quadric in the absolute cartesian coordinate system :
199         --  These coefficients are normalized.
200         --  A1.X**2 + A2.Y**2 + A3.Z**2 + 2.(B1.X.Y + B2.X.Z + B3.Y.Z) +
201         --  2.(C1.X + C2.Y + C3.Z) + D = 0.0
202
203
204   RefRadius (me)   returns Real;
205         ---Purpose : Returns the reference radius of this cone.
206         -- The reference radius is the radius of the circle formed
207         -- by the intersection of this cone and its reference
208         -- plane (i.e. the plane defined by the origin, "X
209         -- Direction" and "Y Direction" of the local coordinate
210         -- system of this cone).
211         -- If the apex of this cone is on the origin of the local
212         -- coordinate system of this cone, the returned value is 0.
213        
214      
215   SemiAngle (me)  returns Real;
216         ---Purpose :
217         --  returns the semi-angle of the conical surface ]0.0, PI/2[.
218
219
220   IsUClosed (me)  returns Boolean;
221         ---Purpose : returns True.
222
223
224   IsVClosed (me)  returns Boolean;
225         ---Purpose : returns False.
226
227
228   IsUPeriodic (me)  returns Boolean;
229         ---Purpose : Returns True.
230
231
232   IsVPeriodic (me)  returns Boolean;
233         ---Purpose : Returns False.
234
235
236   UIso (me; U : Real)  returns Curve;
237         ---Purpose : Builds the U isoparametric line of this cone. The
238         --  origin of this line is on the reference plane of this
239         --  cone (i.e. the plane defined by the origin, "X Direction"
240         --  and "Y Direction" of the local coordinate system of this cone).
241         
242
243   VIso (me; V : Real)   returns Curve;
244         ---Purpose : Builds the V isoparametric circle of this cone. It is the
245         -- circle on this cone, located in the plane of Z
246         -- coordinate V*cos(Semi-Angle) in the local coordinate system of this
247         -- cone. The "Axis" of this circle is the axis of revolution
248         -- of this cone. Its starting point is defined by the "X
249         -- Direction" of this cone.
250         -- Warning
251         -- If the V isoparametric circle is close to the apex of
252         -- this cone, the radius of the circle becomes very small.
253         -- It is possible to have a circle with radius equal to 0.0.
254        
255
256
257   D0 (me; U, V : Real; P : out Pnt);
258         ---Purpose :
259         --  Computes the  point P (U, V) on the surface.
260         --  P (U, V) = Loc +
261         --  (RefRadius + V * sin (Semi-Angle)) * (cos (U) * XDir + sin (U) * YDir) +
262         --  V * cos (Semi-Angle) * ZDir
263         --  where Loc is the origin of the placement plane (XAxis, YAxis)
264         --  XDir is the direction of the XAxis and YDir the direction of
265         --  the YAxis.
266
267
268   D1 (me; U, V : Real; P : out Pnt; D1U, D1V : out Vec);
269         ---Purpose :
270         --  Computes the current point and the first derivatives in the
271         --  directions U and V.
272
273
274   D2 (me; U, V : Real; P : out Pnt; D1U, D1V, D2U, D2V, D2UV : out Vec);
275         ---Purpose :
276         --  Computes the current point, the first and the second derivatives
277         --  in the directions U and V.
278
279
280   D3 (me; U, V : Real; P : out Pnt;
281       D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV :out Vec);
282         ---Purpose :
283         --  Computes the current point, the first,the second and the third 
284         --  derivatives in the directions U and V.
285
286
287   DN (me; U, V : Real; Nu, Nv : Integer)   returns Vec
288         ---Purpose: Computes the derivative of order Nu in the u
289         -- parametric direction, and Nv in the v parametric
290         -- direction at the point of parameters (U, V) of this cone. 
291         -- Exceptions
292         -- Standard_RangeError if:
293         -- - Nu + Nv is less than 1,
294         -- - Nu or Nv is negative.
295     raises RangeError;
296
297
298   Transform (me : mutable; T : Trsf);
299         ---Purpose: Applies the transformation T to this cone.
300   Copy (me)  returns like me;
301
302         ---Purpose: Creates a new object which is a copy of this cone.
303 fields
304
305   radius    : Real;
306   semiAngle : Real;
307
308 end;