1 // Created on: 1992-08-26
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 under
9 // the terms of the GNU Lesser General Public License 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 #ifndef _gce_MakeElips2d_HeaderFile
18 #define _gce_MakeElips2d_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <gp_Elips2d.hxx>
25 #include <gce_Root.hxx>
26 #include <Standard_Real.hxx>
27 #include <Standard_Boolean.hxx>
28 class StdFail_NotDone;
35 //! This class implements the following algorithms used to
36 //! create Elips2d from gp.
38 //! * Create an ellipse from its center, and two points:
39 //! one on the ciconference giving the major radius, the
40 //! other giving the value of the small radius.
41 //! * Create an ellipse from its major axis and its major
42 //! radius and its minor radius.
43 class gce_MakeElips2d : public gce_Root
51 //! Creates an ellipse with the major axis, the major and the
52 //! minor radius. The location of the MajorAxis is the center
54 //! The sense of parametrization is given by Sense.
55 //! It is possible to create an ellipse with MajorRadius = MinorRadius.
56 //! the status is "InvertRadius" if MajorRadius < MinorRadius or
57 //! "NegativeRadius" if MinorRadius < 0.0
58 Standard_EXPORT gce_MakeElips2d(const gp_Ax2d& MajorAxis, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const Standard_Boolean Sense = Standard_True);
61 //! Axis defines the Xaxis and Yaxis of the ellipse which defines
62 //! the origin and the sense of parametrization.
63 //! Creates an ellipse with the AxisPlacement the major and the
64 //! minor radius. The location of Axis is the center
66 //! It is possible to create an ellipse with MajorRadius = MinorRadius.
67 //! the status is "InvertRadius" if MajorRadius < MinorRadius or
68 //! "NegativeRadius" if MinorRadius < 0.0
69 Standard_EXPORT gce_MakeElips2d(const gp_Ax22d& A, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
71 //! Makes an Elips2d with its center and two points.
72 //! The sense of parametrization is given by S1, S2,
74 //! Depending on the constructor, the implicit orientation of the ellipse is:
75 //! - the sense defined by A,
76 //! - the sense defined by points Center, S1 and S2,
77 //! - the trigonometric sense if Sense is not given or is true, or
78 //! - the opposite if Sense is false.
79 //! It is possible to construct an ellipse where the major
80 //! and minor radii are equal.
82 //! If an error occurs (that is, when IsDone returns
83 //! false), the Status function returns:
84 //! - gce_InvertRadius if MajorRadius is less than MinorRadius,
85 //! - gce_NegativeRadius if MajorRadius or
86 //! MinorRadius is less than 0.0,
87 //! - gce_NullAxis if points S1, S2 and Center are collinear, or
88 //! - gce_InvertAxis if the major radius computed with
89 //! Center and S1 is less than the minor radius
90 //! computed with Center, S1 and S2.
91 Standard_EXPORT gce_MakeElips2d(const gp_Pnt2d& S1, const gp_Pnt2d& S2, const gp_Pnt2d& Center);
93 //! Returns the constructed ellipse.
94 //! Exceptions StdFail_NotDone if no ellipse is constructed.
95 Standard_EXPORT const gp_Elips2d& Value() const;
97 Standard_EXPORT const gp_Elips2d& Operator() const;
98 Standard_EXPORT operator gp_Elips2d() const;
113 gp_Elips2d TheElips2d;
124 #endif // _gce_MakeElips2d_HeaderFile