1 -- Created on: 1991-04-03
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 Circ2dTanOnRad from GccGeo (
20 TheQCurve as any; -- as QualifiedCurv from GccEnt (TheCurve)
21 TheParGenCurve as any; -- as ParGenCurve from GccGeo
23 TheHParGenCurve as Transient;
24 TheCurvePGTool as any; -- as CurvePGTool from GccGeo
28 TheIntConicCurve as any; -- as IntConicCurveOfGOffsetInter
29 TheIntCurveCurve as any) -- as GOffSetInter from Geom2dInt
33 ---Purpose: This class implements the algorithms used to
34 -- create a 2d circle tangent to a 2d entity,
35 -- centered on a 2d entity and with a given radius.
36 -- More than one argument must be a curve.
37 -- The arguments of all construction methods are :
38 -- - The qualified element for the tangency constrains
39 -- (QualifiedCirc, QualifiedLin, QualifiedCurvPoints).
40 -- - The Center element (circle, line, curve).
41 -- - A real Tolerance.
42 -- Tolerance is only used in the limits cases.
44 -- We want to create a circle tangent to an OutsideCurv Cu1
45 -- centered on a line OnLine with a radius Radius and with
46 -- a tolerance Tolerance.
47 -- If we did not use Tolerance it is impossible to
48 -- find a solution in the following case : OnLine is
49 -- outside Cu1. There is no intersection point between Cu1
50 -- and OnLine. The distance between the line and the
51 -- circle is greater than Radius.
52 -- With Tolerance we will give a solution if the
53 -- distance between Cu1 and OnLine is lower than or
56 -- inherits Entity from Standard
61 Array1OfCirc2d from TColgp,
62 Array1OfPnt2d from TColgp,
63 QualifiedCirc from GccEnt,
64 QualifiedLin from GccEnt,
65 Array1OfReal from TColStd,
66 Array1OfInteger from TColStd,
68 Array1OfPosition from GccEnt
70 raises NegativeValue from Standard,
71 OutOfRange from Standard,
72 BadQualifier from GccEnt,
77 -- On a line .............................................................
79 Create(Qualified1 : TheQCurve ;
80 OnLine : Lin2d from gp ;
81 Radius : Real from Standard;
82 Tolerance : Real from Standard) returns Circ2dTanOnRad
83 ---Purpose: This methods implements the algorithms used to create
84 -- 2d Circles tangent to a curve and centered on a 2d Line
85 -- with a given radius.
86 -- Tolerance is used to find solution in every limit cases.
87 raises NegativeValue, BadQualifier;
88 ---Purpose: raises NegativeValue in case of NegativeRadius.
90 -- -- On a circle ...........................................................
92 Create(Qualified1 : TheQCurve ;
93 OnCirc : Circ2d from gp ;
94 Radius : Real from Standard;
95 Tolerance : Real from Standard) returns Circ2dTanOnRad
96 ---Purpose: This methods implements the algorithms used to create
97 -- 2d Circles tangent to a curve and centered on a 2d Circle
98 -- with a given radius.
99 -- Tolerance is used to find solution in every limit cases.
100 raises NegativeValue, BadQualifier;
101 ---Purpose: raises NegativeValue in case of NegativeRadius.
103 -- On a curve ............................................................
105 Create(Qualified1 : QualifiedCirc from GccEnt ;
107 Radius : Real from Standard;
108 Tolerance : Real from Standard) returns Circ2dTanOnRad
109 ---Purpose: This methods implements the algorithms used to create
110 -- 2d Circles tangent to a circle and centered on a 2d curve
111 -- with a given radius.
112 -- Tolerance is used to find solution in every limit cases.
113 raises NegativeValue, BadQualifier;
114 ---Purpose: raises NegativeValue in case of NegativeRadius.
116 Create(Qualified1 : QualifiedLin from GccEnt ;
118 Radius : Real from Standard;
119 Tolerance : Real from Standard) returns Circ2dTanOnRad
120 ---Purpose: This methods implements the algorithms used to create
121 -- 2d Circles tangent to a 2d Line and centered on a 2d curve
122 -- with a given radius.
123 -- Tolerance is used to find solution in every limit cases.
124 raises NegativeValue, BadQualifier;
125 ---Purpose: raises NegativeValue in case of NegativeRadius.
127 Create(Qualified1 : TheQCurve ;
129 Radius : Real from Standard;
130 Tolerance : Real from Standard) returns Circ2dTanOnRad
131 ---Purpose: This methods implements the algorithms used to create
132 -- 2d Circles tangent to a 2d curve and centered on a 2d curve
133 -- with a given radius.
134 -- Tolerance is used to find solution in every limit cases.
135 raises NegativeValue, BadQualifier;
136 ---Purpose: raises NegativeValue in case of NegativeRadius.
138 Create(Point1 : Pnt2d from gp ;
140 Radius : Real from Standard;
141 Tolerance : Real from Standard) returns Circ2dTanOnRad
142 ---Purpose: This methods implements the algorithms used to create
143 -- 2d Circles passing through a 2d point and centered on a
144 -- 2d curve with a given radius.
145 -- Tolerance is used to find solution in every limit cases.
146 raises NegativeValue;
147 ---Purpose: raises NegativeValue in case of NegativeRadius.
149 -- -- ....................................................................
151 IsDone(me) returns Boolean from Standard
153 ---Purpose: This method returns True if the construction
154 -- algorithm succeeded.
156 NbSolutions(me) returns Integer from Standard
157 ---Purpose: This method returns the number of solutions.
160 ---Purpose: It raises NotDone if the construction algorithm
164 Index : Integer from Standard) returns Circ2d from gp
165 ---Purpose: Returns the solution number Index and raises OutOfRange
166 -- exception if Index is greater than the number of solutions.
167 -- Be careful: the Index is only a way to get all the
168 -- solutions, but is not associated to theses outside the
169 -- context of the algorithm-object.
170 raises OutOfRange, NotDone
172 ---Purpose: It raises NotDone if the construction algorithm
174 -- It raises OutOfRange if Index is greater than the
175 -- number of solutions.
178 Index : Integer from Standard;
179 Qualif1 : out Position from GccEnt )
180 raises OutOfRange, NotDone
182 -- It returns the informations about the qualifiers of the tangency
183 -- arguments concerning the solution number Index.
184 -- It returns the real qualifiers (the qualifiers given to the
185 -- constructor method in case of enclosed, enclosing and outside
186 -- and the qualifiers computedin case of unqualified).
189 Index : Integer from Standard;
190 ParSol,ParArg : out Real from Standard;
191 PntSol : out Pnt2d from gp )
192 ---Purpose: Returns informations about the tangency point between the
193 -- result number Index and the first argument.
194 -- ParSol is the intrinsic parameter of the point on the
196 -- ParArg is the intrinsic parameter of the point on the
198 -- PntSol is the tangency point on the solution curv.
199 -- PntArg is the tangency point on the argument curv.
200 raises OutOfRange, NotDone
202 ---Purpose: It raises NotDone if the construction algorithm
204 -- It raises OutOfRange if Index is greater than the
205 -- number of solutions.
208 Index : Integer from Standard;
209 ParArg : out Real from Standard;
210 PntSol : out Pnt2d from gp )
211 ---Purpose: Returns informations about the center (on the curv)
213 -- ParArg is the intrinsic parameter of the point on
214 -- the argument curv.
215 -- PntSol is the center point of the solution curv.
216 raises OutOfRange, NotDone
218 ---Purpose: It raises NotDone if the construction algorithm
220 -- It raises OutOfRange if Index is greater than the
221 -- number of solutions.
224 Index : Integer from Standard) returns Boolean from Standard
225 ---Purpose: Returns True if the solution number Index is equal to
226 -- the first argument and False in the other cases.
227 raises OutOfRange, NotDone
229 ---Purpose: It raises NotDone if the construction algorithm
231 -- It raises OutOfRange if Index is greater than the
232 -- number of solutions.
236 WellDone : Boolean from Standard;
237 ---Purpose: True if the algorithm succeeded.
239 NbrSol : Integer from Standard;
240 ---Purpose: The number of possible solutions. We have to decide about the
241 -- status of the multiple solutions...
243 cirsol : Array1OfCirc2d from TColgp;
244 ---Purpose : The solutions.
246 qualifier1 : Array1OfPosition from GccEnt;
247 -- The qualifiers of the first argument.
249 TheSame1 : Array1OfInteger from TColStd;
250 ---Purpose: 1 if the solution and the first argument are the same in the
251 -- tolerance of Tolerance.
252 -- 0 in the other cases.
254 pnttg1sol : Array1OfPnt2d from TColgp;
255 ---Purpose: The tangency point between the solution and the first
256 -- argument on the solution.
258 pntcen3 : Array1OfPnt2d from TColgp;
259 ---Purpose: The center point of the solution on the first argument.
261 par1sol : Array1OfReal from TColStd;
262 ---Purpose: The parameter of the tangency point between the solution
263 -- and the first argument on thesolution.
265 pararg1 : Array1OfReal from TColStd;
266 ---Purpose: The parameter of the tangency point between the solution
267 -- and the first argument on the first argument.
269 parcen3 : Array1OfReal from TColStd;
270 ---Purpose: The parameter of the center point of the solution on the