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 class Circ2dTanOnRadGeo from Geom2dGcc
19 ---Purpose: This class implements the algorithms used to
20 -- create a 2d circle tangent to a 2d entity,
21 -- centered on a 2d entity and with a given radius.
22 -- More than one argument must be a curve.
23 -- The arguments of all construction methods are :
24 -- - The qualified element for the tangency constrains
25 -- (QualifiedCirc, QualifiedLin, QualifiedCurvPoints).
26 -- - The Center element (circle, line, curve).
27 -- - A real Tolerance.
28 -- Tolerance is only used in the limits cases.
30 -- We want to create a circle tangent to an OutsideCurv Cu1
31 -- centered on a line OnLine with a radius Radius and with
32 -- a tolerance Tolerance.
33 -- If we did not use Tolerance it is impossible to
34 -- find a solution in the following case : OnLine is
35 -- outside Cu1. There is no intersection point between Cu1
36 -- and OnLine. The distance between the line and the
37 -- circle is greater than Radius.
38 -- With Tolerance we will give a solution if the
39 -- distance between Cu1 and OnLine is lower than or
42 -- inherits Entity from Standard
47 Array1OfCirc2d from TColgp,
48 Array1OfPnt2d from TColgp,
49 QualifiedCirc from GccEnt,
50 QualifiedLin from GccEnt,
51 Array1OfReal from TColStd,
52 Array1OfInteger from TColStd,
54 Array1OfPosition from GccEnt,
55 Curve from Geom2dAdaptor,
56 CurveTool from Geom2dGcc,
57 QCurve from Geom2dGcc,
58 OffsetCurve from Adaptor3d,
59 HCurve from Geom2dAdaptor,
60 CurveToolGeo from Geom2dGcc,
61 TheIntConicCurveOfGInter from Geom2dInt,
64 raises NegativeValue from Standard,
65 OutOfRange from Standard,
66 BadQualifier from GccEnt,
71 -- On a line .............................................................
73 Create(Qualified1 : QCurve from Geom2dGcc;
74 OnLine : Lin2d from gp;
75 Radius : Real from Standard;
76 Tolerance : Real from Standard) returns Circ2dTanOnRadGeo
77 ---Purpose: This methods implements the algorithms used to create
78 -- 2d Circles tangent to a curve and centered on a 2d Line
79 -- with a given radius.
80 -- Tolerance is used to find solution in every limit cases.
81 raises NegativeValue, BadQualifier;
82 ---Purpose: raises NegativeValue in case of NegativeRadius.
84 -- -- On a circle ...........................................................
86 Create(Qualified1 : QCurve from Geom2dGcc;
87 OnCirc : Circ2d from gp;
88 Radius : Real from Standard;
89 Tolerance : Real from Standard) returns Circ2dTanOnRadGeo
90 ---Purpose: This methods implements the algorithms used to create
91 -- 2d Circles tangent to a curve and centered on a 2d Circle
92 -- with a given radius.
93 -- Tolerance is used to find solution in every limit cases.
94 raises NegativeValue, BadQualifier;
95 ---Purpose: raises NegativeValue in case of NegativeRadius.
97 -- On a curve ............................................................
99 Create(Qualified1 : QualifiedCirc from GccEnt ;
100 OnCurv : Curve from Geom2dAdaptor ;
101 Radius : Real from Standard;
102 Tolerance : Real from Standard) returns Circ2dTanOnRadGeo
103 ---Purpose: This methods implements the algorithms used to create
104 -- 2d Circles tangent to a circle and centered on a 2d curve
105 -- with a given radius.
106 -- Tolerance is used to find solution in every limit cases.
107 raises NegativeValue, BadQualifier;
108 ---Purpose: raises NegativeValue in case of NegativeRadius.
110 Create(Qualified1 : QualifiedLin from GccEnt ;
111 OnCurv : Curve from Geom2dAdaptor ;
112 Radius : Real from Standard;
113 Tolerance : Real from Standard) returns Circ2dTanOnRadGeo
114 ---Purpose: This methods implements the algorithms used to create
115 -- 2d Circles tangent to a 2d Line and centered on a 2d curve
116 -- with a given radius.
117 -- Tolerance is used to find solution in every limit cases.
118 raises NegativeValue, BadQualifier;
119 ---Purpose: raises NegativeValue in case of NegativeRadius.
121 Create(Qualified1 : QCurve from Geom2dGcc;
122 OnCurv : Curve from Geom2dAdaptor;
123 Radius : Real from Standard;
124 Tolerance : Real from Standard) returns Circ2dTanOnRadGeo
125 ---Purpose: This methods implements the algorithms used to create
126 -- 2d Circles tangent to a 2d curve and centered on a 2d curve
127 -- with a given radius.
128 -- Tolerance is used to find solution in every limit cases.
129 raises NegativeValue, BadQualifier;
130 ---Purpose: raises NegativeValue in case of NegativeRadius.
132 Create(Point1 : Pnt2d from gp ;
133 OnCurv : Curve from Geom2dAdaptor ;
134 Radius : Real from Standard;
135 Tolerance : Real from Standard) returns Circ2dTanOnRadGeo
136 ---Purpose: This methods implements the algorithms used to create
137 -- 2d Circles passing through a 2d point and centered on a
138 -- 2d curve with a given radius.
139 -- Tolerance is used to find solution in every limit cases.
140 raises NegativeValue;
141 ---Purpose: raises NegativeValue in case of NegativeRadius.
143 -- -- ....................................................................
145 IsDone(me) returns Boolean from Standard
147 ---Purpose: This method returns True if the construction
148 -- algorithm succeeded.
150 NbSolutions(me) returns Integer from Standard
151 ---Purpose: This method returns the number of solutions.
154 ---Purpose: It raises NotDone if the construction algorithm
158 Index : Integer from Standard) returns Circ2d from gp
159 ---Purpose: Returns the solution number Index and raises OutOfRange
160 -- exception if Index is greater than the number of solutions.
161 -- Be careful: the Index is only a way to get all the
162 -- solutions, but is not associated to theses outside the
163 -- context of the algorithm-object.
164 raises OutOfRange, NotDone
166 ---Purpose: It raises NotDone if the construction algorithm
168 -- It raises OutOfRange if Index is greater than the
169 -- number of solutions.
172 Index : Integer from Standard;
173 Qualif1 : out Position from GccEnt )
174 raises OutOfRange, NotDone
176 -- It returns the informations about the qualifiers of the tangency
177 -- arguments concerning the solution number Index.
178 -- It returns the real qualifiers (the qualifiers given to the
179 -- constructor method in case of enclosed, enclosing and outside
180 -- and the qualifiers computedin case of unqualified).
183 Index : Integer from Standard;
184 ParSol,ParArg : out Real from Standard;
185 PntSol : out Pnt2d from gp )
186 ---Purpose: Returns informations about the tangency point between the
187 -- result number Index and the first argument.
188 -- ParSol is the intrinsic parameter of the point on the
190 -- ParArg is the intrinsic parameter of the point on the
192 -- PntSol is the tangency point on the solution curv.
193 -- PntArg is the tangency point on the argument curv.
194 raises OutOfRange, NotDone
196 ---Purpose: It raises NotDone if the construction algorithm
198 -- It raises OutOfRange if Index is greater than the
199 -- number of solutions.
202 Index : Integer from Standard;
203 ParArg : out Real from Standard;
204 PntSol : out Pnt2d from gp )
205 ---Purpose: Returns informations about the center (on the curv)
207 -- ParArg is the intrinsic parameter of the point on
208 -- the argument curv.
209 -- PntSol is the center point of the solution curv.
210 raises OutOfRange, NotDone
212 ---Purpose: It raises NotDone if the construction algorithm
214 -- It raises OutOfRange if Index is greater than the
215 -- number of solutions.
218 Index : Integer from Standard) returns Boolean from Standard
219 ---Purpose: Returns True if the solution number Index is equal to
220 -- the first argument and False in the other cases.
221 raises OutOfRange, NotDone
223 ---Purpose: It raises NotDone if the construction algorithm
225 -- It raises OutOfRange if Index is greater than the
226 -- number of solutions.
230 WellDone : Boolean from Standard;
231 ---Purpose: True if the algorithm succeeded.
233 NbrSol : Integer from Standard;
234 ---Purpose: The number of possible solutions. We have to decide about the
235 -- status of the multiple solutions...
237 cirsol : Array1OfCirc2d from TColgp;
238 ---Purpose : The solutions.
240 qualifier1 : Array1OfPosition from GccEnt;
241 -- The qualifiers of the first argument.
243 TheSame1 : Array1OfInteger from TColStd;
244 ---Purpose: 1 if the solution and the first argument are the same in the
245 -- tolerance of Tolerance.
246 -- 0 in the other cases.
248 pnttg1sol : Array1OfPnt2d from TColgp;
249 ---Purpose: The tangency point between the solution and the first
250 -- argument on the solution.
252 pntcen3 : Array1OfPnt2d from TColgp;
253 ---Purpose: The center point of the solution on the first argument.
255 par1sol : Array1OfReal from TColStd;
256 ---Purpose: The parameter of the tangency point between the solution
257 -- and the first argument on thesolution.
259 pararg1 : Array1OfReal from TColStd;
260 ---Purpose: The parameter of the tangency point between the solution
261 -- and the first argument on the first argument.
263 parcen3 : Array1OfReal from TColStd;
264 ---Purpose: The parameter of the center point of the solution on the
267 end Circ2dTanOnRadGeo;