0024682: Move out B-spline cache from curves and surfaces to dedicated classes BSplCL...
[occt.git] / src / Geom2d / Geom2d_Parabola.cdl
1 -- Created on: 1993-03-24
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 Parabola from Geom2d inherits Conic from Geom2d
18
19
20         --- Purpose : Describes a parabola in the plane (2D space).
21         -- A parabola is defined by its focal length (i.e. the
22         -- distance between its focus and its apex) and is
23         -- positioned in the plane with a coordinate system
24         -- (gp_Ax22d object) where:
25         -- - the origin is the apex of the parabola, and
26         -- - the "X Axis" defines the axis of symmetry; the
27         --   parabola is on the positive side of this axis.
28         -- This coordinate system is the local coordinate
29         -- system of the parabola.
30         -- The orientation (direct or indirect) of the local
31         -- coordinate system gives an explicit orientation to the
32         -- parabola, determining the direction in which the
33         -- parameter increases along the parabola.
34         -- The Geom_Parabola parabola is parameterized as follows:
35         -- P(U) = O + U*U/(4.*F)*XDir + U*YDir, where:
36         -- - P is the point of parameter U,
37         -- - O, XDir and YDir are respectively the origin, "X
38         --   Direction" and "Y Direction" of its local coordinate system,
39         -- - F is the focal length of the parabola.
40         -- The parameter of the parabola is therefore its Y
41         -- coordinate in the local coordinate system, with the "X
42         -- Axis" of the local coordinate system defining the
43         -- origin of the parameter.
44         -- The parameter range is ] -infinite,+infinite [.
45
46 uses  Ax2d     from gp,
47       Ax22d    from gp,
48       Parab2d  from gp,
49       Pnt2d    from gp,
50       Trsf2d   from gp,
51       Vec2d    from gp,
52       Geometry from Geom2d
53
54 raises ConstructionError from Standard,
55        RangeError        from Standard
56
57
58 is
59
60
61
62
63   Create (Prb : Parab2d)   returns Parabola;
64         --- Purpose : Creates a parabola from a non persistent one.
65
66
67   Create (MirrorAxis : Ax2d; Focal : Real;
68           Sense: Boolean from Standard = Standard_True)   
69   returns Parabola
70         --- Purpose :
71         --  Creates a parabola with its "MirrorAxis" and it's focal 
72         --  length "Focal".
73         --  MirrorAxis is the axis of symmetry of the curve, it is the
74         --  "XAxis". The "YAxis" is parallel to the directrix of the
75         --  parabola and is in the direct sense if Sense is True. 
76         --  The "Location" point of "MirrorAxis" is the vertex of the parabola
77      raises ConstructionError;
78         --- Purpose : Raised if Focal < 0.0
79
80   Create (Axis : Ax22d; Focal : Real)   returns Parabola
81         --- Purpose :
82         --  Creates a parabola with its Axis and it's focal 
83         --  length "Focal".
84         --  The XDirection of Axis is the axis of symmetry of the curve, 
85         --  it is the "XAxis". The "YAxis" is parallel to the directrix of the
86         --  parabola. The "Location" point of "Axis" is the vertex
87         --  of the parabola.
88      raises ConstructionError;
89         --- Purpose : Raised if Focal < 0.0
90
91
92   Create (D : Ax2d; F : Pnt2d)  returns Parabola;
93         --- Purpose :
94         --  D is the directrix of the parabola and F the focus point.
95         --  The symmetry axis "XAxis" of the parabola is normal to the
96         --  directrix and pass through the focus point F, but its
97         --  "Location" point is the vertex of the parabola.
98         --  The "YAxis" of the parabola is parallel to D and its "Location"
99         --  point is the vertex of the parabola.
100
101
102   SetFocal (me : mutable; Focal : Real)
103         --- Purpose : Assigns the value Focal to the focal length of this parabola.
104         -- Exceptions Standard_ConstructionError if Focal is negative.
105      raises ConstructionError;
106
107
108   SetParab2d (me : mutable; Prb : Parab2d);
109         --- Purpose: Converts the gp_Parab2d parabola Prb into this parabola.
110   
111   Parab2d (me)  returns Parab2d;
112         --- Purpose :
113         --  Returns the non persistent parabola from gp with the same 
114         --  geometric properties as <me>.
115
116
117   ReversedParameter(me; U : Real) returns Real is redefined static;
118         ---Purpose: Computes the parameter on the reversed parabola
119         -- for the point of parameter U on this parabola.
120         -- For a parabola, the returned value is -U.
121
122
123   FirstParameter (me)  returns Real is redefined static;
124         --- Purpose : Returns RealFirst from Standard.
125
126
127   LastParameter (me)   returns Real is redefined static;
128         --- Purpose : Returns  RealLast from Standard.
129
130
131   IsClosed (me)    returns Boolean is redefined static;
132         --- Purpose : Returns False
133
134
135   IsPeriodic (me)   returns Boolean is redefined static;
136         --- Purpose : Returns False
137
138
139   Directrix (me)   returns Ax2d;
140         --- Purpose : The directrix is parallel to the "YAxis" of the parabola.
141         --  The "Location" point of the directrix is the intersection
142         --  point between the directrix and the symmetry axis ("XAxis") of the parabola.
143
144
145   Eccentricity (me)    returns Real is redefined static;
146         --- Purpose : Returns the eccentricity e = 1.0
147
148
149   Focus (me)   returns Pnt2d;
150         ---Purpose: Computes the focus of this parabola The focus is on the
151         -- positive side of the "X Axis" of the local coordinate system of the parabola.
152
153   Focal (me)  returns Real;
154         --- Purpose :  Computes the focal length of this parabola. 
155         -- The focal length is the distance between the apex and the focus of the parabola.
156         
157
158
159   Parameter (me)   returns Real;
160         --- Purpose : Computes the parameter of this parabola, which is
161         -- the distance between its focus and its directrix. This
162         -- distance is twice the focal length.
163         -- If P is the parameter of the parabola, the equation of
164         -- the parabola in its local coordinate system is: Y**2 = 2.*P*X.
165         
166
167   D0(me; U : Real; P : out Pnt2d) is redefined static;
168         ---Purpose: Returns in P the point of parameter U.
169         --  If U = 0 the returned point is the origin of the XAxis and 
170         --  the YAxis of the parabola and it is the vertex of the parabola.
171         --  P = S + F * (U * U * XDir +  * U * YDir)
172         --  where S is the vertex of the parabola, XDir the XDirection and
173         --  YDir the YDirection of the parabola's local coordinate system.
174
175
176   D1 (me; U : Real; P : out Pnt2d; V1 : out Vec2d) is redefined static;
177         --- Purpose :
178         --  Returns the point P of parameter U and the first derivative V1.
179
180
181   D2 (me; U : Real; P : out Pnt2d; V1, V2 : out Vec2d) is redefined static;
182         --- Purpose :
183         --  Returns the point P of parameter U, the first and second
184         --  derivatives V1 and V2.
185
186
187   D3 (me; U : Real; P : out Pnt2d; V1, V2, V3 : out Vec2d) is redefined static;
188         --- Purpose :
189         --  Returns the point P of parameter U, the first second and third
190         --  derivatives V1 V2 and V3.
191         
192
193   DN (me; U : Real; N : Integer)   returns Vec2d
194         --- Purpose : For the point of parameter U of this parabola,
195         -- computes the vector corresponding to the Nth derivative.
196         -- Exceptions Standard_RangeError if N is less than 1.
197            raises RangeError
198      is redefined static;
199
200   Transform (me : mutable; T : Trsf2d) is redefined static;
201         ---Purpose: Applies the transformation T to this parabola.
202     
203   TransformedParameter(me; U : Real; T : Trsf2d from gp) returns Real
204         ---Purpose: Computes the parameter on the transformed
205         -- parabola, for the point of parameter U on this parabola.
206         -- For a parabola, the returned value is equal to U
207         -- multiplied by the scale factor of transformation T.
208      is redefined static;  
209
210   ParametricTransformation(me; T : Trsf2d from gp) returns Real
211         ---Purpose: Returns a  coefficient to compute the parameter on
212         --          the transformed  curve  for  the transform  of the
213         --          point on <me>.
214         --          
215         --          Transformed(T)->Value(U * ParametricTransformation(T))
216         --          
217         --          is the same point as
218         --          
219         --          Value(U).Transformed(T)
220         --          
221         --          This methods returns T.ScaleFactor()
222      is redefined static;  
223
224
225   Copy (me)  returns like me
226   is redefined static;
227         ---Purpose: Creates a new object, which is a copy of this parabola.     
228 fields
229
230   focalLength : Real;
231
232 end;