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