1 -- Created on: 1993-03-10
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class Parabola from Geom inherits Conic from Geom
19 ---Purpose : Describes a parabola in 3D space.
20 -- A parabola is defined by its focal length (i.e. the
21 -- distance between its focus and its apex) and is
22 -- positioned in space with a coordinate system
23 -- (gp_Ax2 object) where:
24 -- - the origin is the apex of the parabola,
25 -- - the "X Axis" defines the axis of symmetry; the
26 -- parabola is on the positive side of this axis,
27 -- - the origin, "X Direction" and "Y Direction" define the
28 -- plane of the parabola.
29 -- This coordinate system is the local coordinate
30 -- system of the parabola.
31 -- The "main Direction" of this coordinate system is a
32 -- vector normal to the plane of the parabola. The axis,
33 -- of which the origin and unit vector are respectively the
34 -- origin and "main Direction" of the local coordinate
35 -- system, is termed the "Axis" or "main Axis" of the parabola.
36 -- The "main Direction" of the local coordinate system
37 -- gives an explicit orientation to the parabola,
38 -- determining the direction in which the parameter
39 -- increases along the parabola.
40 -- The Geom_Parabola parabola is parameterized as follows:
41 -- P(U) = O + U*U/(4.*F)*XDir + U*YDir
43 -- - P is the point of parameter U,
44 -- - O, XDir and YDir are respectively the origin, "X
45 -- Direction" and "Y Direction" of its local coordinate system,
46 -- - F is the focal length of the parabola.
47 -- The parameter of the parabola is therefore its Y
48 -- coordinate in the local coordinate system, with the "X
49 -- Axis" of the local coordinate system defining the origin
51 -- The parameter range is ] -infinite, +infinite [.
61 raises ConstructionError from Standard,
62 RangeError from Standard
68 Create (Prb : Parab) returns Parabola;
69 ---Purpose : Creates a parabola from a non transient one.
72 Create (A2 : Ax2; Focal : Real) returns Parabola
74 -- Creates a parabola with its local coordinate system "A2"
75 -- and it's focal length "Focal".
76 -- The XDirection of A2 defines the axis of symmetry of the
77 -- parabola. The YDirection of A2 is parallel to the directrix
78 -- of the parabola. The Location point of A2 is the vertex of
80 raises ConstructionError;
81 ---Purpose : Raised if Focal < 0.0
84 Create (D : Ax1; F : Pnt) returns Parabola;
86 -- D is the directrix of the parabola and F the focus point.
87 -- The symmetry axis (XAxis) of the parabola is normal to the
88 -- directrix and pass through the focus point F, but its
89 -- location point is the vertex of the parabola.
90 -- The YAxis of the parabola is parallel to D and its location
91 -- point is the vertex of the parabola. The normal to the plane
92 -- of the parabola is the cross product between the XAxis and the
97 SetFocal (me : mutable; Focal : Real)
98 ---Purpose : Assigns the value Focal to the focal distance of this parabola.
99 -- Exceptions Standard_ConstructionError if Focal is negative.
100 raises ConstructionError
104 SetParab (me : mutable; Prb : Parab)
105 ---Purpose: Converts the gp_Parab parabola Prb into this parabola.
110 Parab (me) returns Parab
112 -- Returns the non transient parabola from gp with the same
113 -- geometric properties as <me>.
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.
123 FirstParameter (me) returns Real is redefined static;
124 ---Purpose : Returns the value of the first or last parameter of this
125 -- parabola. This is, respectively:
126 -- - Standard_Real::RealFirst(), or
127 -- - Standard_Real::RealLast().
129 LastParameter (me) returns Real is redefined static;
130 ---Purpose : Returns the value of the first or last parameter of this
131 -- parabola. This is, respectively:
132 -- - Standard_Real::RealFirst(), or
133 -- - Standard_Real::RealLast().
135 IsClosed (me) returns Boolean is redefined static;
136 ---Purpose : Returns False
139 IsPeriodic (me) returns Boolean is redefined static;
140 ---Purpose : Returns False
143 Directrix (me) returns Ax1;
144 ---Purpose : Computes the directrix of this parabola.
145 -- This is a line normal to the axis of symmetry, in the
146 -- plane of this parabola, located on the negative side
147 -- of its axis of symmetry, at a distance from the apex
148 -- equal to the focal length.
149 -- The directrix is returned as an axis (gp_Ax1 object),
150 -- where the origin is located on the "X Axis" of this parabola.
154 Eccentricity (me) returns Real is redefined static;
155 ---Purpose : Returns 1. (which is the eccentricity of any parabola).
158 Focus (me) returns Pnt;
159 ---Purpose: Computes the focus of this parabola. The focus is on the
160 -- positive side of the "X Axis" of the local coordinate
161 -- system of the parabola.
163 Focal (me) returns Real;
164 ---Purpose : Computes the focal distance of this parabola
165 -- The focal distance is the distance between the apex
166 -- and the focus of the parabola.
169 Parameter (me) returns Real;
170 ---Purpose : Computes the parameter of this parabola which is the
171 -- distance between its focus and its directrix. This
172 -- distance is twice the focal length.
173 -- If P is the parameter of the parabola, the equation of
174 -- the parabola in its local coordinate system is: Y**2 = 2.*P*X.
178 D0(me; U : Real; P : out Pnt) is redefined static;
179 ---Purpose: Returns in P the point of parameter U.
180 -- If U = 0 the returned point is the origin of the XAxis and
181 -- the YAxis of the parabola and it is the vertex of the parabola.
182 -- P = S + F * (U * U * XDir + * U * YDir)
183 -- where S is the vertex of the parabola, XDir the XDirection and
184 -- YDir the YDirection of the parabola's local coordinate system.
187 D1 (me; U : Real; P : out Pnt; V1 : out Vec) is redefined static;
189 -- Returns the point P of parameter U and the first derivative V1.
192 D2 (me; U : Real; P : out Pnt; V1, V2 : out Vec) is redefined static;
194 -- Returns the point P of parameter U, the first and second
195 -- derivatives V1 and V2.
198 D3 (me; U : Real; P : out Pnt; V1, V2, V3 : out Vec) is redefined static;
200 -- Returns the point P of parameter U, the first second and third
201 -- derivatives V1 V2 and V3.
204 DN (me; U : Real; N : Integer) returns Vec
205 ---Purpose : For the point of parameter U of this parabola,
206 -- computes the vector corresponding to the Nth derivative.
207 -- Exceptions Standard_RangeError if N is less than 1.
212 Transform (me : mutable; T : Trsf) is redefined static;
213 ---Purpose: Applies the transformation T to this parabola.
215 TransformedParameter(me; U : Real; T : Trsf from gp) returns Real
216 ---Purpose: Returns the parameter on the transformed curve for
217 -- the transform of the point of parameter U on <me>.
219 -- me->Transformed(T)->Value(me->TransformedParameter(U,T))
221 -- is the same point as
223 -- me->Value(U).Transformed(T)
225 -- This methods returns <U> * T.ScaleFactor()
228 ParametricTransformation(me; T : Trsf from gp) returns Real
229 ---Purpose: Returns a coefficient to compute the parameter on
230 -- the transformed curve for the transform of the
233 -- Transformed(T)->Value(U * ParametricTransformation(T))
235 -- is the same point as
237 -- Value(U).Transformed(T)
239 -- This methods returns T.ScaleFactor()
243 Copy (me) returns like me
245 ---Purpose: Creates a new object which is a copy of this parabola.