b311480e |
1 | -- Created on: 1991-03-29 |
2 | -- Created by: Remi GILET |
3 | -- Copyright (c) 1991-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | generic class Circ2d2TanRad from GccGeo ( |
23 | TheCurve as any; |
24 | TheTool as any; |
25 | TheQCurve as any; -- as QualifiedCurve from GccEnt |
26 | -- (TheCurve) |
27 | TheParGenCurve as any; -- as ParGenCurve from GccGeo |
28 | -- (TheCurve) |
29 | TheHParGenCurve as Transient; |
30 | TheCurvePGTool as any; -- as CurvePGTool from GccGeo |
31 | -- (Thecurve, |
32 | -- TheTool, |
33 | -- TheParGenCurve) |
34 | TheIntConicCurve as any; -- as IntConicCurveOfGOffsetInter |
35 | TheIntCurveCurve as any) -- as GOffsetInter from Geom2dInt |
36 | -- (TheParGenCurve, |
37 | -- TheCurvePGTool) |
38 | |
39 | ---Purpose: This class implements the algorithms used to |
40 | -- create 2d circles tangent to one curve and a |
41 | -- point/line/circle/curv and with a given radius. |
42 | -- For each construction methods arguments are: |
43 | -- - Two Qualified elements for tangency constrains. |
44 | -- (for example EnclosedCirc if we want the |
45 | -- solution inside the argument EnclosedCirc). |
46 | -- - Two Reals. One (Radius) for the radius and the |
47 | -- other (Tolerance) for the tolerance. |
48 | -- Tolerance is only used for the limit cases. |
49 | -- For example : |
50 | -- We want to create a circle inside a circle C1 and |
51 | -- inside a curve Cu2 with a radius Radius and a |
52 | -- tolerance Tolerance. |
53 | -- If we did not used Tolerance it is impossible to |
54 | -- find a solution in the following case : Cu2 is |
55 | -- inside C1 and there is no intersection point |
56 | -- between the two elements. |
57 | -- With Tolerance we will get a solution if the |
58 | -- lowest distance between C1 and Cu2 is lower than or |
59 | -- equal Tolerance. |
60 | |
61 | -- inherits Entity from Standard |
62 | |
63 | uses Pnt2d from gp, |
64 | Circ2d from gp, |
65 | Array1OfCirc2d from TColgp, |
66 | Array1OfPnt2d from TColgp, |
67 | QualifiedCirc from GccEnt, |
68 | QualifiedLin from GccEnt, |
69 | Array1OfReal from TColStd, |
70 | Array1OfInteger from TColStd, |
71 | Position from GccEnt, |
72 | Array1OfPosition from GccEnt |
73 | |
74 | raises OutOfRange from Standard, |
75 | BadQualifier from GccEnt, |
76 | NotDone from StdFail, |
77 | NegativeValue from Standard |
78 | |
79 | is |
80 | |
81 | Create(Qualified1 : QualifiedCirc from GccEnt ; |
82 | Qualified2 : TheQCurve ; |
83 | Radius : Real from Standard; |
84 | Tolerance : Real from Standard) returns Circ2d2TanRad |
85 | ---Purpose: This method implements the algorithms used to |
86 | -- create 2d circles TANgent to a 2d circle and a curve |
87 | -- with a radius of Radius. |
88 | raises NegativeValue, BadQualifier; |
89 | ---Purpose: It raises NegativeValue if Radius is lower than zero. |
90 | |
91 | Create(Qualified1 : QualifiedLin from GccEnt ; |
92 | Qualified2 : TheQCurve ; |
93 | Radius : Real from Standard; |
94 | Tolerance : Real from Standard) returns Circ2d2TanRad |
95 | ---Purpose: This method implements the algorithms used to |
96 | -- create 2d circles TANgent to a 2d line and a curve |
97 | -- with a radius of Radius. |
98 | raises NegativeValue, BadQualifier; |
99 | ---Purpose: It raises NegativeValue if Radius is lower than zero. |
100 | |
101 | Create(Qualified1 : TheQCurve ; |
102 | Qualified2 : TheQCurve ; |
103 | Radius : Real from Standard; |
104 | Tolerance : Real from Standard) returns Circ2d2TanRad |
105 | ---Purpose: This method implements the algorithms used to |
106 | -- create 2d circles TANgent to two curves with |
107 | -- a radius of Radius. |
108 | raises NegativeValue, BadQualifier; |
109 | ---Purpose: It raises NegativeValue if Radius is lower than zero. |
110 | |
111 | Create(Qualified1 : TheQCurve ; |
112 | Point2 : Pnt2d from gp ; |
113 | Radius : Real from Standard; |
114 | Tolerance : Real from Standard) returns Circ2d2TanRad |
115 | ---Purpose: This method implements the algorithms used to |
116 | -- create 2d circles TANgent to a curve and a point |
117 | -- with a radius of Radius. |
118 | raises NegativeValue, BadQualifier; |
119 | ---Purpose: It raises NegativeValue if Radius is lower than zero. |
120 | |
121 | -- -- .................................................................... |
122 | |
123 | IsDone(me) returns Boolean from Standard |
124 | is static; |
125 | ---Purpose: This method returns True if the algorithm succeeded. |
126 | |
127 | NbSolutions(me) returns Integer from Standard |
128 | ---Purpose: This method returns the number of solutions. |
129 | raises NotDone |
130 | is static; |
131 | ---Purpose: It raises NotDone if the algorithm failed. |
132 | |
133 | ThisSolution(me ; |
134 | Index : Integer from Standard) returns Circ2d from gp |
135 | ---Purpose: Returns the solution number Index. |
136 | -- Be careful: the Index is only a way to get all the |
137 | -- solutions, but is not associated to those outside the context |
138 | -- of the algorithm-object. |
139 | raises OutOfRange, NotDone |
140 | is static; |
141 | ---Purpose: It raises OutOfRange exception if Index is greater |
142 | -- than the number of solutions. |
143 | -- It raises NotDone if the construction algorithm did not |
144 | -- succeed. |
145 | |
146 | WhichQualifier(me ; |
147 | Index : Integer from Standard; |
148 | Qualif1 : out Position from GccEnt ; |
149 | Qualif2 : out Position from GccEnt ) |
150 | raises OutOfRange, NotDone |
151 | is static; |
152 | ---Purpose: It returns the information about the qualifiers of |
153 | -- the tangency arguments concerning the solution number Index. |
154 | -- It returns the real qualifiers (the qualifiers given to the |
155 | -- constructor method in case of enclosed, enclosing and outside |
156 | -- and the qualifiers computedin case of unqualified). |
157 | |
158 | Tangency1(me ; |
159 | Index : Integer from Standard; |
160 | ParSol,ParArg : out Real from Standard; |
161 | PntSol : out Pnt2d from gp ) |
162 | ---Purpose: Returns information about the tangency point between the |
163 | -- result number Index and the first argument. |
164 | -- ParSol is the intrinsic parameter of the point PntSol on the solution. |
165 | -- ParArg is the intrinsic parameter of the point PntSol on the first |
166 | -- argument. |
167 | raises OutOfRange, NotDone |
168 | is static; |
169 | ---Purpose: It raises OutOfRange if Index is greater than the number |
170 | -- of solutions. |
171 | -- It raises NotDone if the construction algorithm did not |
172 | -- succeed. |
173 | |
174 | Tangency2(me ; |
175 | Index : Integer from Standard; |
176 | ParSol,ParArg : out Real from Standard; |
177 | PntSol : out Pnt2d from gp ) |
178 | ---Purpose: Returns information about the tangency point between the |
179 | -- result number Index and the second argument. |
180 | -- ParSol is the intrinsic parameter of the point PntSol on |
181 | -- the solution. |
182 | -- ParArg is the intrinsic parameter of the point PntArg on |
183 | -- the second argument. |
184 | raises OutOfRange, NotDone |
185 | is static; |
186 | ---Purpose: It raises OutOfRange if Index is greater than the number |
187 | -- of solutions. |
188 | -- It raises NotDone if the construction algorithm did not |
189 | -- succeed. |
190 | |
191 | IsTheSame1(me ; |
192 | Index : Integer from Standard) returns Boolean from Standard |
193 | ---Purpose: Returns True if the solution number Index is equal to |
194 | -- the first argument. |
195 | raises OutOfRange, NotDone |
196 | is static; |
197 | ---Purpose: It raises OutOfRange if Index is greater than the number |
198 | -- of solutions. |
199 | -- It raises NotDone if the construction algorithm did not |
200 | -- succeed. |
201 | |
202 | IsTheSame2(me ; |
203 | Index : Integer from Standard) returns Boolean from Standard |
204 | ---Purpose: Returns True if the solution number Index is equal to |
205 | -- the second argument. |
206 | raises OutOfRange, NotDone |
207 | is static; |
208 | ---Purpose: It raises OutOfRange if Index is greater than the number |
209 | -- of solutions. |
210 | -- It raises NotDone if the construction algorithm did not |
211 | -- succeed. |
212 | |
213 | fields |
214 | |
215 | WellDone : Boolean from Standard; |
216 | ---Purpose: True if the algorithm succeeded. |
217 | |
218 | NbrSol : Integer from Standard; |
219 | ---Purpose: The number of possible solutions. We have to decide about |
220 | -- the status of the multiple solutions... |
221 | |
222 | cirsol : Array1OfCirc2d from TColgp; |
223 | -- The solutions. |
224 | |
225 | qualifier1 : Array1OfPosition from GccEnt; |
226 | -- The qualifiers of the first argument. |
227 | |
228 | qualifier2 : Array1OfPosition from GccEnt; |
229 | -- The qualifiers of the second argument. |
230 | |
231 | TheSame1 : Array1OfInteger from TColStd; |
232 | ---Purpose: 1 if the solution and the first argument are the same |
233 | -- (2 circles). |
234 | -- If R1 is the radius of the first argument and Rsol the radius |
235 | -- of the solution and dist the distance between the two centers, |
236 | -- we consider the two circles are identical if R1+dist-Rsol is |
237 | -- less than Tolerance. |
238 | -- 0 in the other cases. |
239 | |
240 | TheSame2 : Array1OfInteger from TColStd; |
241 | ---Purpose: 1 if the solution and the second argument are the same |
242 | -- (2 circles). |
243 | -- If R2 is the radius of the second argument and Rsol the radius |
244 | -- of the solution and dist the distance between the two centers, |
245 | -- we consider the two circles are identical if R2+dist-Rsol is |
246 | -- less than Tolerance. |
247 | -- 0 in the other cases. |
248 | |
249 | pnttg1sol : Array1OfPnt2d from TColgp; |
250 | ---Purpose: The tangency point between the solution and the first |
251 | -- argument on the solution. |
252 | |
253 | pnttg2sol : Array1OfPnt2d from TColgp; |
254 | ---Purpose: The tangency point between the solution and the second |
255 | -- argument on the solution. |
256 | |
257 | par1sol : Array1OfReal from TColStd; |
258 | ---Purpose: The parameter of the tangency point between the solution |
259 | -- and the first argument on the solution. |
260 | |
261 | par2sol : Array1OfReal from TColStd; |
262 | ---Purpose: The parameter of the tangency point between the solution |
263 | -- and the second argument on the solution. |
264 | |
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. |
268 | |
269 | pararg2 : Array1OfReal from TColStd; |
270 | ---Purpose: The parameter of the tangency point between the solution |
271 | -- and the second argument on the second argument. |
272 | |
273 | end Circ2d2TanRad; |