b311480e |
1 | -- Created on: 1992-08-26 |
2 | -- Created by: Remi GILET |
3 | -- Copyright (c) 1992-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 | |
7fd59977 |
21 | |
22 | class MakeParab2d from gce inherits Root from gce |
23 | |
24 | ---Purpose :This class implements the following algorithms used to |
25 | -- create Parab2d from gp. |
26 | -- Defines an infinite parabola. |
27 | -- An axis placement one axis defines the local cartesian |
28 | -- coordinate system ("XAxis") of the parabola. |
29 | -- The vertex of the parabola is the "Location" point of the |
30 | -- local coordinate system of the parabola. |
31 | -- The "XAxis" of the parabola is its axis of symmetry. |
32 | -- The "XAxis" is oriented from the vertex of the parabola to the |
33 | -- Focus of the parabola. |
34 | -- The "YAxis" is parallel to the directrix of the parabola and |
35 | -- its "Location" point is the vertex of the parabola. |
36 | -- The equation of the parabola in the local coordinate system is |
37 | -- Y**2 = (2*P) * X |
38 | -- P is the distance between the focus and the directrix of the |
39 | -- parabola called Parameter). |
40 | -- The focal length F = P/2 is the distance between the vertex |
41 | -- and the focus of the parabola. |
42 | -- |
43 | -- * Create a Parab2d from one apex and the center. |
44 | -- * Create a Parab2d with the directrix and the focus point. |
45 | -- * Create a Parab2d with its vertex point and its axis |
46 | -- of symetry and its focus length. |
47 | |
48 | uses Pnt2d from gp, |
49 | Ax2d from gp, |
50 | Ax22d from gp, |
51 | Parab2d from gp |
52 | |
53 | raises NotDone from StdFail |
54 | |
55 | is |
56 | |
57 | Create (MirrorAxis : Ax2d from gp ; |
58 | Focal : Real from Standard ; |
59 | Sense : Boolean from Standard = Standard_True) |
60 | returns MakeParab2d; |
61 | --- Purpose : |
62 | -- Creates a parabola with its axis of symmetry ("MirrorAxis") |
63 | -- and its focal length. |
64 | --- Warnings : It is possible to have Focal = 0. |
65 | -- The status is "NullFocalLength" Raised if Focal < 0.0 |
66 | |
67 | Create (A : Ax22d from gp ; |
68 | Focal : Real from Standard ) |
69 | returns MakeParab2d; |
70 | --- Purpose : |
71 | -- Creates a parabola with its local coordinate system <A> |
72 | -- and its focal length. |
73 | --- Warnings : It is possible to have Focal = 0. |
74 | -- The status is "NullFocalLength" Raised if Focal < 0.0 |
75 | |
76 | Create (D : Ax2d from gp ; |
77 | F : Pnt2d from gp ; |
78 | Sense : Boolean from Standard = Standard_True) |
79 | returns MakeParab2d; |
80 | --- Purpose : |
81 | -- Creates a parabola with the directrix and the focus point. |
82 | -- The sense of parametrization is given by Sense. |
83 | |
84 | Create (D : Ax22d from gp ; |
85 | F : Pnt2d from gp ) |
86 | returns MakeParab2d; |
87 | --- Purpose : |
88 | -- Creates a parabola with the local coordinate system and |
89 | -- the focus point. |
90 | -- The sense of parametrization is given by Sense. |
91 | |
92 | Create(S1 : Pnt2d from gp ; |
93 | Center : Pnt2d from gp ; |
94 | Sense : Boolean from Standard = Standard_True) returns MakeParab2d; |
95 | ---Purpose: Make an Parab2d with S1 as the Focal point and Center |
96 | -- as the apex of the parabola |
97 | -- Warning |
98 | -- The MakeParab2d class does not prevent the |
99 | -- construction of a parabola with a null focal distance. |
100 | -- If an error occurs (that is, when IsDone returns |
101 | -- false), the Status function returns: |
102 | -- - gce_NullFocusLength if Focal is less than 0.0, or |
103 | -- - gce_NullAxis if S1 and Center are coincident. |
104 | |
105 | Value(me) returns Parab2d from gp |
106 | raises NotDone |
107 | is static; |
108 | ---C++: return const& |
109 | ---Purpose: Returns the constructed parabola. |
110 | -- Exceptions StdFail_NotDone if no parabola is constructed. |
111 | |
112 | Operator(me) returns Parab2d from gp |
113 | is static; |
114 | ---C++: return const& |
115 | ---C++: alias "Standard_EXPORT operator gp_Parab2d() const;" |
116 | |
117 | fields |
118 | |
119 | TheParab2d : Parab2d from gp; |
120 | --The solution from gp. |
121 | |
122 | end MakeParab2d; |
123 | |
124 | |
125 | |
126 | |