Test for 0022778: Bug in BRepMesh
[occt.git] / src / GC / GC_MakeEllipse.cdl
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
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
21
22 class MakeEllipse from GC inherits Root from GC
23
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.
31
32 uses Pnt     from gp,
33      Ax2     from gp,
34      Hypr    from gp,
35      Ellipse from Geom,
36      Elips   from gp
37
38 raises NotDone from StdFail
39
40 is
41
42 Create (E : Elips from gp)  returns MakeEllipse;
43         --- Purpose :
44         --  Creates an ellipse from a non persistent ellipse E from package gp by its conversion. 
45
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;
53         --  Warnings :
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.
65
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.
73                 
74 Value(me) returns Ellipse from Geom
75     raises NotDone
76     is static;
77         ---Purpose: Returns the constructed ellipse.
78         -- Exceptions StdFail_NotDone if no ellipse is constructed.
79         ---C++: return const&
80
81 Operator(me) returns Ellipse from Geom
82     is static;
83         ---C++: return const&
84         ---C++: alias "Standard_EXPORT operator Handle_Geom_Ellipse() const;"
85
86 fields
87
88     TheEllipse : Ellipse from Geom;
89     --The solution from Geom.
90     
91 end MakeEllipse;