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_MakeParab2d_HeaderFile
18 #define _gce_MakeParab2d_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <gp_Parab2d.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 Parab2d from gp.
37 //! Defines an infinite parabola.
38 //! An axis placement one axis defines the local cartesian
39 //! coordinate system ("XAxis") of the parabola.
40 //! The vertex of the parabola is the "Location" point of the
41 //! local coordinate system of the parabola.
42 //! The "XAxis" of the parabola is its axis of symmetry.
43 //! The "XAxis" is oriented from the vertex of the parabola to the
44 //! Focus of the parabola.
45 //! The "YAxis" is parallel to the directrix of the parabola and
46 //! its "Location" point is the vertex of the parabola.
47 //! The equation of the parabola in the local coordinate system is
49 //! P is the distance between the focus and the directrix of the
50 //! parabola called Parameter).
51 //! The focal length F = P/2 is the distance between the vertex
52 //! and the focus of the parabola.
54 //! * Create a Parab2d from one apex and the center.
55 //! * Create a Parab2d with the directrix and the focus point.
56 //! * Create a Parab2d with its vertex point and its axis
57 //! of symetry and its focus length.
58 class gce_MakeParab2d : public gce_Root
66 //! Creates a parabola with its axis of symmetry ("MirrorAxis")
67 //! and its focal length.
68 //! Warnings : It is possible to have Focal = 0.
69 //! The status is "NullFocalLength" Raised if Focal < 0.0
70 Standard_EXPORT gce_MakeParab2d(const gp_Ax2d& MirrorAxis, const Standard_Real Focal, const Standard_Boolean Sense = Standard_True);
73 //! Creates a parabola with its local coordinate system <A>
74 //! and its focal length.
75 //! Warnings : It is possible to have Focal = 0.
76 //! The status is "NullFocalLength" Raised if Focal < 0.0
77 Standard_EXPORT gce_MakeParab2d(const gp_Ax22d& A, const Standard_Real Focal);
80 //! Creates a parabola with the directrix and the focus point.
81 //! The sense of parametrization is given by Sense.
82 Standard_EXPORT gce_MakeParab2d(const gp_Ax2d& D, const gp_Pnt2d& F, const Standard_Boolean Sense = Standard_True);
85 //! Creates a parabola with the local coordinate system and
87 //! The sense of parametrization is given by Sense.
88 Standard_EXPORT gce_MakeParab2d(const gp_Ax22d& D, const gp_Pnt2d& F);
90 //! Make an Parab2d with S1 as the Focal point and Center
91 //! as the apex of the parabola
93 //! The MakeParab2d class does not prevent the
94 //! construction of a parabola with a null focal distance.
95 //! If an error occurs (that is, when IsDone returns
96 //! false), the Status function returns:
97 //! - gce_NullFocusLength if Focal is less than 0.0, or
98 //! - gce_NullAxis if S1 and Center are coincident.
99 Standard_EXPORT gce_MakeParab2d(const gp_Pnt2d& S1, const gp_Pnt2d& Center, const Standard_Boolean Sense = Standard_True);
101 //! Returns the constructed parabola.
102 //! Exceptions StdFail_NotDone if no parabola is constructed.
103 Standard_EXPORT const gp_Parab2d& Value() const;
105 Standard_EXPORT const gp_Parab2d& Operator() const;
106 Standard_EXPORT operator gp_Parab2d() const;
121 gp_Parab2d TheParab2d;
132 #endif // _gce_MakeParab2d_HeaderFile