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 _GC_MakeCircle_HeaderFile
18 #define _GC_MakeCircle_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <GC_Root.hxx>
25 #include <Geom_Circle.hxx>
27 class StdFail_NotDone;
35 //! This class implements the following algorithms used
36 //! to create Cirlec from Geom.
38 //! * Create a Circle parallel to another and passing
40 //! * Create a Circle parallel to another at the distance
42 //! * Create a Circle passing through 3 points.
43 //! * Create a Circle with its center and the normal of its
44 //! plane and its radius.
45 //! * Create a Circle with its axis and radius.
46 //! The circle's parameter is the angle (Radian).
47 //! The parametrization range is [0,2*PI].
48 //! The circle is a closed and periodic curve.
49 //! The center of the circle is the Location point of its axis
50 //! placement. The XDirection of the axis placement defines the
51 //! origin of the parametrization.
52 class GC_MakeCircle : public GC_Root
59 //! creates a circle from a non persistent circle C by its conversion.
60 Standard_EXPORT GC_MakeCircle(const gp_Circ& C);
63 //! A2 is the local coordinates system of the circle.
64 //! It is not forbidden to create a circle with Radius = 0.0
65 //! Status is "NegativeRadius" if Radius < 0.
66 Standard_EXPORT GC_MakeCircle(const gp_Ax2& A2, const Standard_Real Radius);
68 //! Make a Circle from Geom <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 GC_MakeCircle(const gp_Circ& Circ, const Standard_Real Dist);
75 //! Make a Circle from Geom <TheCirc> parallel to another
76 //! Circ <Circ> and passing through a Pnt <Point>.
77 Standard_EXPORT GC_MakeCircle(const gp_Circ& Circ, const gp_Pnt& Point);
79 //! Make a Circ from gp <TheCirc> passing through 3
80 //! Pnt2d <P1>,<P2>,<P3>.
81 Standard_EXPORT GC_MakeCircle(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
83 //! Make a Circle from Geom <TheCirc> with its center
84 //! <Center> and the normal of its plane <Norm> and
85 //! its radius <Radius>.
86 Standard_EXPORT GC_MakeCircle(const gp_Pnt& Center, const gp_Dir& Norm, const Standard_Real Radius);
88 //! Make a Circle from Geom <TheCirc> with its center
89 //! <Center> and the normal of its plane defined by the
90 //! two points <Center> and <PtAxis> and its radius <Radius>.
91 Standard_EXPORT GC_MakeCircle(const gp_Pnt& Center, const gp_Pnt& PtAxis, const Standard_Real Radius);
93 //! Make a Circle from Geom <TheCirc> with its center
94 //! <Center> and its radius <Radius>.
95 Standard_EXPORT GC_MakeCircle(const gp_Ax1& Axis, const Standard_Real Radius);
98 //! Returns the constructed circle.
100 //! StdFail_NotDone if no circle is constructed.
101 Standard_EXPORT const Handle(Geom_Circle)& Value() const;
103 operator const Handle(Geom_Circle)& () const { return Value(); }
106 Handle(Geom_Circle) TheCircle;
109 #endif // _GC_MakeCircle_HeaderFile