1 -- Created on: 1992-09-28
2 -- Created by: Remi GILET
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
22 class MakeEllipse from GC inherits Root from GC
24 ---Purpose :This class implements construction algorithms for an ellipse in
25 -- 3D space. The result is a Geom_Ellipse ellipse.
26 -- A MakeEllipse object provides a framework for:
27 -- - defining the construction of the ellipse,
28 -- - implementing the construction algorithm, and
29 -- - consulting the results. In particular, the Value
30 -- function returns the constructed ellipse.
38 raises NotDone from StdFail
42 Create (E : Elips from gp) returns MakeEllipse;
44 -- Creates an ellipse from a non persistent ellipse E from package gp by its conversion.
46 Create (A2 : Ax2 from gp ;
47 MajorRadius, MinorRadius : Real from Standard) returns MakeEllipse;
48 --- Purpose : Constructs an ellipse with major and minor radii MajorRadius and
49 -- MinorRadius, and located in the plane defined by
50 -- the "X Axis" and "Y Axis" of the coordinate system A2, where:
51 -- - its center is the origin of A2, and
52 -- - its major axis is the "X Axis" of A2;
54 -- The MakeEllipse class does not prevent the
55 -- construction of an ellipse where MajorRadius is equal to MinorRadius.
56 -- If an error occurs (that is, when IsDone returns
57 -- false), the Status function returns:
58 -- - gce_InvertRadius if MajorRadius is less than MinorRadius;
59 -- - gce_NegativeRadius if MinorRadius is less than 0.0;
60 -- - gce_NullAxis if the points S1 and Center are coincident; or
61 -- - gce_InvertAxis if:
62 -- - the major radius computed with Center and S1
63 -- is less than the minor radius computed with Center, S1 and S2, or
64 -- - Center, S1 and S2 are collinear.
66 Create(S1,S2 : Pnt from gp;
67 Center : Pnt from gp) returns MakeEllipse;
68 ---Purpose: Constructs an ellipse centered on the point Center, where
69 -- - the plane of the ellipse is defined by Center, S1 and S2,
70 -- - its major axis is defined by Center and S1,
71 -- - its major radius is the distance between Center and S1, and
72 -- - its minor radius is the distance between S2 and the major axis.
74 Value(me) returns Ellipse from Geom
77 ---Purpose: Returns the constructed ellipse.
78 -- Exceptions StdFail_NotDone if no ellipse is constructed.
81 Operator(me) returns Ellipse from Geom
84 ---C++: alias "Standard_EXPORT operator Handle_Geom_Ellipse() const;"
88 TheEllipse : Ellipse from Geom;
89 --The solution from Geom.