1 -- Created on: 1992-09-28
2 -- Created by: Remi GILET
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and / or modify it
9 -- under the terms of the GNU Lesser General Public version 2.1 as published
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class MakeEllipse from GC inherits Root from GC
19 ---Purpose :This class implements construction algorithms for an ellipse in
20 -- 3D space. The result is a Geom_Ellipse ellipse.
21 -- A MakeEllipse object provides a framework for:
22 -- - defining the construction of the ellipse,
23 -- - implementing the construction algorithm, and
24 -- - consulting the results. In particular, the Value
25 -- function returns the constructed ellipse.
33 raises NotDone from StdFail
37 Create (E : Elips from gp) returns MakeEllipse;
39 -- Creates an ellipse from a non persistent ellipse E from package gp by its conversion.
41 Create (A2 : Ax2 from gp ;
42 MajorRadius, MinorRadius : Real from Standard) returns MakeEllipse;
43 --- Purpose : Constructs an ellipse with major and minor radii MajorRadius and
44 -- MinorRadius, and located in the plane defined by
45 -- the "X Axis" and "Y Axis" of the coordinate system A2, where:
46 -- - its center is the origin of A2, and
47 -- - its major axis is the "X Axis" of A2;
49 -- The MakeEllipse class does not prevent the
50 -- construction of an ellipse where MajorRadius is equal to MinorRadius.
51 -- If an error occurs (that is, when IsDone returns
52 -- false), the Status function returns:
53 -- - gce_InvertRadius if MajorRadius is less than MinorRadius;
54 -- - gce_NegativeRadius if MinorRadius is less than 0.0;
55 -- - gce_NullAxis if the points S1 and Center are coincident; or
56 -- - gce_InvertAxis if:
57 -- - the major radius computed with Center and S1
58 -- is less than the minor radius computed with Center, S1 and S2, or
59 -- - Center, S1 and S2 are collinear.
61 Create(S1,S2 : Pnt from gp;
62 Center : Pnt from gp) returns MakeEllipse;
63 ---Purpose: Constructs an ellipse centered on the point Center, where
64 -- - the plane of the ellipse is defined by Center, S1 and S2,
65 -- - its major axis is defined by Center and S1,
66 -- - its major radius is the distance between Center and S1, and
67 -- - its minor radius is the distance between S2 and the major axis.
69 Value(me) returns Ellipse from Geom
72 ---Purpose: Returns the constructed ellipse.
73 -- Exceptions StdFail_NotDone if no ellipse is constructed.
76 Operator(me) returns Ellipse from Geom
79 ---C++: alias "Standard_EXPORT operator Handle_Geom_Ellipse() const;"
83 TheEllipse : Ellipse from Geom;
84 --The solution from Geom.