42cf5bc1 |
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 |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _GC_MakeCircle_HeaderFile |
18 | #define _GC_MakeCircle_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <GC_Root.hxx> |
d1a67b9d |
25 | #include <Geom_Circle.hxx> |
26 | |
42cf5bc1 |
27 | class StdFail_NotDone; |
28 | class gp_Circ; |
29 | class gp_Ax2; |
30 | class gp_Pnt; |
31 | class gp_Dir; |
32 | class gp_Ax1; |
33 | |
34 | |
35 | //! This class implements the following algorithms used |
36 | //! to create Cirlec from Geom. |
37 | //! |
38 | //! * Create a Circle parallel to another and passing |
39 | //! though a point. |
40 | //! * Create a Circle parallel to another at the distance |
41 | //! Dist. |
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 |
53 | { |
54 | public: |
55 | |
56 | DEFINE_STANDARD_ALLOC |
57 | |
58 | |
59 | //! creates a circle from a non persistent circle C by its conversion. |
60 | Standard_EXPORT GC_MakeCircle(const gp_Circ& C); |
61 | |
62 | |
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); |
67 | |
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 |
72 | //! circle <Circ>. |
73 | Standard_EXPORT GC_MakeCircle(const gp_Circ& Circ, const Standard_Real Dist); |
74 | |
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); |
78 | |
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); |
82 | |
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); |
87 | |
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); |
92 | |
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); |
96 | |
97 | |
98 | //! Returns the constructed circle. |
99 | //! Exceptions |
100 | //! StdFail_NotDone if no circle is constructed. |
101 | Standard_EXPORT const Handle(Geom_Circle)& Value() const; |
42cf5bc1 |
102 | |
d1a67b9d |
103 | operator const Handle(Geom_Circle)& () const { return Value(); } |
42cf5bc1 |
104 | |
105 | private: |
42cf5bc1 |
106 | Handle(Geom_Circle) TheCircle; |
42cf5bc1 |
107 | }; |
108 | |
42cf5bc1 |
109 | #endif // _GC_MakeCircle_HeaderFile |