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_MakeCirc_HeaderFile
18 #define _gce_MakeCirc_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <gp_Circ.hxx>
25 #include <gce_Root.hxx>
26 #include <Standard_Real.hxx>
34 //! This class implements the following algorithms used
35 //! to create Circ from gp.
37 //! * Create a Circ coaxial to another and passing
39 //! * Create a Circ coaxial to another at the distance
41 //! * Create a Circ passing through 3 points.
42 //! * Create a Circ with its center and the normal of its
43 //! plane and its radius.
44 //! * Create a Circ with its center and its plane and its
46 //! * Create a Circ with its axis and radius.
47 //! * Create a Circ with two points giving its axis and
49 //! * Create a Circ with is Ax2 and its Radius.
50 class gce_MakeCirc : public gce_Root
58 //! A2 locates the circle and gives its orientation in 3D space.
60 //! It is not forbidden to create a circle with Radius = 0.0
61 //! The status is "NegativeRadius" if Radius < 0.0
62 Standard_EXPORT gce_MakeCirc(const gp_Ax2& A2, const Standard_Real Radius);
64 //! Makes a Circ from gp <TheCirc> coaxial to another
65 //! Circ <Circ> at a distance <Dist>.
66 //! If Dist is greater than zero the result is encloses
67 //! the circle <Circ>, else the result is enclosed by the
69 Standard_EXPORT gce_MakeCirc(const gp_Circ& Circ, const Standard_Real Dist);
71 //! Makes a Circ from gp <TheCirc> coaxial to another
72 //! Circ <Circ> and passing through a Pnt2d <Point>.
73 Standard_EXPORT gce_MakeCirc(const gp_Circ& Circ, const gp_Pnt& Point);
75 //! Makes a Circ from gp <TheCirc> passing through 3
76 //! Pnt2d <P1>,<P2>,<P3>.
77 Standard_EXPORT gce_MakeCirc(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
79 //! Makes a Circ from gp <TheCirc> with its center
80 //! <Center> and the normal of its plane <Norm> and
81 //! its radius <Radius>.
82 Standard_EXPORT gce_MakeCirc(const gp_Pnt& Center, const gp_Dir& Norm, const Standard_Real Radius);
84 //! Makes a Circ from gp <TheCirc> with its center
85 //! <Center> and the normal of its plane <Plane> and
86 //! its radius <Radius>.
87 Standard_EXPORT gce_MakeCirc(const gp_Pnt& Center, const gp_Pln& Plane, const Standard_Real Radius);
89 //! Makes a Circ from gp <TheCirc> with its center
90 //! <Center> and a point <Ptaxis> giving the normal
91 //! of its plane <Plane> and its radius <Radius>.
92 Standard_EXPORT gce_MakeCirc(const gp_Pnt& Center, const gp_Pnt& Ptaxis, const Standard_Real Radius);
94 //! Makes a Circ from gp <TheCirc> with its center
95 //! <Center> and its radius <Radius>.
97 //! The MakeCirc class does not prevent the
98 //! construction of a circle with a null radius.
99 //! If an error occurs (that is, when IsDone returns
100 //! false), the Status function returns:
101 //! - gce_Negative Radius if:
102 //! - Radius is less than 0.0, or
103 //! - Dist is less than 0.0 and the absolute value of
104 //! Dist is greater than the radius of Circ;
105 //! - gce_IntersectionError if the points P1, P2 and
106 //! P3 are collinear, and the three are not coincident;
107 //! - gce_ConfusedPoints if two of the three points
108 //! P1, P2 and P3 are coincident; or
109 //! - gce_NullAxis if Center and Ptaxis are coincident.
110 Standard_EXPORT gce_MakeCirc(const gp_Ax1& Axis, const Standard_Real Radius);
112 //! Returns the constructed circle.
113 //! Exceptions StdFail_NotDone if no circle is constructed.
114 Standard_EXPORT const gp_Circ& Value() const;
116 Standard_EXPORT const gp_Circ& Operator() const;
117 Standard_EXPORT operator gp_Circ() const;
143 #endif // _gce_MakeCirc_HeaderFile