1 -- Created on: 1992-10-20
2 -- Created by: Remi GILET
3 -- Copyright (c) 1992-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 class Circ2d2TanOn from Geom2dGcc
19 ---Purpose: This class implements the algorithms used to
20 -- create 2d circles TANgent to 2 entities and
21 -- having the center ON a curve.
22 -- The order of the tangency argument is always
23 -- QualifiedCirc, QualifiedLin, QualifiedCurv, Pnt2d.
24 -- the arguments are :
25 -- - The two tangency arguments.
27 -- - The parameter for each tangency argument which
31 -- inherits Entity from Standard
33 uses Curve from Geom2dAdaptor,
34 QualifiedCurve from Geom2dGcc,
35 Integer from Standard,
36 Boolean from Standard,
37 Array1OfInteger from TColStd,
38 Array1OfReal from TColStd,
39 Array1OfPnt2d from TColgp,
40 Array1OfCirc2d from TColgp,
44 Circ2d2TanOn from GccAna,
45 Circ2d2TanOnGeo from Geom2dGcc,
46 Circ2d2TanOnIter from Geom2dGcc,
48 Array1OfPosition from GccEnt
50 raises NotDone from StdFail,
51 BadQualifier from GccEnt,
52 OutOfRange from Standard
56 Create(Qualified1 : QualifiedCurve from Geom2dGcc ;
57 Qualified2 : QualifiedCurve from Geom2dGcc ;
58 OnCurve : Curve from Geom2dAdaptor ;
59 Tolerance : Real from Standard ;
60 Param1 : Real from Standard ;
61 Param2 : Real from Standard ;
62 ParamOn : Real from Standard )
63 returns Circ2d2TanOn from Geom2dGcc ;
64 ---Purpose: This method implements the algorithms used to
65 -- create 2d circles TANgent to two curves and
66 -- having the center ON a 2d curve.
67 -- Param1 is the initial guess on the first curve QualifiedCurv.
68 -- Param1 is the initial guess on the second curve QualifiedCurv.
69 -- ParamOn is the initial guess on the center curve OnCurv.
70 -- Tolerance is used for the limit cases.
72 Create(Qualified1 : QualifiedCurve from Geom2dGcc ;
73 Point : Point from Geom2d ;
74 OnCurve : Curve from Geom2dAdaptor ;
75 Tolerance : Real from Standard ;
76 Param1 : Real from Standard ;
77 ParamOn : Real from Standard )
78 returns Circ2d2TanOn from Geom2dGcc ;
79 ---Purpose: This method implements the algorithms used to
80 -- create 2d circles TANgent to one curve and one point and
81 -- having the center ON a 2d curve.
82 -- Param1 is the initial guess on the first curve QualifiedCurv.
83 -- ParamOn is the initial guess on the center curve OnCurv.
84 -- Tolerance is used for the limit cases.
86 Create(Point1 : Point from Geom2d ;
87 Point2 : Point from Geom2d ;
88 OnCurve : Curve from Geom2dAdaptor ;
89 Tolerance : Real from Standard )
90 returns Circ2d2TanOn from Geom2dGcc ;
91 ---Purpose: This method implements the algorithms used to
92 -- create 2d circles TANgent to two points and
93 -- having the center ON a 2d curve.
94 -- Tolerance is used for the limit cases.
96 -- -- ....................................................................
99 Circ : Circ2d2TanOn from GccAna)
102 Results(me : in out ;
103 Circ : Circ2d2TanOnGeo from Geom2dGcc)
106 IsDone(me) returns Boolean
108 ---Purpose: Returns true if the construction algorithm does not fail
109 -- (even if it finds no solution).
110 -- Note: IsDone protects against a failure arising from a
111 -- more internal intersection algorithm, which has
112 -- reached its numeric limits.
114 NbSolutions(me) returns Integer from Standard
117 ---Purpose: This method returns the number of solutions.
118 -- NotDone is raised if the algorithm failed.
120 ThisSolution(me ; Index : Integer) returns Circ2d
121 raises OutOfRange, NotDone
123 ---Purpose: Returns the solution number Index and raises OutOfRange
124 -- exception if Index is greater than the number of solutions.
125 -- Be carefull: the Index is only a way to get all the
126 -- solutions, but is not associated to theses outside the context
127 -- of the algorithm-object.
129 -- Standard_OutOfRange if Index is less than or equal
130 -- to zero or greater than the number of solutions
131 -- computed by this algorithm.
132 -- StdFail_NotDone if the construction fails.
135 Index : Integer from Standard;
136 Qualif1 : out Position from GccEnt ;
137 Qualif2 : out Position from GccEnt )
138 raises OutOfRange, NotDone
140 ---Purpose: It returns the informations about the qualifiers of
142 -- arguments concerning the solution number Index.
143 -- It returns the real qualifiers (the qualifiers given to the
144 -- constructor method in case of enclosed, enclosing and outside
145 -- and the qualifiers computedin case of unqualified).
147 -- Standard_OutOfRange if Index is less than zero or
148 -- greater than the number of solutions computed by this algorithm.
149 -- StdFail_NotDone if the construction fails.
152 Index : Integer from Standard;
153 ParSol,ParArg : out Real from Standard;
154 PntSol : out Pnt2d from gp )
157 ---Purpose: Returns informations about the tangency point between the
158 -- result and the first argument.
159 -- ParSol is the intrinsic parameter of the point PntSol on the solution curv.
160 -- ParArg is the intrinsic parameter of the point PntSol on the argument curv.
163 Index : Integer from Standard;
164 ParSol,ParArg : out Real from Standard;
165 PntSol : out Pnt2d from gp )
168 ---Purpose: Returns informations about the tangency point between the
169 -- result and the second argument.
170 -- ParSol is the intrinsic parameter of the point PntSol on the solution curv.
171 -- ParArg is the intrinsic parameter of the point PntSol on the argument curv.
174 Index : Integer from Standard;
175 ParArg : out Real from Standard;
176 PntSol : out Pnt2d from gp )
179 ---Purpose: Returns the center PntSol of the solution of index Index
180 -- computed by this algorithm.
181 -- ParArg is the parameter of the point PntSol on the third argument.
183 -- Standard_OutOfRange if Index is less than zero or
184 -- greater than the number of solutions computed by this algorithm.
185 -- StdFail_NotDone if the construction fails.
188 Index : Integer from Standard) returns Boolean from Standard
191 --- Purpose: Returns true if the solution of index Index and,
192 -- respectively, the first or second argument of this
193 -- algorithm are the same (i.e. there are 2 identical circles).
194 -- If Rarg is the radius of the first or second argument,
195 -- Rsol is the radius of the solution and dist is the
196 -- distance between the two centers, we consider the two
197 -- circles to be identical if |Rarg - Rsol| and dist
198 -- are less than or equal to the tolerance criterion given at
199 -- the time of construction of this algorithm.
201 -- Standard_OutOfRange if Index is less than zero or
202 -- greater than the number of solutions computed by this algorithm.
203 -- StdFail_NotDone if the construction fails.
206 Index : Integer ) returns Boolean
209 --- Purpose: Returns true if the solution of index Index and,
210 -- respectively, the first or second argument of this
211 -- algorithm are the same (i.e. there are 2 identical circles).
212 -- If Rarg is the radius of the first or second argument,
213 -- Rsol is the radius of the solution and dist is the
214 -- distance between the two centers, we consider the two
215 -- circles to be identical if |Rarg - Rsol| and dist
216 -- are less than or equal to the tolerance criterion given at
217 -- the time of construction of this algorithm.
219 -- Standard_OutOfRange if Index is less than zero or
220 -- greater than the number of solutions computed by this algorithm.
221 -- StdFail_NotDone if the construction fails.
225 WellDone : Boolean from Standard;
226 ---Purpose: Returns True if the algorithm succeeded.
228 cirsol : Array1OfCirc2d from TColgp;
231 NbrSol : Integer from Standard;
232 ---Purpose: Returns the number of solutions.
234 qualifier1 : Array1OfPosition from GccEnt;
235 ---Purpose: The qualifiers of the first argument.
237 qualifier2 : Array1OfPosition from GccEnt;
238 ---Purpose: The qualifiers of the second argument.
240 TheSame1 : Array1OfInteger from TColStd;
241 ---Purpose: Returns 1 if the solution and the first argument are the same (2 circles).
242 -- if R1 is the radius of the first argument and Rsol the radius
243 -- of the solution and dist the distance between the two centers,
244 -- we concider the two circles are identical if R1+dist-Rsol is
245 -- less than Tolerance.
246 -- 0 in the other cases.
248 TheSame2 : Array1OfInteger from TColStd;
249 ---Purpose: 1 if the solution and the second argument are the same (2 circles).
250 -- if R2 is the radius of the second argument and Rsol the radius
251 -- of the solution and dist the distance between the two centers,
252 -- we concider the two circles are identical if R2+dist-Rsol is
253 -- less than Tolerance.
254 -- 0 in the other cases.
256 pnttg1sol : Array1OfPnt2d from TColgp;
257 ---Purpose: The tangency point between the solution and the first argument.
259 pnttg2sol : Array1OfPnt2d from TColgp;
260 ---Purpose: The tangency point between the solution and the second argument.
262 pntcen : Array1OfPnt2d from TColgp;
263 ---Purpose: The center point of the solution.
265 par1sol : Array1OfReal from TColStd;
266 ---Purpose: The parameter of pnttg1sol on the solution.
267 -- pnttg1sol is the tangency point between the solution and the first argument.
269 par2sol : Array1OfReal from TColStd;
270 ---Purpose: The parameter of pnttg2sol on the solution.
271 -- pnttg2sol is the tangency point between the solution and the second argument.
273 pararg1 : Array1OfReal from TColStd;
274 ---Purpose: The parameter of pnttg1sol on the first argument.
275 -- pnttg1sol is the tangency point between the solution and the first argument.
277 pararg2 : Array1OfReal from TColStd;
278 ---Purpose: The parameter of pnttg2sol on the second argument.
279 -- pnttg2sol is the tangency point between the solution and the second argument.
281 parcen3 : Array1OfReal from TColStd;
282 ---Purpose: The parameter of the center point of the solution on the third argument.
284 Invert : Boolean from Standard;
286 -- CircAna : Circ2d2TanOn from GccAna;
287 -- CircGeo : Circ2d2TanOnGeo from Geom2dGcc;
288 -- CircIter : Circ2d2TanOnIter from Geom2dGcc;
289 -- TypeAna : Boolean;