1 // Created on: 1991-03-29
2 // Created by: Remi GILET
3 // Copyright (c) 1991-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 _Geom2dGcc_Circ2d2TanRadGeo_HeaderFile
18 #define _Geom2dGcc_Circ2d2TanRadGeo_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
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 GccEnt_QualifiedCirc;
34 class Geom2dGcc_QCurve;
35 class GccEnt_QualifiedLin;
40 //! This class implements the algorithms used to
41 //! create 2d circles tangent to one curve and a
42 //! point/line/circle/curv and with a given radius.
43 //! For each construction methods arguments are:
44 //! - Two Qualified elements for tangency constrains.
45 //! (for example EnclosedCirc if we want the
46 //! solution inside the argument EnclosedCirc).
47 //! - Two Reals. One (Radius) for the radius and the
48 //! other (Tolerance) for the tolerance.
49 //! Tolerance is only used for the limit cases.
51 //! We want to create a circle inside a circle C1 and
52 //! inside a curve Cu2 with a radius Radius and a
53 //! tolerance Tolerance.
54 //! If we did not used Tolerance it is impossible to
55 //! find a solution in the following case : Cu2 is
56 //! inside C1 and there is no intersection point
57 //! between the two elements.
58 //! With Tolerance we will get a solution if the
59 //! lowest distance between C1 and Cu2 is lower than or
61 class Geom2dGcc_Circ2d2TanRadGeo
68 //! This method implements the algorithms used to
69 //! create 2d circles TANgent to a 2d circle and a curve
70 //! with a radius of Radius.
71 //! It raises NegativeValue if Radius is lower than zero.
72 Standard_EXPORT Geom2dGcc_Circ2d2TanRadGeo(const GccEnt_QualifiedCirc& Qualified1, const Geom2dGcc_QCurve& Qualified2, const Standard_Real Radius, const Standard_Real Tolerance);
74 //! This method implements the algorithms used to
75 //! create 2d circles TANgent to a 2d line and a curve
76 //! with a radius of Radius.
77 //! It raises NegativeValue if Radius is lower than zero.
78 Standard_EXPORT Geom2dGcc_Circ2d2TanRadGeo(const GccEnt_QualifiedLin& Qualified1, const Geom2dGcc_QCurve& Qualified2, const Standard_Real Radius, const Standard_Real Tolerance);
80 //! This method implements the algorithms used to
81 //! create 2d circles TANgent to two curves with
82 //! a radius of Radius.
83 //! It raises NegativeValue if Radius is lower than zero.
84 Standard_EXPORT Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Qualified1, const Geom2dGcc_QCurve& Qualified2, const Standard_Real Radius, const Standard_Real Tolerance);
86 //! This method implements the algorithms used to
87 //! create 2d circles TANgent to a curve and a point
88 //! with a radius of Radius.
89 //! It raises NegativeValue if Radius is lower than zero.
90 Standard_EXPORT Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Qualified1, const gp_Pnt2d& Point2, const Standard_Real Radius, const Standard_Real Tolerance);
92 //! This method returns True if the algorithm succeeded.
93 Standard_EXPORT Standard_Boolean IsDone() const;
95 //! This method returns the number of solutions.
96 //! It raises NotDone if the algorithm failed.
97 Standard_EXPORT Standard_Integer NbSolutions() const;
99 //! Returns the solution number Index.
100 //! Be careful: the Index is only a way to get all the
101 //! solutions, but is not associated to those outside the context
102 //! of the algorithm-object.
103 //! It raises OutOfRange exception if Index is greater
104 //! than the number of solutions.
105 //! It raises NotDone if the construction algorithm did not
107 Standard_EXPORT gp_Circ2d ThisSolution (const Standard_Integer Index) const;
109 //! It returns the information about the qualifiers of
110 //! the tangency arguments concerning the solution number Index.
111 //! It returns the real qualifiers (the qualifiers given to the
112 //! constructor method in case of enclosed, enclosing and outside
113 //! and the qualifiers computedin case of unqualified).
114 Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1, GccEnt_Position& Qualif2) const;
116 //! Returns information about the tangency point between the
117 //! result number Index and the first argument.
118 //! ParSol is the intrinsic parameter of the point PntSol on the solution.
119 //! ParArg is the intrinsic parameter of the point PntSol on the first
121 //! It raises OutOfRange if Index is greater than the number
123 //! It raises NotDone if the construction algorithm did not
125 Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
127 //! Returns information about the tangency point between the
128 //! result number Index and the second argument.
129 //! ParSol is the intrinsic parameter of the point PntSol on
131 //! ParArg is the intrinsic parameter of the point PntArg on
132 //! the second argument.
133 //! It raises OutOfRange if Index is greater than the number
135 //! It raises NotDone if the construction algorithm did not
137 Standard_EXPORT void Tangency2 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
139 //! Returns True if the solution number Index is equal to
140 //! the first argument.
141 //! It raises OutOfRange if Index is greater than the number
143 //! It raises NotDone if the construction algorithm did not
145 Standard_EXPORT Standard_Boolean IsTheSame1 (const Standard_Integer Index) const;
147 //! Returns True if the solution number Index is equal to
148 //! the second argument.
149 //! It raises OutOfRange if Index is greater than the number
151 //! It raises NotDone if the construction algorithm did not
153 Standard_EXPORT Standard_Boolean IsTheSame2 (const Standard_Integer Index) const;
168 Standard_Boolean WellDone;
169 Standard_Integer NbrSol;
170 TColgp_Array1OfCirc2d cirsol;
171 GccEnt_Array1OfPosition qualifier1;
172 GccEnt_Array1OfPosition qualifier2;
173 TColStd_Array1OfInteger TheSame1;
174 TColStd_Array1OfInteger TheSame2;
175 TColgp_Array1OfPnt2d pnttg1sol;
176 TColgp_Array1OfPnt2d pnttg2sol;
177 TColStd_Array1OfReal par1sol;
178 TColStd_Array1OfReal par2sol;
179 TColStd_Array1OfReal pararg1;
180 TColStd_Array1OfReal pararg2;
191 #endif // _Geom2dGcc_Circ2d2TanRadGeo_HeaderFile