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 Circ2d2TanRadGeo from Geom2dGcc
19 ---Purpose: This class implements the algorithms used to
20 -- create 2d circles tangent to one curve and a
21 -- point/line/circle/curv and with a given radius.
22 -- For each construction methods arguments are:
23 -- - Two Qualified elements for tangency constrains.
24 -- (for example EnclosedCirc if we want the
25 -- solution inside the argument EnclosedCirc).
26 -- - Two Reals. One (Radius) for the radius and the
27 -- other (Tolerance) for the tolerance.
28 -- Tolerance is only used for the limit cases.
30 -- We want to create a circle inside a circle C1 and
31 -- inside a curve Cu2 with a radius Radius and a
32 -- tolerance Tolerance.
33 -- If we did not used Tolerance it is impossible to
34 -- find a solution in the following case : Cu2 is
35 -- inside C1 and there is no intersection point
36 -- between the two elements.
37 -- With Tolerance we will get a solution if the
38 -- lowest distance between C1 and Cu2 is lower than or
41 -- inherits Entity from Standard
45 Array1OfCirc2d from TColgp,
46 Array1OfPnt2d from TColgp,
47 QualifiedCirc from GccEnt,
48 QualifiedLin from GccEnt,
49 Array1OfReal from TColStd,
50 Array1OfInteger from TColStd,
52 Array1OfPosition from GccEnt,
53 Curve from Geom2dAdaptor,
54 CurveTool from Geom2dGcc,
55 QCurve from Geom2dGcc,
56 OffsetCurve from Adaptor3d,
57 HCurve from Geom2dAdaptor,
58 CurveToolGeo from Geom2dGcc,
59 TheIntConicCurveOfGInter from Geom2dInt,
62 raises OutOfRange from Standard,
63 BadQualifier from GccEnt,
65 NegativeValue from Standard
69 Create(Qualified1 : QualifiedCirc from GccEnt;
70 Qualified2 : QCurve from Geom2dGcc;
71 Radius : Real from Standard;
72 Tolerance : Real from Standard) returns Circ2d2TanRadGeo
73 ---Purpose: This method implements the algorithms used to
74 -- create 2d circles TANgent to a 2d circle and a curve
75 -- with a radius of Radius.
76 raises NegativeValue, BadQualifier;
77 ---Purpose: It raises NegativeValue if Radius is lower than zero.
79 Create(Qualified1 : QualifiedLin from GccEnt;
80 Qualified2 : QCurve from Geom2dGcc;
81 Radius : Real from Standard;
82 Tolerance : Real from Standard) returns Circ2d2TanRadGeo
83 ---Purpose: This method implements the algorithms used to
84 -- create 2d circles TANgent to a 2d line and a curve
85 -- with a radius of Radius.
86 raises NegativeValue, BadQualifier;
87 ---Purpose: It raises NegativeValue if Radius is lower than zero.
89 Create(Qualified1 : QCurve from Geom2dGcc;
90 Qualified2 : QCurve from Geom2dGcc;
91 Radius : Real from Standard;
92 Tolerance : Real from Standard) returns Circ2d2TanRadGeo
93 ---Purpose: This method implements the algorithms used to
94 -- create 2d circles TANgent to two curves with
95 -- a radius of Radius.
96 raises NegativeValue, BadQualifier;
97 ---Purpose: It raises NegativeValue if Radius is lower than zero.
99 Create(Qualified1 : QCurve from Geom2dGcc;
100 Point2 : Pnt2d from gp ;
101 Radius : Real from Standard;
102 Tolerance : Real from Standard) returns Circ2d2TanRadGeo
103 ---Purpose: This method implements the algorithms used to
104 -- create 2d circles TANgent to a curve and a point
105 -- with a radius of Radius.
106 raises NegativeValue, BadQualifier;
107 ---Purpose: It raises NegativeValue if Radius is lower than zero.
109 -- -- ....................................................................
111 IsDone(me) returns Boolean from Standard
113 ---Purpose: This method returns True if the algorithm succeeded.
115 NbSolutions(me) returns Integer from Standard
116 ---Purpose: This method returns the number of solutions.
119 ---Purpose: It raises NotDone if the algorithm failed.
122 Index : Integer from Standard) returns Circ2d from gp
123 ---Purpose: Returns the solution number Index.
124 -- Be careful: the Index is only a way to get all the
125 -- solutions, but is not associated to those outside the context
126 -- of the algorithm-object.
127 raises OutOfRange, NotDone
129 ---Purpose: It raises OutOfRange exception if Index is greater
130 -- than the number of solutions.
131 -- It raises NotDone if the construction algorithm did not
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 information about the qualifiers of
141 -- the tangency arguments concerning the solution number Index.
142 -- It returns the real qualifiers (the qualifiers given to the
143 -- constructor method in case of enclosed, enclosing and outside
144 -- and the qualifiers computedin case of unqualified).
147 Index : Integer from Standard;
148 ParSol,ParArg : out Real from Standard;
149 PntSol : out Pnt2d from gp )
150 ---Purpose: Returns information about the tangency point between the
151 -- result number Index and the first argument.
152 -- ParSol is the intrinsic parameter of the point PntSol on the solution.
153 -- ParArg is the intrinsic parameter of the point PntSol on the first
155 raises OutOfRange, NotDone
157 ---Purpose: It raises OutOfRange if Index is greater than the number
159 -- It raises NotDone if the construction algorithm did not
163 Index : Integer from Standard;
164 ParSol,ParArg : out Real from Standard;
165 PntSol : out Pnt2d from gp )
166 ---Purpose: Returns information about the tangency point between the
167 -- result number Index and the second argument.
168 -- ParSol is the intrinsic parameter of the point PntSol on
170 -- ParArg is the intrinsic parameter of the point PntArg on
171 -- the second argument.
172 raises OutOfRange, NotDone
174 ---Purpose: It raises OutOfRange if Index is greater than the number
176 -- It raises NotDone if the construction algorithm did not
180 Index : Integer from Standard) returns Boolean from Standard
181 ---Purpose: Returns True if the solution number Index is equal to
182 -- the first argument.
183 raises OutOfRange, NotDone
185 ---Purpose: It raises OutOfRange if Index is greater than the number
187 -- It raises NotDone if the construction algorithm did not
191 Index : Integer from Standard) returns Boolean from Standard
192 ---Purpose: Returns True if the solution number Index is equal to
193 -- the second argument.
194 raises OutOfRange, NotDone
196 ---Purpose: It raises OutOfRange if Index is greater than the number
198 -- It raises NotDone if the construction algorithm did not
203 WellDone : Boolean from Standard;
204 ---Purpose: True if the algorithm succeeded.
206 NbrSol : Integer from Standard;
207 ---Purpose: The number of possible solutions. We have to decide about
208 -- the status of the multiple solutions...
210 cirsol : Array1OfCirc2d from TColgp;
213 qualifier1 : Array1OfPosition from GccEnt;
214 -- The qualifiers of the first argument.
216 qualifier2 : Array1OfPosition from GccEnt;
217 -- The qualifiers of the second argument.
219 TheSame1 : Array1OfInteger from TColStd;
220 ---Purpose: 1 if the solution and the first argument are the same
222 -- If R1 is the radius of the first argument and Rsol the radius
223 -- of the solution and dist the distance between the two centers,
224 -- we consider the two circles are identical if R1+dist-Rsol is
225 -- less than Tolerance.
226 -- 0 in the other cases.
228 TheSame2 : Array1OfInteger from TColStd;
229 ---Purpose: 1 if the solution and the second argument are the same
231 -- If R2 is the radius of the second argument and Rsol the radius
232 -- of the solution and dist the distance between the two centers,
233 -- we consider the two circles are identical if R2+dist-Rsol is
234 -- less than Tolerance.
235 -- 0 in the other cases.
237 pnttg1sol : Array1OfPnt2d from TColgp;
238 ---Purpose: The tangency point between the solution and the first
239 -- argument on the solution.
241 pnttg2sol : Array1OfPnt2d from TColgp;
242 ---Purpose: The tangency point between the solution and the second
243 -- argument on the solution.
245 par1sol : Array1OfReal from TColStd;
246 ---Purpose: The parameter of the tangency point between the solution
247 -- and the first argument on the solution.
249 par2sol : Array1OfReal from TColStd;
250 ---Purpose: The parameter of the tangency point between the solution
251 -- and the second argument on the solution.
253 pararg1 : Array1OfReal from TColStd;
254 ---Purpose: The parameter of the tangency point between the solution
255 -- and the first argument on the first argument.
257 pararg2 : Array1OfReal from TColStd;
258 ---Purpose: The parameter of the tangency point between the solution
259 -- and the second argument on the second argument.
261 end Circ2d2TanRadGeo;