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 MakeElips from gce inherits Root from gce |
23 | |
24 | ---Purpose :This class implements the following algorithms used to |
25 | -- create an ellipse from gp. |
26 | -- |
27 | -- * Create an ellipse from its center, and two points: |
28 | -- one on the ciconference giving the major radius, the |
29 | -- other giving the value of the small radius. |
30 | |
31 | uses Pnt from gp, |
32 | Ax2 from gp, |
33 | Elips from gp |
34 | |
35 | raises NotDone from StdFail |
36 | |
37 | is |
38 | |
39 | Create (A2 : Ax2 from gp; |
40 | MajorRadius, MinorRadius : Real from Standard) |
41 | returns MakeElips; |
42 | --- Purpose :The major radius of the ellipse is on the "XAxis" and the |
43 | -- minor radius is on the "YAxis" of the ellipse. The "XAxis" |
44 | -- is defined with the "XDirection" of A2 and the "YAxis" is |
45 | -- defined with the "YDirection" of A2. |
46 | -- Warnings : |
47 | -- It is not forbidden to create an ellipse with |
48 | -- MajorRadius = MinorRadius. |
49 | |
50 | Create(S1,S2 : Pnt from gp; |
51 | Center : Pnt from gp) returns MakeElips; |
52 | ---Purpose: Make an ellipse with its center and two points. |
53 | -- Warning |
54 | -- The MakeElips class does not prevent the |
55 | -- construction of an ellipse where the MajorRadius is |
56 | -- equal to the MinorRadius. |
57 | -- If an error occurs (that is, when IsDone returns |
58 | -- false), the Status function returns: |
59 | -- - gce_InvertRadius if MajorRadius is less than MinorRadius; |
60 | -- - gce_NegativeRadius if MinorRadius is less than 0.0; |
61 | -- - gce_NullAxis if the points S1 and Center are coincident; or |
62 | -- - gce_InvertAxis if: |
63 | -- - the major radius computed with Center and S1 |
64 | -- is less than the minor radius computed with Center, S1 and S2, or |
65 | -- - Center, S1 and S2 are collinear. |
66 | |
67 | Value(me) returns Elips from gp |
68 | raises NotDone |
69 | is static; |
70 | ---C++: return const& |
71 | ---Purpose: Returns the constructed ellipse. |
72 | -- Exceptions StdFail_NotDone if no ellipse is constructed. |
73 | |
74 | Operator(me) returns Elips from gp |
75 | is static; |
76 | ---C++: return const& |
77 | ---C++: alias "Standard_EXPORT operator gp_Elips() const;" |
78 | |
79 | fields |
80 | |
81 | TheElips : Elips from gp; |
82 | --The solution from gp. |
83 | |
84 | end MakeElips; |
85 | |
86 | |
87 | |
88 | |