CommitLineData
b311480e 1-- Copyright (c) 1991-1999 Matra Datavision
b311480e 3--
973c2be1 4-- This file is part of Open CASCADE Technology software library.
b311480e 5--
d5f74e42 6-- This library is free software; you can redistribute it and/or modify it under
7-- the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 8-- by the Free Software Foundation, with special exception defined in the file
9-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10-- distribution for complete text of the license and disclaimer of any warranty.
b311480e 11--
973c2be1 12-- Alternatively, this file may be used under the terms of Open CASCADE
13-- commercial license or contractual agreement.
7fd59977 14
087da3bd 15class Parab from gp
7fd59977 16
17 ---Purpose:
18 -- Describes a parabola in 3D space.
19 -- A parabola is defined by its focal length (that is, the
20 -- distance between its focus and apex) and positioned in
21 -- space with a coordinate system (a gp_Ax2 object)
22 -- where:
23 -- - the origin of the coordinate system is on the apex of
24 -- the parabola,
25 -- - the "X Axis" of the coordinate system is the axis of
26 -- symmetry; the parabola is on the positive side of this axis, and
27 -- - the origin, "X Direction" and "Y Direction" of the
28 -- coordinate system define the plane of the parabola.
29 -- The equation of the parabola in this coordinate system,
30 -- which is the "local coordinate system" of the parabola, is:
31 -- Y**2 = (2*P) * X.
32 -- where P, referred to as the parameter of the parabola, is
33 -- the distance between the focus and the directrix (P is
34 -- twice the focal length).
35 -- The "main Direction" of the local coordinate system gives
36 -- the normal vector to the plane of the parabola.
38 -- gce_MakeParab which provides functions for more
39 -- complex parabola constructions
40 -- Geom_Parabola which provides additional functions for
41 -- constructing parabolas and works, in particular, with the
42 -- parametric equations of parabolas
43
44uses Ax1, Ax2, Pnt, Trsf, Vec
45
46raises ConstructionError from Standard
47
48is
49
50
51
52 Create returns Parab;
53 ---C++: inline
54 --- Purpose : Creates an indefinite Parabola.
55
56
57 Create (A2 : Ax2; Focal : Real) returns Parab
58 ---C++: inline
59 --- Purpose :
60 -- Creates a parabola with its local coordinate system "A2"
61 -- and it's focal length "Focal".
62 -- The XDirection of A2 defines the axis of symmetry of the
63 -- parabola. The YDirection of A2 is parallel to the directrix
64 -- of the parabola. The Location point of A2 is the vertex of
65 -- the parabola
66 -- Raises ConstructionError if Focal < 0.0
67 raises ConstructionError;
68 --- Purpose : Raised if Focal < 0.0
69
70
71 Create (D : Ax1; F : Pnt) returns Parab;
72 ---C++: inline
73 --- Purpose :
74 -- D is the directrix of the parabola and F the focus point.
75 -- The symmetry axis (XAxis) of the parabola is normal to the
76 -- directrix and pass through the focus point F, but its
77 -- location point is the vertex of the parabola.
78 -- The YAxis of the parabola is parallel to D and its location
79 -- point is the vertex of the parabola. The normal to the plane
80 -- of the parabola is the cross product between the XAxis and the
81 -- YAxis.
82
83
84 SetAxis (me : in out; A1 : Ax1)
85 ---C++: inline
86 --- Purpose : Modifies this parabola by redefining its local coordinate system so that
87 -- - its origin and "main Direction" become those of the
88 -- axis A1 (the "X Direction" and "Y Direction" are then
89 -- recomputed in the same way as for any gp_Ax2)
90 -- Raises ConstructionError if the direction of A1 is parallel to the previous
91 -- XAxis of the parabola.
92 raises ConstructionError
93
94 is static;
95
96
97 SetFocal (me : in out; Focal : Real)
98 ---C++: inline
99 --- Purpose : Changes the focal distance of the parabola.
100 -- Raises ConstructionError if Focal < 0.0
101 raises ConstructionError
102 is static;
103
104
105 SetLocation (me : in out; P : Pnt) is static;
106 ---C++: inline
107 --- Purpose :
108 -- Changes the location of the parabola. It is the vertex of
109 -- the parabola.
110
111
112 SetPosition (me : in out; A2 : Ax2) is static;
113 --- Purpose : Changes the local coordinate system of the parabola.
114
115
116 Axis (me) returns Ax1 is static;
117 ---C++: inline
118 --- Purpose :
119 -- Returns the main axis of the parabola.
120 -- It is the axis normal to the plane of the parabola passing
121 -- through the vertex of the parabola.
122 ---C++: return const&
123
124
125 Directrix (me) returns Ax1 is static;
126 ---C++: inline
127 --- Purpose : Computes the directrix of this parabola.
128 -- The directrix is:
129 -- - a line parallel to the "Y Direction" of the local
130 -- coordinate system of this parabola, and
131 -- - located on the negative side of the axis of symmetry,
132 -- at a distance from the apex which is equal to the focal
133 -- length of this parabola.
134 -- The directrix is returned as an axis (a gp_Ax1 object),
135 -- the origin of which is situated on the "X Axis" of this parabola.
136
137
138 Focal (me) returns Real is static;
139 ---C++: inline
140 --- Purpose :
141 -- Returns the distance between the vertex and the focus
142 -- of the parabola.
143
144
145 Focus (me) returns Pnt is static;
146 ---C++: inline
147 ---Purpose: - Computes the focus of the parabola.
148
149
150 Location (me) returns Pnt is static;
151 ---C++: inline
152 --- Purpose :
153 -- Returns the vertex of the parabola. It is the "Location"
154 -- point of the coordinate system of the parabola.
155 ---C++: return const&
156
157
158 Parameter (me) returns Real is static;
159 ---C++: inline
160 --- Purpose :
161 -- Computes the parameter of the parabola.
162 -- It is the distance between the focus and the directrix of
163 -- the parabola. This distance is twice the focal length.
164
165
166 Position (me) returns Ax2 is static;
167 --- Purpose :
168 -- Returns the local coordinate system of the parabola.
169 ---C++: inline
170 ---C++: return const&
171
172 XAxis (me) returns Ax1 is static;
173 ---C++: inline
174 --- Purpose :
175 -- Returns the symmetry axis of the parabola. The location point
176 -- of the axis is the vertex of the parabola.
177
178
179 YAxis (me) returns Ax1 is static;
180 ---C++: inline
181 --- Purpose :
182 -- It is an axis parallel to the directrix of the parabola.
183 -- The location point of this axis is the vertex of the parabola.
184
185
186
187
188 Mirror (me : in out; P : Pnt) is static;
189
190 Mirrored (me; P : Pnt) returns Parab is static;
191
192
193 --- Purpose :
194 -- Performs the symmetrical transformation of a parabola
195 -- with respect to the point P which is the center of the
196 -- symmetry.
197
198
199 Mirror (me : in out; A1 : Ax1) is static;
200
201 Mirrored (me; A1 : Ax1) returns Parab is static;
202 --- Purpose :
203 -- Performs the symmetrical transformation of a parabola
204 -- with respect to an axis placement which is the axis of
205 -- the symmetry.
206
207
208
209 Mirror (me : in out; A2 : Ax2) is static;
210
211 Mirrored (me; A2 : Ax2) returns Parab is static;
212
213 --- Purpose :
214 -- Performs the symmetrical transformation of a parabola
215 -- with respect to a plane. The axis placement A2 locates
216 -- the plane of the symmetry (Location, XDirection, YDirection).
217
218
219
220
221 Rotate (me : in out; A1 : Ax1; Ang : Real) is static;
222 ---C++: inline
223
224 Rotated (me; A1 : Ax1; Ang : Real) returns Parab is static;
225 ---C++: inline
226 --- Purpose :
227 -- Rotates a parabola. A1 is the axis of the rotation.
228 -- Ang is the angular value of the rotation in radians.
229
230
231 Scale (me : in out; P : Pnt; S : Real) is static;
232 ---C++: inline
233
234 Scaled (me; P : Pnt; S : Real) returns Parab is static;
235 ---C++: inline
236 --- Purpose :
237 -- Scales a parabola. S is the scaling value.
238 -- If S is negative the direction of the symmetry axis
239 -- XAxis is reversed and the direction of the YAxis too.
240
241
242
243 Transform (me : in out; T : Trsf) is static;
244 ---C++: inline
245
246 Transformed (me; T : Trsf) returns Parab is static;
247 ---C++: inline
248 --- Purpose :
249 -- Transforms a parabola with the transformation T from class Trsf.
250
251
252
253 Translate (me : in out; V : Vec) is static;
254 ---C++: inline
255
256 Translated (me; V : Vec) returns Parab is static;
257 ---C++: inline
258 --- Purpose :
259 -- Translates a parabola in the direction of the vector V.
260 -- The magnitude of the translation is the vector's magnitude.
261
262
263 Translate (me : in out; P1, P2 : Pnt) is static;
264 ---C++: inline
265
266 Translated (me; P1, P2 : Pnt) returns Parab is static;
267 ---C++: inline
268 --- Purpose :
269 -- Translates a parabola from the point P1 to the point P2.
270
271
272
273
274fields
275
276 pos : Ax2;
277 focalLength : Real;
278
279end;