b311480e |
1 | -- Created on: 1991-03-29 |
2 | -- Created by: Remi GILET |
3 | -- Copyright (c) 1991-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
578ce4be |
17 | class Circ2d2TanRadGeo from Geom2dGcc |
18 | |
7fd59977 |
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. |
29 | -- For example : |
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 |
39 | -- equal Tolerance. |
40 | |
41 | -- inherits Entity from Standard |
42 | |
43 | uses Pnt2d from gp, |
44 | Circ2d from gp, |
45 | Array1OfCirc2d from TColgp, |
46 | Array1OfPnt2d from TColgp, |
47 | QualifiedCirc from GccEnt, |
48 | QualifiedLin from GccEnt, |
49 | Array1OfReal from TColStd, |
50 | Array1OfInteger from TColStd, |
51 | Position from GccEnt, |
578ce4be |
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, |
60 | GInter from Geom2dInt |
7fd59977 |
61 | |
62 | raises OutOfRange from Standard, |
63 | BadQualifier from GccEnt, |
64 | NotDone from StdFail, |
65 | NegativeValue from Standard |
66 | |
67 | is |
68 | |
578ce4be |
69 | Create(Qualified1 : QualifiedCirc from GccEnt; |
70 | Qualified2 : QCurve from Geom2dGcc; |
7fd59977 |
71 | Radius : Real from Standard; |
578ce4be |
72 | Tolerance : Real from Standard) returns Circ2d2TanRadGeo |
7fd59977 |
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. |
78 | |
578ce4be |
79 | Create(Qualified1 : QualifiedLin from GccEnt; |
80 | Qualified2 : QCurve from Geom2dGcc; |
7fd59977 |
81 | Radius : Real from Standard; |
578ce4be |
82 | Tolerance : Real from Standard) returns Circ2d2TanRadGeo |
7fd59977 |
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. |
88 | |
578ce4be |
89 | Create(Qualified1 : QCurve from Geom2dGcc; |
90 | Qualified2 : QCurve from Geom2dGcc; |
7fd59977 |
91 | Radius : Real from Standard; |
578ce4be |
92 | Tolerance : Real from Standard) returns Circ2d2TanRadGeo |
7fd59977 |
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. |
98 | |
578ce4be |
99 | Create(Qualified1 : QCurve from Geom2dGcc; |
7fd59977 |
100 | Point2 : Pnt2d from gp ; |
101 | Radius : Real from Standard; |
578ce4be |
102 | Tolerance : Real from Standard) returns Circ2d2TanRadGeo |
7fd59977 |
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. |
108 | |
109 | -- -- .................................................................... |
110 | |
111 | IsDone(me) returns Boolean from Standard |
112 | is static; |
113 | ---Purpose: This method returns True if the algorithm succeeded. |
114 | |
115 | NbSolutions(me) returns Integer from Standard |
116 | ---Purpose: This method returns the number of solutions. |
117 | raises NotDone |
118 | is static; |
119 | ---Purpose: It raises NotDone if the algorithm failed. |
120 | |
121 | ThisSolution(me ; |
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 |
128 | is static; |
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 |
132 | -- succeed. |
133 | |
134 | WhichQualifier(me ; |
135 | Index : Integer from Standard; |
136 | Qualif1 : out Position from GccEnt ; |
137 | Qualif2 : out Position from GccEnt ) |
138 | raises OutOfRange, NotDone |
139 | is static; |
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). |
145 | |
146 | Tangency1(me ; |
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 |
154 | -- argument. |
155 | raises OutOfRange, NotDone |
156 | is static; |
157 | ---Purpose: It raises OutOfRange if Index is greater than the number |
158 | -- of solutions. |
159 | -- It raises NotDone if the construction algorithm did not |
160 | -- succeed. |
161 | |
162 | Tangency2(me ; |
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 |
169 | -- the solution. |
170 | -- ParArg is the intrinsic parameter of the point PntArg on |
171 | -- the second argument. |
172 | raises OutOfRange, NotDone |
173 | is static; |
174 | ---Purpose: It raises OutOfRange if Index is greater than the number |
175 | -- of solutions. |
176 | -- It raises NotDone if the construction algorithm did not |
177 | -- succeed. |
178 | |
179 | IsTheSame1(me ; |
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 |
184 | is static; |
185 | ---Purpose: It raises OutOfRange if Index is greater than the number |
186 | -- of solutions. |
187 | -- It raises NotDone if the construction algorithm did not |
188 | -- succeed. |
189 | |
190 | IsTheSame2(me ; |
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 |
195 | is static; |
196 | ---Purpose: It raises OutOfRange if Index is greater than the number |
197 | -- of solutions. |
198 | -- It raises NotDone if the construction algorithm did not |
199 | -- succeed. |
200 | |
201 | fields |
202 | |
203 | WellDone : Boolean from Standard; |
204 | ---Purpose: True if the algorithm succeeded. |
205 | |
206 | NbrSol : Integer from Standard; |
207 | ---Purpose: The number of possible solutions. We have to decide about |
208 | -- the status of the multiple solutions... |
209 | |
210 | cirsol : Array1OfCirc2d from TColgp; |
211 | -- The solutions. |
212 | |
213 | qualifier1 : Array1OfPosition from GccEnt; |
214 | -- The qualifiers of the first argument. |
215 | |
216 | qualifier2 : Array1OfPosition from GccEnt; |
217 | -- The qualifiers of the second argument. |
218 | |
219 | TheSame1 : Array1OfInteger from TColStd; |
220 | ---Purpose: 1 if the solution and the first argument are the same |
221 | -- (2 circles). |
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. |
227 | |
228 | TheSame2 : Array1OfInteger from TColStd; |
229 | ---Purpose: 1 if the solution and the second argument are the same |
230 | -- (2 circles). |
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. |
236 | |
237 | pnttg1sol : Array1OfPnt2d from TColgp; |
238 | ---Purpose: The tangency point between the solution and the first |
239 | -- argument on the solution. |
240 | |
241 | pnttg2sol : Array1OfPnt2d from TColgp; |
242 | ---Purpose: The tangency point between the solution and the second |
243 | -- argument on the solution. |
244 | |
245 | par1sol : Array1OfReal from TColStd; |
246 | ---Purpose: The parameter of the tangency point between the solution |
247 | -- and the first argument on the solution. |
248 | |
249 | par2sol : Array1OfReal from TColStd; |
250 | ---Purpose: The parameter of the tangency point between the solution |
251 | -- and the second argument on the solution. |
252 | |
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. |
256 | |
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. |
260 | |
578ce4be |
261 | end Circ2d2TanRadGeo; |