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