0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / GCE2d / GCE2d_MakeCircle.hxx
CommitLineData
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 _GCE2d_MakeCircle_HeaderFile
18#define _GCE2d_MakeCircle_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <GCE2d_Root.hxx>
25#include <Standard_Real.hxx>
26#include <Standard_Boolean.hxx>
27class Geom2d_Circle;
28class StdFail_NotDone;
29class gp_Circ2d;
30class gp_Ax2d;
31class gp_Ax22d;
32class gp_Pnt2d;
33
34
35//! This class implements the following algorithms used
36//! to create Circle from Geom2d.
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.
46class GCE2d_MakeCircle : public GCE2d_Root
47{
48public:
49
50 DEFINE_STANDARD_ALLOC
51
52
53 //! creates a circle from a non persistent one.
54 Standard_EXPORT GCE2d_MakeCircle(const gp_Circ2d& C);
55
56
57 //! A is the "XAxis" of the circle which defines the origin
58 //! of parametrization.
59 //! It is not forbidden to create a circle with Radius = 0.0
60 //! The status is "NegativeRadius" if Radius < 0.
61 Standard_EXPORT GCE2d_MakeCircle(const gp_Ax2d& A, const Standard_Real Radius, const Standard_Boolean Sense = Standard_True);
62
63
64 //! A is the local coordinate system of the circle which defines
65 //! the origin of parametrization.
66 //! It is not forbidden to create a circle with Radius = 0.0
67 //! The status is "NegativeRadius" if Radius < 0.
68 Standard_EXPORT GCE2d_MakeCircle(const gp_Ax22d& A, const Standard_Real Radius);
69
70 //! Make a Circle from Geom2d <TheCirc> parallel to another
71 //! Circ <Circ> with a distance <Dist>.
72 //! If Dist is greater than zero the result is enclosing
73 //! the circle <Circ>, else the result is enclosed by the
74 //! circle <Circ>.
75 Standard_EXPORT GCE2d_MakeCircle(const gp_Circ2d& Circ, const Standard_Real Dist);
76
77 //! Make a Circle from Geom2d <TheCirc> parallel to another
78 //! Circ <Circ> and passing through a Pnt <Point>.
79 Standard_EXPORT GCE2d_MakeCircle(const gp_Circ2d& Circ, const gp_Pnt2d& Point);
80
81 //! Make a Circ from gp <TheCirc> passing through 3
82 //! Pnt2d <P1>,<P2>,<P3>.
83 Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& P1, const gp_Pnt2d& P2, const gp_Pnt2d& P3);
84
85 //! Make a Circ from geom2d <TheCirc> by its center an radius.
86 Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& P, const Standard_Real Radius, const Standard_Boolean Sense = Standard_True);
87
88 //! Makes a Circle from geom2d <TheCirc> with its center
89 //! <Center> and a point giving the radius.
90 //! If Sense is true the local coordinate system of
91 //! the solution is direct and non direct in the other case.
92 //! Warning
93 //! The MakeCircle class does not prevent the
94 //! construction of a circle with a null radius.
95 //! If an error occurs (that is, when IsDone returns
96 //! false), the Status function returns:
97 //! - gce_NegativeRadius if Radius is less than 0.0, or
98 //! - gce_IntersectionError if points P1, P2 and P3
99 //! are collinear and the three are not coincident.
100 Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& Center, const gp_Pnt2d& Point, const Standard_Boolean Sense = Standard_True);
101
102 //! Returns the constructed circle.
103 //! Exceptions StdFail_NotDone if no circle is constructed.
104 Standard_EXPORT const Handle(Geom2d_Circle)& Value() const;
105operator const Handle(Geom2d_Circle)& () const { return Value(); }
106
107
108
109
110protected:
111
112
113
114
115
116private:
117
118
119
120 Handle(Geom2d_Circle) TheCircle;
121
122
123};
124
125
126
127
128
129
130
131#endif // _GCE2d_MakeCircle_HeaderFile