42cf5bc1 |
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 |
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_Circ2d2TanRadGeo_HeaderFile |
18 | #define _Geom2dGcc_Circ2d2TanRadGeo_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_OutOfRange; |
34 | class GccEnt_BadQualifier; |
35 | class StdFail_NotDone; |
36 | class Standard_NegativeValue; |
37 | class GccEnt_QualifiedCirc; |
38 | class Geom2dGcc_QCurve; |
39 | class GccEnt_QualifiedLin; |
40 | class gp_Pnt2d; |
41 | class gp_Circ2d; |
42 | |
43 | |
44 | //! This class implements the algorithms used to |
45 | //! create 2d circles tangent to one curve and a |
46 | //! point/line/circle/curv and with a given radius. |
47 | //! For each construction methods arguments are: |
48 | //! - Two Qualified elements for tangency constrains. |
49 | //! (for example EnclosedCirc if we want the |
50 | //! solution inside the argument EnclosedCirc). |
51 | //! - Two Reals. One (Radius) for the radius and the |
52 | //! other (Tolerance) for the tolerance. |
53 | //! Tolerance is only used for the limit cases. |
54 | //! For example : |
55 | //! We want to create a circle inside a circle C1 and |
56 | //! inside a curve Cu2 with a radius Radius and a |
57 | //! tolerance Tolerance. |
58 | //! If we did not used Tolerance it is impossible to |
59 | //! find a solution in the following case : Cu2 is |
60 | //! inside C1 and there is no intersection point |
61 | //! between the two elements. |
62 | //! With Tolerance we will get a solution if the |
63 | //! lowest distance between C1 and Cu2 is lower than or |
64 | //! equal Tolerance. |
65 | class Geom2dGcc_Circ2d2TanRadGeo |
66 | { |
67 | public: |
68 | |
69 | DEFINE_STANDARD_ALLOC |
70 | |
71 | |
72 | //! This method implements the algorithms used to |
73 | //! create 2d circles TANgent to a 2d circle and a curve |
74 | //! with a radius of Radius. |
75 | //! It raises NegativeValue if Radius is lower than zero. |
76 | Standard_EXPORT Geom2dGcc_Circ2d2TanRadGeo(const GccEnt_QualifiedCirc& Qualified1, const Geom2dGcc_QCurve& Qualified2, const Standard_Real Radius, const Standard_Real Tolerance); |
77 | |
78 | //! This method implements the algorithms used to |
79 | //! create 2d circles TANgent to a 2d line and a curve |
80 | //! with a radius of Radius. |
81 | //! It raises NegativeValue if Radius is lower than zero. |
82 | Standard_EXPORT Geom2dGcc_Circ2d2TanRadGeo(const GccEnt_QualifiedLin& Qualified1, const Geom2dGcc_QCurve& Qualified2, const Standard_Real Radius, const Standard_Real Tolerance); |
83 | |
84 | //! This method implements the algorithms used to |
85 | //! create 2d circles TANgent to two curves with |
86 | //! a radius of Radius. |
87 | //! It raises NegativeValue if Radius is lower than zero. |
88 | Standard_EXPORT Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Qualified1, const Geom2dGcc_QCurve& Qualified2, const Standard_Real Radius, const Standard_Real Tolerance); |
89 | |
90 | //! This method implements the algorithms used to |
91 | //! create 2d circles TANgent to a curve and a point |
92 | //! with a radius of Radius. |
93 | //! It raises NegativeValue if Radius is lower than zero. |
94 | Standard_EXPORT Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Qualified1, const gp_Pnt2d& Point2, const Standard_Real Radius, const Standard_Real Tolerance); |
95 | |
96 | //! This method returns True if the algorithm succeeded. |
97 | Standard_EXPORT Standard_Boolean IsDone() const; |
98 | |
99 | //! This method returns the number of solutions. |
100 | //! It raises NotDone if the algorithm failed. |
101 | Standard_EXPORT Standard_Integer NbSolutions() const; |
102 | |
103 | //! Returns the solution number Index. |
104 | //! Be careful: the Index is only a way to get all the |
105 | //! solutions, but is not associated to those outside the context |
106 | //! of the algorithm-object. |
107 | //! It raises OutOfRange exception if Index is greater |
108 | //! than the number of solutions. |
109 | //! It raises NotDone if the construction algorithm did not |
110 | //! succeed. |
111 | Standard_EXPORT gp_Circ2d ThisSolution (const Standard_Integer Index) const; |
112 | |
113 | //! It returns the information about the qualifiers of |
114 | //! the tangency arguments concerning the solution number Index. |
115 | //! It returns the real qualifiers (the qualifiers given to the |
116 | //! constructor method in case of enclosed, enclosing and outside |
117 | //! and the qualifiers computedin case of unqualified). |
118 | Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1, GccEnt_Position& Qualif2) const; |
119 | |
120 | //! Returns information about the tangency point between the |
121 | //! result number Index and the first argument. |
122 | //! ParSol is the intrinsic parameter of the point PntSol on the solution. |
123 | //! ParArg is the intrinsic parameter of the point PntSol on the first |
124 | //! argument. |
125 | //! It raises OutOfRange if Index is greater than the number |
126 | //! of solutions. |
127 | //! It raises NotDone if the construction algorithm did not |
128 | //! succeed. |
129 | Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const; |
130 | |
131 | //! Returns information about the tangency point between the |
132 | //! result number Index and the second argument. |
133 | //! ParSol is the intrinsic parameter of the point PntSol on |
134 | //! the solution. |
135 | //! ParArg is the intrinsic parameter of the point PntArg on |
136 | //! the second argument. |
137 | //! It raises OutOfRange if Index is greater than the number |
138 | //! of solutions. |
139 | //! It raises NotDone if the construction algorithm did not |
140 | //! succeed. |
141 | Standard_EXPORT void Tangency2 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const; |
142 | |
143 | //! Returns True if the solution number Index is equal to |
144 | //! the first argument. |
145 | //! It raises OutOfRange if Index is greater than the number |
146 | //! of solutions. |
147 | //! It raises NotDone if the construction algorithm did not |
148 | //! succeed. |
149 | Standard_EXPORT Standard_Boolean IsTheSame1 (const Standard_Integer Index) const; |
150 | |
151 | //! Returns True if the solution number Index is equal to |
152 | //! the second argument. |
153 | //! It raises OutOfRange if Index is greater than the number |
154 | //! of solutions. |
155 | //! It raises NotDone if the construction algorithm did not |
156 | //! succeed. |
157 | Standard_EXPORT Standard_Boolean IsTheSame2 (const Standard_Integer Index) const; |
158 | |
159 | |
160 | |
161 | |
162 | protected: |
163 | |
164 | |
165 | |
166 | |
167 | |
168 | private: |
169 | |
170 | |
171 | |
172 | Standard_Boolean WellDone; |
173 | Standard_Integer NbrSol; |
174 | TColgp_Array1OfCirc2d cirsol; |
175 | GccEnt_Array1OfPosition qualifier1; |
176 | GccEnt_Array1OfPosition qualifier2; |
177 | TColStd_Array1OfInteger TheSame1; |
178 | TColStd_Array1OfInteger TheSame2; |
179 | TColgp_Array1OfPnt2d pnttg1sol; |
180 | TColgp_Array1OfPnt2d pnttg2sol; |
181 | TColStd_Array1OfReal par1sol; |
182 | TColStd_Array1OfReal par2sol; |
183 | TColStd_Array1OfReal pararg1; |
184 | TColStd_Array1OfReal pararg2; |
185 | |
186 | |
187 | }; |
188 | |
189 | |
190 | |
191 | |
192 | |
193 | |
194 | |
195 | #endif // _Geom2dGcc_Circ2d2TanRadGeo_HeaderFile |