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 generic class Circ2d2TanRad from GccGeo (
20 TheQCurve as any; -- as QualifiedCurve from GccEnt
22 TheParGenCurve as any; -- as ParGenCurve from GccGeo
24 TheHParGenCurve as Transient;
25 TheCurvePGTool as any; -- as CurvePGTool from GccGeo
29 TheIntConicCurve as any; -- as IntConicCurveOfGOffsetInter
30 TheIntCurveCurve as any) -- as GOffsetInter from Geom2dInt
34 ---Purpose: This class implements the algorithms used to
35 -- create 2d circles tangent to one curve and a
36 -- point/line/circle/curv and with a given radius.
37 -- For each construction methods arguments are:
38 -- - Two Qualified elements for tangency constrains.
39 -- (for example EnclosedCirc if we want the
40 -- solution inside the argument EnclosedCirc).
41 -- - Two Reals. One (Radius) for the radius and the
42 -- other (Tolerance) for the tolerance.
43 -- Tolerance is only used for the limit cases.
45 -- We want to create a circle inside a circle C1 and
46 -- inside a curve Cu2 with a radius Radius and a
47 -- tolerance Tolerance.
48 -- If we did not used Tolerance it is impossible to
49 -- find a solution in the following case : Cu2 is
50 -- inside C1 and there is no intersection point
51 -- between the two elements.
52 -- With Tolerance we will get a solution if the
53 -- lowest distance between C1 and Cu2 is lower than or
56 -- inherits Entity from Standard
60 Array1OfCirc2d from TColgp,
61 Array1OfPnt2d from TColgp,
62 QualifiedCirc from GccEnt,
63 QualifiedLin from GccEnt,
64 Array1OfReal from TColStd,
65 Array1OfInteger from TColStd,
67 Array1OfPosition from GccEnt
69 raises OutOfRange from Standard,
70 BadQualifier from GccEnt,
72 NegativeValue from Standard
76 Create(Qualified1 : QualifiedCirc from GccEnt ;
77 Qualified2 : TheQCurve ;
78 Radius : Real from Standard;
79 Tolerance : Real from Standard) returns Circ2d2TanRad
80 ---Purpose: This method implements the algorithms used to
81 -- create 2d circles TANgent to a 2d circle and a curve
82 -- with a radius of Radius.
83 raises NegativeValue, BadQualifier;
84 ---Purpose: It raises NegativeValue if Radius is lower than zero.
86 Create(Qualified1 : QualifiedLin from GccEnt ;
87 Qualified2 : TheQCurve ;
88 Radius : Real from Standard;
89 Tolerance : Real from Standard) returns Circ2d2TanRad
90 ---Purpose: This method implements the algorithms used to
91 -- create 2d circles TANgent to a 2d line and a curve
92 -- with a radius of Radius.
93 raises NegativeValue, BadQualifier;
94 ---Purpose: It raises NegativeValue if Radius is lower than zero.
96 Create(Qualified1 : TheQCurve ;
97 Qualified2 : TheQCurve ;
98 Radius : Real from Standard;
99 Tolerance : Real from Standard) returns Circ2d2TanRad
100 ---Purpose: This method implements the algorithms used to
101 -- create 2d circles TANgent to two curves with
102 -- a radius of Radius.
103 raises NegativeValue, BadQualifier;
104 ---Purpose: It raises NegativeValue if Radius is lower than zero.
106 Create(Qualified1 : TheQCurve ;
107 Point2 : Pnt2d from gp ;
108 Radius : Real from Standard;
109 Tolerance : Real from Standard) returns Circ2d2TanRad
110 ---Purpose: This method implements the algorithms used to
111 -- create 2d circles TANgent to a curve and a point
112 -- with a radius of Radius.
113 raises NegativeValue, BadQualifier;
114 ---Purpose: It raises NegativeValue if Radius is lower than zero.
116 -- -- ....................................................................
118 IsDone(me) returns Boolean from Standard
120 ---Purpose: This method returns True if the algorithm succeeded.
122 NbSolutions(me) returns Integer from Standard
123 ---Purpose: This method returns the number of solutions.
126 ---Purpose: It raises NotDone if the algorithm failed.
129 Index : Integer from Standard) returns Circ2d from gp
130 ---Purpose: Returns the solution number Index.
131 -- Be careful: the Index is only a way to get all the
132 -- solutions, but is not associated to those outside the context
133 -- of the algorithm-object.
134 raises OutOfRange, NotDone
136 ---Purpose: It raises OutOfRange exception if Index is greater
137 -- than the number of solutions.
138 -- It raises NotDone if the construction algorithm did not
142 Index : Integer from Standard;
143 Qualif1 : out Position from GccEnt ;
144 Qualif2 : out Position from GccEnt )
145 raises OutOfRange, NotDone
147 ---Purpose: It returns the information about the qualifiers of
148 -- the tangency arguments concerning the solution number Index.
149 -- It returns the real qualifiers (the qualifiers given to the
150 -- constructor method in case of enclosed, enclosing and outside
151 -- and the qualifiers computedin case of unqualified).
154 Index : Integer from Standard;
155 ParSol,ParArg : out Real from Standard;
156 PntSol : out Pnt2d from gp )
157 ---Purpose: Returns information about the tangency point between the
158 -- result number Index and the first argument.
159 -- ParSol is the intrinsic parameter of the point PntSol on the solution.
160 -- ParArg is the intrinsic parameter of the point PntSol on the first
162 raises OutOfRange, NotDone
164 ---Purpose: It raises OutOfRange if Index is greater than the number
166 -- It raises NotDone if the construction algorithm did not
170 Index : Integer from Standard;
171 ParSol,ParArg : out Real from Standard;
172 PntSol : out Pnt2d from gp )
173 ---Purpose: Returns information about the tangency point between the
174 -- result number Index and the second argument.
175 -- ParSol is the intrinsic parameter of the point PntSol on
177 -- ParArg is the intrinsic parameter of the point PntArg on
178 -- the second argument.
179 raises OutOfRange, NotDone
181 ---Purpose: It raises OutOfRange if Index is greater than the number
183 -- It raises NotDone if the construction algorithm did not
187 Index : Integer from Standard) returns Boolean from Standard
188 ---Purpose: Returns True if the solution number Index is equal to
189 -- the first argument.
190 raises OutOfRange, NotDone
192 ---Purpose: It raises OutOfRange if Index is greater than the number
194 -- It raises NotDone if the construction algorithm did not
198 Index : Integer from Standard) returns Boolean from Standard
199 ---Purpose: Returns True if the solution number Index is equal to
200 -- the second argument.
201 raises OutOfRange, NotDone
203 ---Purpose: It raises OutOfRange if Index is greater than the number
205 -- It raises NotDone if the construction algorithm did not
210 WellDone : Boolean from Standard;
211 ---Purpose: True if the algorithm succeeded.
213 NbrSol : Integer from Standard;
214 ---Purpose: The number of possible solutions. We have to decide about
215 -- the status of the multiple solutions...
217 cirsol : Array1OfCirc2d from TColgp;
220 qualifier1 : Array1OfPosition from GccEnt;
221 -- The qualifiers of the first argument.
223 qualifier2 : Array1OfPosition from GccEnt;
224 -- The qualifiers of the second argument.
226 TheSame1 : Array1OfInteger from TColStd;
227 ---Purpose: 1 if the solution and the first argument are the same
229 -- If R1 is the radius of the first argument and Rsol the radius
230 -- of the solution and dist the distance between the two centers,
231 -- we consider the two circles are identical if R1+dist-Rsol is
232 -- less than Tolerance.
233 -- 0 in the other cases.
235 TheSame2 : Array1OfInteger from TColStd;
236 ---Purpose: 1 if the solution and the second argument are the same
238 -- If R2 is the radius of the second argument and Rsol the radius
239 -- of the solution and dist the distance between the two centers,
240 -- we consider the two circles are identical if R2+dist-Rsol is
241 -- less than Tolerance.
242 -- 0 in the other cases.
244 pnttg1sol : Array1OfPnt2d from TColgp;
245 ---Purpose: The tangency point between the solution and the first
246 -- argument on the solution.
248 pnttg2sol : Array1OfPnt2d from TColgp;
249 ---Purpose: The tangency point between the solution and the second
250 -- argument on the solution.
252 par1sol : Array1OfReal from TColStd;
253 ---Purpose: The parameter of the tangency point between the solution
254 -- and the first argument on the solution.
256 par2sol : Array1OfReal from TColStd;
257 ---Purpose: The parameter of the tangency point between the solution
258 -- and the second argument on the solution.
260 pararg1 : Array1OfReal from TColStd;
261 ---Purpose: The parameter of the tangency point between the solution
262 -- and the first argument on the first argument.
264 pararg2 : Array1OfReal from TColStd;
265 ---Purpose: The parameter of the tangency point between the solution
266 -- and the second argument on the second argument.