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>
27 class StdFail_NotDone;
36 //! This class implements the following algorithms used
37 //! to create Circ from gp.
39 //! * Create a Circ coaxial to another and passing
41 //! * Create a Circ coaxial to another at the distance
43 //! * Create a Circ passing through 3 points.
44 //! * Create a Circ with its center and the normal of its
45 //! plane and its radius.
46 //! * Create a Circ with its center and its plane and its
48 //! * Create a Circ with its axis and radius.
49 //! * Create a Circ with two points giving its axis and
51 //! * Create a Circ with is Ax2 and its Radius.
52 class gce_MakeCirc : public gce_Root
60 //! A2 locates the circle and gives its orientation in 3D space.
62 //! It is not forbidden to create a circle with Radius = 0.0
63 //! The status is "NegativeRadius" if Radius < 0.0
64 Standard_EXPORT gce_MakeCirc(const gp_Ax2& A2, const Standard_Real Radius);
66 //! Makes a Circ from gp <TheCirc> coaxial to another
67 //! Circ <Circ> at a distance <Dist>.
68 //! If Dist is greater than zero the result is encloses
69 //! the circle <Circ>, else the result is enclosed by the
71 Standard_EXPORT gce_MakeCirc(const gp_Circ& Circ, const Standard_Real Dist);
73 //! Makes a Circ from gp <TheCirc> coaxial to another
74 //! Circ <Circ> and passing through a Pnt2d <Point>.
75 Standard_EXPORT gce_MakeCirc(const gp_Circ& Circ, const gp_Pnt& Point);
77 //! Makes a Circ from gp <TheCirc> passing through 3
78 //! Pnt2d <P1>,<P2>,<P3>.
79 Standard_EXPORT gce_MakeCirc(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
81 //! Makes a Circ from gp <TheCirc> with its center
82 //! <Center> and the normal of its plane <Norm> and
83 //! its radius <Radius>.
84 Standard_EXPORT gce_MakeCirc(const gp_Pnt& Center, const gp_Dir& Norm, const Standard_Real Radius);
86 //! Makes a Circ from gp <TheCirc> with its center
87 //! <Center> and the normal of its plane <Plane> and
88 //! its radius <Radius>.
89 Standard_EXPORT gce_MakeCirc(const gp_Pnt& Center, const gp_Pln& Plane, const Standard_Real Radius);
91 //! Makes a Circ from gp <TheCirc> with its center
92 //! <Center> and a point <Ptaxis> giving the normal
93 //! of its plane <Plane> and its radius <Radius>.
94 Standard_EXPORT gce_MakeCirc(const gp_Pnt& Center, const gp_Pnt& Ptaxis, const Standard_Real Radius);
96 //! Makes a Circ from gp <TheCirc> with its center
97 //! <Center> and its radius <Radius>.
99 //! The MakeCirc class does not prevent the
100 //! construction of a circle with a null radius.
101 //! If an error occurs (that is, when IsDone returns
102 //! false), the Status function returns:
103 //! - gce_Negative Radius if:
104 //! - Radius is less than 0.0, or
105 //! - Dist is less than 0.0 and the absolute value of
106 //! Dist is greater than the radius of Circ;
107 //! - gce_IntersectionError if the points P1, P2 and
108 //! P3 are collinear, and the three are not coincident;
109 //! - gce_ConfusedPoints if two of the three points
110 //! P1, P2 and P3 are coincident; or
111 //! - gce_NullAxis if Center and Ptaxis are coincident.
112 Standard_EXPORT gce_MakeCirc(const gp_Ax1& Axis, const Standard_Real Radius);
114 //! Returns the constructed circle.
115 //! Exceptions StdFail_NotDone if no circle is constructed.
116 Standard_EXPORT const gp_Circ& Value() const;
118 Standard_EXPORT const gp_Circ& Operator() const;
119 Standard_EXPORT operator gp_Circ() const;
145 #endif // _gce_MakeCirc_HeaderFile