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 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 _GCE2d_MakeCircle_HeaderFile
18 #define _GCE2d_MakeCircle_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <GCE2d_Root.hxx>
25 #include <Geom2d_Circle.hxx>
33 //! This class implements the following algorithms used
34 //! to create Circle from Geom2d.
36 //! * Create a Circle parallel to another and passing
38 //! * Create a Circle parallel to another at the distance
40 //! * Create a Circle passing through 3 points.
41 //! * Create a Circle with its center and the normal of its
42 //! plane and its radius.
43 //! * Create a Circle with its axis and radius.
44 class GCE2d_MakeCircle : public GCE2d_Root
51 //! creates a circle from a non persistent one.
52 Standard_EXPORT GCE2d_MakeCircle(const gp_Circ2d& C);
55 //! A is the "XAxis" of the circle which defines the origin
56 //! of parametrization.
57 //! It is not forbidden to create a circle with Radius = 0.0
58 //! The status is "NegativeRadius" if Radius < 0.
59 Standard_EXPORT GCE2d_MakeCircle(const gp_Ax2d& A, const Standard_Real Radius, const Standard_Boolean Sense = Standard_True);
62 //! A is the local coordinate system of the circle which defines
63 //! the origin of parametrization.
64 //! It is not forbidden to create a circle with Radius = 0.0
65 //! The status is "NegativeRadius" if Radius < 0.
66 Standard_EXPORT GCE2d_MakeCircle(const gp_Ax22d& A, const Standard_Real Radius);
68 //! Make a Circle from Geom2d <TheCirc> parallel to another
69 //! Circ <Circ> with a distance <Dist>.
70 //! If Dist is greater than zero the result is enclosing
71 //! the circle <Circ>, else the result is enclosed by the
73 Standard_EXPORT GCE2d_MakeCircle(const gp_Circ2d& Circ, const Standard_Real Dist);
75 //! Make a Circle from Geom2d <TheCirc> parallel to another
76 //! Circ <Circ> and passing through a Pnt <Point>.
77 Standard_EXPORT GCE2d_MakeCircle(const gp_Circ2d& Circ, const gp_Pnt2d& Point);
79 //! Make a Circ from gp <TheCirc> passing through 3
80 //! Pnt2d <P1>,<P2>,<P3>.
81 Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& P1, const gp_Pnt2d& P2, const gp_Pnt2d& P3);
83 //! Make a Circ from geom2d <TheCirc> by its center an radius.
84 Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& P, const Standard_Real Radius, const Standard_Boolean Sense = Standard_True);
86 //! Makes a Circle from geom2d <TheCirc> with its center
87 //! <Center> and a point giving the radius.
88 //! If Sense is true the local coordinate system of
89 //! the solution is direct and non direct in the other case.
91 //! The MakeCircle class does not prevent the
92 //! construction of a circle with a null radius.
93 //! If an error occurs (that is, when IsDone returns
94 //! false), the Status function returns:
95 //! - gce_NegativeRadius if Radius is less than 0.0, or
96 //! - gce_IntersectionError if points P1, P2 and P3
97 //! are collinear and the three are not coincident.
98 Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& Center, const gp_Pnt2d& Point, const Standard_Boolean Sense = Standard_True);
100 //! Returns the constructed circle.
101 //! Exceptions StdFail_NotDone if no circle is constructed.
102 Standard_EXPORT const Handle(Geom2d_Circle)& Value() const;
104 operator const Handle(Geom2d_Circle)& () const { return Value(); }
107 Handle(Geom2d_Circle) TheCircle;
110 #endif // _GCE2d_MakeCircle_HeaderFile