0032832: Coding - get rid of unused headers [FairCurve to GeomAPI]
[occt.git] / src / Geom2dGcc / Geom2dGcc_Circ2dTanOnRadGeo.hxx
1 // Created on: 1991-04-03
2 // Created by: Remi GILET
3 // Copyright (c) 1991-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 _Geom2dGcc_Circ2dTanOnRadGeo_HeaderFile
18 #define _Geom2dGcc_Circ2dTanOnRadGeo_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22
23 #include <Standard_Integer.hxx>
24 #include <TColgp_Array1OfCirc2d.hxx>
25 #include <GccEnt_Array1OfPosition.hxx>
26 #include <TColStd_Array1OfInteger.hxx>
27 #include <TColgp_Array1OfPnt2d.hxx>
28 #include <TColStd_Array1OfReal.hxx>
29 #include <GccEnt_Position.hxx>
30 class Geom2dGcc_QCurve;
31 class gp_Lin2d;
32 class gp_Circ2d;
33 class GccEnt_QualifiedCirc;
34 class Geom2dAdaptor_Curve;
35 class GccEnt_QualifiedLin;
36 class gp_Pnt2d;
37
38
39 //! This class implements the algorithms used to
40 //! create a 2d circle tangent to a 2d entity,
41 //! centered on a 2d entity and with a given radius.
42 //! More than one argument must be a curve.
43 //! The arguments of all construction methods are :
44 //! - The qualified element for the tangency constrains
45 //! (QualifiedCirc, QualifiedLin, QualifiedCurvPoints).
46 //! - The Center element (circle, line, curve).
47 //! - A real Tolerance.
48 //! Tolerance is only used in the limits cases.
49 //! For example :
50 //! We want to create a circle tangent to an OutsideCurv Cu1
51 //! centered on a line OnLine with a radius Radius and with
52 //! a tolerance Tolerance.
53 //! If we did not use Tolerance it is impossible to
54 //! find a solution in the following case : OnLine is
55 //! outside Cu1. There is no intersection point between Cu1
56 //! and OnLine. The distance between the line and the
57 //! circle is greater than Radius.
58 //! With Tolerance we will give a solution if the
59 //! distance between Cu1 and OnLine is lower than or
60 //! equal Tolerance.
61 class Geom2dGcc_Circ2dTanOnRadGeo 
62 {
63 public:
64
65   DEFINE_STANDARD_ALLOC
66
67   
68   //! This methods implements the algorithms used to create
69   //! 2d Circles tangent to a curve and centered on a 2d Line
70   //! with a given radius.
71   //! Tolerance is used to find solution in every limit cases.
72   //! raises NegativeValue in case of NegativeRadius.
73   Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Qualified1, const gp_Lin2d& OnLine, const Standard_Real Radius, const Standard_Real Tolerance);
74   
75   //! This methods implements the algorithms used to create
76   //! 2d Circles tangent to a curve and centered on a 2d Circle
77   //! with a given radius.
78   //! Tolerance is used to find solution in every limit cases.
79   //! raises NegativeValue in case of NegativeRadius.
80   Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Qualified1, const gp_Circ2d& OnCirc, const Standard_Real Radius, const Standard_Real Tolerance);
81   
82   //! This methods implements the algorithms used to create
83   //! 2d Circles tangent to a circle and centered on a 2d curve
84   //! with a given radius.
85   //! Tolerance is used to find solution in every limit cases.
86   //! raises NegativeValue in case of NegativeRadius.
87   Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const GccEnt_QualifiedCirc& Qualified1, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Radius, const Standard_Real Tolerance);
88   
89   //! This methods implements the algorithms used to create
90   //! 2d Circles tangent to a 2d Line and centered on a 2d curve
91   //! with a given radius.
92   //! Tolerance is used to find solution in every limit cases.
93   //! raises NegativeValue in case of NegativeRadius.
94   Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const GccEnt_QualifiedLin& Qualified1, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Radius, const Standard_Real Tolerance);
95   
96   //! This methods implements the algorithms used to create
97   //! 2d Circles tangent to a 2d curve and centered on a 2d curve
98   //! with a given radius.
99   //! Tolerance is used to find solution in every limit cases.
100   //! raises NegativeValue in case of NegativeRadius.
101   Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Qualified1, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Radius, const Standard_Real Tolerance);
102   
103   //! This methods implements the algorithms used to create
104   //! 2d Circles passing through a 2d point and centered on a
105   //! 2d curve with a given radius.
106   //! Tolerance is used to find solution in every limit cases.
107   //! raises NegativeValue in case of NegativeRadius.
108   Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const gp_Pnt2d& Point1, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Radius, const Standard_Real Tolerance);
109   
110   //! This method returns True if the construction
111   //! algorithm succeeded.
112   Standard_EXPORT Standard_Boolean IsDone() const;
113   
114   //! This method returns the number of solutions.
115   //! It raises NotDone if the construction algorithm
116   //! didn't succeed.
117   Standard_EXPORT Standard_Integer NbSolutions() const;
118   
119   //! Returns the solution number Index and raises OutOfRange
120   //! exception if Index is greater than the number of solutions.
121   //! Be careful: the Index is only a way to get all the
122   //! solutions, but is not associated to these outside the
123   //! context of the algorithm-object.
124   //! It raises NotDone if the construction algorithm
125   //! didn't succeed.
126   //! It raises OutOfRange if Index is greater than the
127   //! number of solutions.
128   Standard_EXPORT gp_Circ2d ThisSolution (const Standard_Integer Index) const;
129   
130   Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1) const;
131   
132   //! Returns information about the tangency point between the
133   //! result number Index and the first argument.
134   //! ParSol is the intrinsic parameter of the point on the
135   //! solution curv.
136   //! ParArg is the intrinsic parameter of the point on the
137   //! argument curv.
138   //! PntSol is the tangency point on the solution curv.
139   //! PntArg is the tangency point on the argument curv.
140   //! It raises NotDone if the construction algorithm
141   //! didn't succeed.
142   //! It raises OutOfRange if Index is greater than the
143   //! number of solutions.
144   Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
145   
146   //! Returns information about the center (on the curv)
147   //! of the result.
148   //! ParArg is the intrinsic parameter of the point on
149   //! the argument curv.
150   //! PntSol is the center point of the solution curv.
151   //! It raises NotDone if the construction algorithm
152   //! didn't succeed.
153   //! It raises OutOfRange if Index is greater than the
154   //! number of solutions.
155   Standard_EXPORT void CenterOn3 (const Standard_Integer Index, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
156   
157   //! Returns True if the solution number Index is equal to
158   //! the first argument and False in the other cases.
159   //! It raises NotDone if the construction algorithm
160   //! didn't succeed.
161   //! It raises OutOfRange if Index is greater than the
162   //! number of solutions.
163   Standard_EXPORT Standard_Boolean IsTheSame1 (const Standard_Integer Index) const;
164
165
166
167
168 protected:
169
170
171
172
173
174 private:
175
176
177
178   Standard_Boolean WellDone;
179   Standard_Integer NbrSol;
180   TColgp_Array1OfCirc2d cirsol;
181   GccEnt_Array1OfPosition qualifier1;
182   TColStd_Array1OfInteger TheSame1;
183   TColgp_Array1OfPnt2d pnttg1sol;
184   TColgp_Array1OfPnt2d pntcen3;
185   TColStd_Array1OfReal par1sol;
186   TColStd_Array1OfReal pararg1;
187   TColStd_Array1OfReal parcen3;
188
189
190 };
191
192
193
194
195
196
197
198 #endif // _Geom2dGcc_Circ2dTanOnRadGeo_HeaderFile