b311480e |
1 | -- Created on: 1992-08-26 |
2 | -- Created by: Remi GILET |
3 | -- Copyright (c) 1992-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class MakeElips2d from gce inherits Root from gce |
18 | |
19 | ---Purpose :This class implements the following algorithms used to |
20 | -- create Elips2d from gp. |
21 | -- |
22 | -- * Create an ellipse from its center, and two points: |
23 | -- one on the ciconference giving the major radius, the |
24 | -- other giving the value of the small radius. |
25 | -- * Create an ellipse from its major axis and its major |
26 | -- radius and its minor radius. |
27 | |
28 | uses Pnt2d from gp, |
29 | Ax2d from gp, |
30 | Ax22d from gp, |
31 | Elips2d from gp |
32 | |
33 | raises NotDone from StdFail |
34 | |
35 | is |
36 | |
37 | Create (MajorAxis : Ax2d from gp ; |
38 | MajorRadius, MinorRadius : Real from Standard ; |
39 | Sense : Boolean from Standard = Standard_True) |
40 | returns MakeElips2d; |
41 | --- Purpose : |
42 | -- Creates an ellipse with the major axis, the major and the |
43 | -- minor radius. The location of the MajorAxis is the center |
44 | -- of the ellipse. |
45 | -- The sense of parametrization is given by Sense. |
46 | -- It is possible to create an ellipse with MajorRadius = MinorRadius. |
47 | -- the status is "InvertRadius" if MajorRadius < MinorRadius or |
48 | -- "NegativeRadius" if MinorRadius < 0.0 |
49 | |
50 | Create (A : Ax22d from gp ; |
51 | MajorRadius, MinorRadius : Real from Standard ) |
52 | returns MakeElips2d; |
53 | --- Purpose : |
54 | -- Axis defines the Xaxis and Yaxis of the ellipse which defines |
55 | -- the origin and the sense of parametrization. |
56 | -- Creates an ellipse with the AxisPlacement the major and the |
57 | -- minor radius. The location of Axis is the center |
58 | -- of the ellipse. |
59 | -- It is possible to create an ellipse with MajorRadius = MinorRadius. |
60 | -- the status is "InvertRadius" if MajorRadius < MinorRadius or |
61 | -- "NegativeRadius" if MinorRadius < 0.0 |
62 | |
63 | Create(S1,S2 : Pnt2d from gp; |
64 | Center : Pnt2d from gp) returns MakeElips2d; |
65 | ---Purpose: Makes an Elips2d with its center and two points. |
66 | -- The sense of parametrization is given by S1, S2, |
67 | -- and Center. |
68 | -- Depending on the constructor, the implicit orientation of the ellipse is: |
69 | -- - the sense defined by A, |
70 | -- - the sense defined by points Center, S1 and S2, |
71 | -- - the trigonometric sense if Sense is not given or is true, or |
72 | -- - the opposite if Sense is false. |
73 | -- It is possible to construct an ellipse where the major |
74 | -- and minor radii are equal. |
75 | -- Warning |
76 | -- If an error occurs (that is, when IsDone returns |
77 | -- false), the Status function returns: |
78 | -- - gce_InvertRadius if MajorRadius is less than MinorRadius, |
79 | -- - gce_NegativeRadius if MajorRadius or |
80 | -- MinorRadius is less than 0.0, |
81 | -- - gce_NullAxis if points S1, S2 and Center are collinear, or |
82 | -- - gce_InvertAxis if the major radius computed with |
83 | -- Center and S1 is less than the minor radius |
84 | -- computed with Center, S1 and S2. |
85 | |
86 | Value(me) returns Elips2d from gp |
87 | raises NotDone |
88 | is static; |
89 | ---C++: return const& |
90 | ---Purpose: Returns the constructed ellipse. |
91 | -- Exceptions StdFail_NotDone if no ellipse is constructed. |
92 | |
93 | Operator(me) returns Elips2d from gp |
94 | is static; |
95 | ---C++: return const& |
96 | ---C++: alias "Standard_EXPORT operator gp_Elips2d() const;" |
97 | |
98 | fields |
99 | |
100 | TheElips2d : Elips2d from gp; |
101 | --The solution from gp. |
102 | |
103 | end MakeElips2d; |
104 | |
105 | |
106 | |
107 | |