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 class Circ2d2TanOnGeo 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 (lines, circles or points).
26 -- - The center line (a curve).
27 -- - The parameter for each tangency argument which
31 -- inherits Entity from Standard
36 QualifiedCirc from GccEnt,
37 QualifiedLin from GccEnt,
38 Array1OfCirc2d from TColgp,
39 Array1OfPnt2d from TColgp,
40 Array1OfInteger from TColStd,
41 Array1OfReal from TColStd,
43 Array1OfPosition from GccEnt,
44 Curve from Geom2dAdaptor,
45 CurveTool from Geom2dGcc,
46 QCurve from Geom2dGcc,
47 OffsetCurve from Adaptor3d,
48 HCurve from Geom2dAdaptor,
49 CurveToolGeo from Geom2dGcc,
50 TheIntConicCurveOfGInter from Geom2dInt
52 raises NotDone from StdFail,
53 BadQualifier from GccEnt,
54 OutOfRange from Standard
58 Create(Qualified1 : QualifiedCirc from GccEnt ;
59 Qualified2 : QualifiedCirc from GccEnt ;
60 OnCurv : Curve from Geom2dAdaptor ;
61 Tolerance : Real from Standard) returns Circ2d2TanOnGeo
62 ---Purpose: This method implements the algorithms used to
63 -- create 2d circles TANgent to two 2d circles and
64 -- having the center ON a curve.
65 raises BadQualifier from GccEnt;
67 Create(Qualified1 : QualifiedCirc from GccEnt ;
68 Qualified2 : QualifiedLin from GccEnt ;
69 OnCurv : Curve from Geom2dAdaptor ;
70 Tolerance : Real from Standard) returns Circ2d2TanOnGeo
71 ---Purpose: This method implements the algorithms used to
72 -- create 2d circles TANgent to a 2d circle and a 2d line
73 -- having the center ON a curve.
74 raises BadQualifier from GccEnt;
76 Create(Qualified1 : QualifiedCirc from GccEnt ;
77 Point2 : Pnt2d from gp ;
78 OnCurv : Curve from Geom2dAdaptor ;
79 Tolerance : Real from Standard) returns Circ2d2TanOnGeo
80 ---Purpose: This method implements the algorithms used to
81 -- create 2d circles TANgent to a 2d circle and a point
82 -- having the center ON a curve.
83 raises BadQualifier from GccEnt;
85 Create(Qualified1 : QualifiedLin from GccEnt ;
86 Qualified2 : QualifiedLin from GccEnt ;
87 OnCurv : Curve from Geom2dAdaptor ;
88 Tolerance : Real from Standard) returns Circ2d2TanOnGeo
89 ---Purpose: This method implements the algorithms used to
90 -- create 2d circles TANgent to two 2d lines
91 -- having the center ON a curve.
92 raises BadQualifier from GccEnt;
94 Create(Qualified1 : QualifiedLin from GccEnt ;
95 Qualified2 : Pnt2d from gp ;
96 OnCurv : Curve from Geom2dAdaptor ;
97 Tolerance : Real from Standard) returns Circ2d2TanOnGeo
98 ---Purpose: This method implements the algorithms used to
99 -- create 2d circles TANgent to a 2d line and a point
100 -- having the center ON a 2d line.
101 raises BadQualifier from GccEnt;
103 Create(Point1 : Pnt2d from gp ;
104 Point2 : Pnt2d from gp ;
105 OnCurv : Curve from Geom2dAdaptor ;
106 Tolerance : Real from Standard) returns Circ2d2TanOnGeo ;
107 ---Purpose: This method implements the algorithms used to
108 -- create 2d circles TANgent to two points
109 -- having the center ON a 2d line.
111 -- ....................................................................
113 IsDone(me) returns Boolean from Standard
115 ---Purpose: This method returns True if the construction
116 -- algorithm succeeded.
118 NbSolutions(me) returns Integer from Standard
119 ---Purpose: This method returns the number of solutions.
122 ---Purpose: It raises NotDone if the construction algorithm
125 ThisSolution(me ; Index : Integer) returns Circ2d from gp
126 ---Purpose: 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 those outside the
130 -- context of the algorithm-object.
131 raises OutOfRange, NotDone
133 ---Purpose: It raises NotDone if the construction algorithm
135 -- It raises OutOfRange if Index is greater than the
136 -- number of solutions.
139 Index : Integer from Standard;
140 Qualif1 : out Position from GccEnt ;
141 Qualif2 : out Position from GccEnt )
142 raises OutOfRange, NotDone
144 ---Purpose: It returns the informations about the qualifiers of
146 -- arguments concerning the solution number Index.
147 -- It returns the real qualifiers (the qualifiers given to the
148 -- constructor method in case of enclosed, enclosing and outside
149 -- and the qualifiers computedin case of unqualified).
152 Index : Integer from Standard;
153 ParSol,ParArg : out Real from Standard;
154 PntSol : out Pnt2d from gp )
155 ---Purpose: Returns informations about the tangency point between the
156 -- result number Index and the first argument.
157 -- ParSol is the intrinsic parameter of the point on the
159 -- ParArg is the intrinsic parameter of the point on the
161 -- PntSol is the tangency point on the solution curv.
162 -- PntArg is the tangency point on the argument curv.
163 raises OutOfRange, NotDone
165 ---Purpose: It raises NotDone if the construction algorithm
167 -- It raises OutOfRange if Index is greater than the
168 -- number of solutions.
171 Index : Integer from Standard;
172 ParSol,ParArg : out Real from Standard;
173 PntSol : out Pnt2d from gp )
174 ---Purpose: Returns informations about the tangency point between the
175 -- result number Index and the second argument.
176 -- ParSol is the intrinsic parameter of the point on the
178 -- ParArg is the intrinsic parameter of the point on the
180 -- PntSol is the tangency point on the solution curv.
181 -- PntArg is the tangency point on the argument curv.
182 raises OutOfRange, NotDone
184 ---Purpose: It raises NotDone if the construction algorithm
186 -- It raises OutOfRange if Index is greater than the
187 -- number of solutions.
190 Index : Integer from Standard;
191 ParArg : out Real from Standard;
192 PntSol : out Pnt2d from gp )
193 ---Purpose: Returns informations about the center (on the curv)
195 -- ParArg is the intrinsic parameter of the point on
196 -- the argument curv.
197 -- PntSol is the center point of the solution curv.
198 raises OutOfRange, NotDone
200 ---Purpose: It raises NotDone if the construction algorithm
202 -- It raises OutOfRange if Index is greater than the
203 -- number of solutions.
206 Index : Integer from Standard) returns Boolean from Standard
207 ---Purpose: Returns True if the solution number Index is equal to
208 -- the first argument and False in the other cases.
209 raises OutOfRange, NotDone
211 ---Purpose: It raises NotDone if the construction algorithm
213 -- It raises OutOfRange if Index is greater than the
214 -- number of solutions.
217 Index : Integer from Standard) returns Boolean from Standard
218 ---Purpose: Returns True if the solution number Index is equal to
219 -- the second argument and False in the other cases.
220 raises OutOfRange, NotDone
222 ---Purpose: It raises NotDone if the construction algorithm
224 -- It raises OutOfRange if Index is greater than the
225 -- number of solutions.
229 WellDone : Boolean from Standard;
230 ---Purpose: True if the algorithm succeeded.
232 NbrSol : Integer from Standard;
233 ---Purpose: Number of solutions.
235 cirsol : Array1OfCirc2d from TColgp;
236 ---Purpose: The solutions.
238 qualifier1 : Array1OfPosition from GccEnt;
239 ---Purpose: The qualifiers of the first argument.
241 qualifier2 : Array1OfPosition from GccEnt;
242 ---Purpose: The qualifiers of the second argument.
244 TheSame1 : Array1OfInteger from TColStd;
245 ---Purpose: 1 if the solution and the first argument are the same
247 -- If R1 is the radius of the first argument and Rsol the radius
248 -- of the solution and dist the distance between the two centers,
249 -- we consider the two circles are identical if R1+dist-Rsol is
250 -- less than Tolerance.
251 -- 0 in the other cases.
253 TheSame2 : Array1OfInteger from TColStd;
254 ---Purpose: 1 if the solution and the second argument are the same
256 -- If R2 is the radius of the second argument and Rsol the radius
257 -- of the solution and dist the distance between the two centers,
258 -- we consider the two circles are identical if R2+dist-Rsol is
259 -- less than Tolerance.
260 -- 0 in the other cases.
262 pnttg1sol : Array1OfPnt2d from TColgp;
263 ---Purpose: The tangency point between the solution and the first
264 -- argument on the solution.
266 pnttg2sol : Array1OfPnt2d from TColgp;
267 ---Purpose: The tangency point between the solution and the second
268 -- argument on the solution.
270 pntcen : Array1OfPnt2d from TColgp;
271 ---Purpose: The center point of the solution on the third argument.
273 par1sol : Array1OfReal from TColStd;
274 ---Purpose: The parameter of the tangency point between the solution
275 -- and the first argument on the solution.
277 par2sol : Array1OfReal from TColStd;
278 ---Purpose: The parameter of the tangency point between the solution
279 -- and the second argument on the solution.
281 pararg1 : Array1OfReal from TColStd;
282 ---Purpose: The parameter of the tangency point between the solution
283 -- and the first argument on the first argument.
285 pararg2 : Array1OfReal from TColStd;
286 ---Purpose: The parameter of the tangency point between the solution
287 -- and the second argument on the second argument.
289 parcen3 : Array1OfReal from TColStd;
290 ---Purpose: The parameter of the center point of the solution on the