b311480e |
1 | // Created on: 1991-12-17 |
2 | // Created by: Jean-Claude Vauthier |
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 | |
17 | #include <gp_Lin.hxx> |
18 | #include <gp_Circ.hxx> |
19 | #include <gp_Parab.hxx> |
20 | #include <gp_Hypr.hxx> |
21 | #include <gp_Elips.hxx> |
22 | #include <gp_Lin2d.hxx> |
23 | #include <gp_Circ2d.hxx> |
24 | #include <gp_Parab2d.hxx> |
25 | #include <gp_Hypr2d.hxx> |
26 | #include <gp_Elips2d.hxx> |
27 | |
28 | |
29 | inline gp_Pnt ElCLib::Value (const Standard_Real U, const gp_Lin& L) { |
30 | |
31 | return ElCLib::LineValue (U, L.Position()); |
32 | } |
33 | |
34 | |
35 | |
36 | inline gp_Pnt ElCLib::Value (const Standard_Real U, const gp_Circ& C) { |
37 | |
38 | return ElCLib::CircleValue (U, C.Position(), C.Radius()); |
39 | } |
40 | |
41 | |
42 | inline void ElCLib::D1 ( |
43 | const Standard_Real U, const gp_Lin& L, gp_Pnt& P, gp_Vec& V1) { |
44 | |
45 | ElCLib::LineD1 (U, L.Position(), P, V1); |
46 | } |
47 | |
48 | |
49 | inline void ElCLib::D1 ( |
50 | const Standard_Real U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1) { |
51 | |
52 | ElCLib::CircleD1 (U, C.Position(), C.Radius(), P, V1); |
53 | } |
54 | |
55 | |
56 | inline void ElCLib::D2 ( |
57 | const Standard_Real U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) { |
58 | |
59 | ElCLib::CircleD2 (U, C.Position(), C.Radius(), P, V1, V2); |
60 | } |
61 | |
62 | |
63 | inline void ElCLib::D3 ( |
64 | const Standard_Real U, const gp_Circ& C, |
65 | gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) { |
66 | |
67 | ElCLib::CircleD3 (U, C.Position(), C.Radius(), P, V1, V2, V3); |
68 | } |
69 | |
70 | |
71 | |
72 | inline gp_Pnt ElCLib::Value (const Standard_Real U, const gp_Elips& E) { |
73 | return ElCLib::EllipseValue (U, |
74 | E.Position(), |
75 | E.MajorRadius(), |
76 | E.MinorRadius()); |
77 | } |
78 | |
79 | |
80 | inline void ElCLib::D1 ( |
81 | const Standard_Real U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1) { |
82 | |
83 | ElCLib::EllipseD1 (U, E.Position(), E.MajorRadius(), E.MinorRadius(), P, V1); |
84 | } |
85 | |
86 | |
87 | |
88 | inline void ElCLib::D2 ( |
89 | const Standard_Real U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) { |
90 | |
91 | ElCLib::EllipseD2 (U, |
92 | E.Position(), |
93 | E.MajorRadius(), |
94 | E.MinorRadius(), |
95 | P, V1, V2); |
96 | } |
97 | |
98 | |
99 | inline void ElCLib::D3 ( |
100 | const Standard_Real U, const gp_Elips& E, |
101 | gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) { |
102 | |
103 | ElCLib::EllipseD3 (U, |
104 | E.Position(), |
105 | E.MajorRadius(), |
106 | E.MinorRadius(), |
107 | P, V1, V2, V3); |
108 | } |
109 | |
110 | |
111 | |
112 | inline gp_Pnt ElCLib::Value (const Standard_Real U, const gp_Hypr& H) { |
113 | |
114 | return ElCLib::HyperbolaValue (U, |
115 | H.Position(), |
116 | H.MajorRadius(), |
117 | H.MinorRadius()); |
118 | } |
119 | |
120 | |
121 | |
122 | inline void ElCLib::D1 ( |
123 | const Standard_Real U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1) { |
124 | |
125 | ElCLib::HyperbolaD1 (U, |
126 | H.Position(), |
127 | H.MajorRadius(), |
128 | H.MinorRadius(), |
129 | P, V1); |
130 | } |
131 | |
132 | |
133 | inline void ElCLib::D2 ( |
134 | const Standard_Real U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) { |
135 | |
136 | ElCLib::HyperbolaD2 (U, |
137 | H.Position(), |
138 | H.MajorRadius(), |
139 | H.MinorRadius(), |
140 | P, V1, V2); |
141 | } |
142 | |
143 | |
144 | inline void ElCLib::D3 ( |
145 | const Standard_Real U, const gp_Hypr& H, |
146 | gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) { |
147 | |
148 | ElCLib::HyperbolaD3 (U, |
149 | H.Position(), |
150 | H.MajorRadius(), |
151 | H.MinorRadius(), |
152 | P, V1, V2, V3); |
153 | } |
154 | |
155 | |
156 | |
157 | inline gp_Pnt ElCLib::Value (const Standard_Real U, const gp_Parab& Prb) { |
158 | |
159 | return ElCLib::ParabolaValue (U, Prb.Position(), Prb.Focal()); |
160 | } |
161 | |
162 | |
163 | |
164 | inline void ElCLib::D1 ( |
165 | const Standard_Real U, const gp_Parab& Prb, gp_Pnt& P, gp_Vec& V1) { |
166 | |
167 | ElCLib::ParabolaD1 (U, Prb.Position(), Prb.Focal(), P, V1); |
168 | } |
169 | |
170 | |
171 | |
172 | inline void ElCLib::D2 ( |
173 | const Standard_Real U, const gp_Parab& Prb, |
174 | gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) { |
175 | |
176 | ElCLib::ParabolaD2 (U, Prb.Position(), Prb.Focal(), P, V1, V2); |
177 | } |
178 | |
179 | |
180 | |
181 | inline gp_Pnt2d ElCLib::Value (const Standard_Real U, const gp_Lin2d& L) { |
182 | |
183 | return ElCLib::LineValue (U, L.Position()); |
184 | } |
185 | |
186 | |
187 | inline gp_Pnt2d ElCLib::Value (const Standard_Real U, const gp_Circ2d& C) { |
188 | |
189 | return ElCLib::CircleValue (U, C.Axis(), C.Radius()); |
190 | } |
191 | |
192 | |
193 | inline gp_Pnt2d ElCLib::Value (const Standard_Real U, const gp_Elips2d& E) { |
194 | |
195 | return ElCLib::EllipseValue (U, E.Axis(), E.MajorRadius(), E.MinorRadius()); |
196 | } |
197 | |
198 | |
199 | inline gp_Pnt2d ElCLib::Value (const Standard_Real U, const gp_Hypr2d& H) { |
200 | |
201 | return ElCLib::HyperbolaValue (U, |
202 | H.Axis(), |
203 | H.MajorRadius(), |
204 | H.MinorRadius()); |
205 | } |
206 | |
207 | |
208 | inline gp_Pnt2d ElCLib::Value (const Standard_Real U, const gp_Parab2d& Prb) { |
209 | |
210 | return ElCLib::ParabolaValue (U, Prb.Axis(), Prb.Focal()); |
211 | } |
212 | |
213 | |
214 | inline void ElCLib::D1 ( |
215 | const Standard_Real U, const gp_Lin2d& L, gp_Pnt2d& P, gp_Vec2d& V1) { |
216 | |
217 | ElCLib::LineD1 (U, L.Position(), P, V1); |
218 | } |
219 | |
220 | |
221 | inline void ElCLib::D1 ( |
222 | const Standard_Real U, const gp_Circ2d& C, gp_Pnt2d& P, gp_Vec2d& V1) { |
223 | |
224 | ElCLib::CircleD1 (U, C.Axis(), C.Radius(), P, V1); |
225 | } |
226 | |
227 | |
228 | inline void ElCLib::D1 ( |
229 | const Standard_Real U, const gp_Elips2d& E, gp_Pnt2d& P, gp_Vec2d& V1) { |
230 | |
231 | ElCLib::EllipseD1 (U, E.Axis(), E.MajorRadius(), E.MinorRadius(), P, V1); |
232 | } |
233 | |
234 | |
235 | inline void ElCLib::D1 ( |
236 | const Standard_Real U, const gp_Hypr2d& H, gp_Pnt2d& P, gp_Vec2d& V1) { |
237 | ElCLib::HyperbolaD1 (U, H.Axis(), H.MajorRadius(), H.MinorRadius(), P, V1); |
238 | } |
239 | |
240 | |
241 | inline void ElCLib::D1 ( |
242 | const Standard_Real U, const gp_Parab2d& Prb, gp_Pnt2d& P, gp_Vec2d& V1) { |
243 | |
244 | ElCLib::ParabolaD1 (U, Prb.Axis(), Prb.Focal(), P, V1); |
245 | } |
246 | |
247 | |
248 | inline void ElCLib::D2 ( |
249 | const Standard_Real U, const gp_Circ2d& C, |
250 | gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) { |
251 | |
252 | ElCLib::CircleD2 (U, C.Axis(), C.Radius(), P, V1, V2); |
253 | } |
254 | |
255 | |
256 | inline void ElCLib::D2 ( |
257 | const Standard_Real U, const gp_Elips2d& E, |
258 | gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2){ |
259 | |
260 | ElCLib::EllipseD2 (U, E.Axis(), E.MajorRadius(), E.MinorRadius(), P, V1, V2); |
261 | } |
262 | |
263 | |
264 | inline void ElCLib::D2 ( |
265 | const Standard_Real U, const gp_Hypr2d& H, |
266 | gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) { |
267 | |
268 | ElCLib::HyperbolaD2 (U, |
269 | H.Axis(), |
270 | H.MajorRadius(), |
271 | H.MinorRadius(), |
272 | P, V1, V2); |
273 | } |
274 | |
275 | |
276 | inline void ElCLib::D2 ( |
277 | const Standard_Real U, const gp_Parab2d& Prb, |
278 | gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) { |
279 | |
280 | ElCLib::ParabolaD2 (U, Prb.Axis(), Prb.Focal(), P, V1, V2); |
281 | } |
282 | |
283 | |
284 | inline void ElCLib::D3 ( |
285 | const Standard_Real U, const gp_Circ2d& C, |
286 | gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) { |
287 | |
288 | ElCLib::CircleD3 (U, C.Axis(), C.Radius(), P, V1, V2, V3); |
289 | } |
290 | |
291 | |
292 | inline void ElCLib::D3 ( |
293 | const Standard_Real U, const gp_Elips2d& E, |
294 | gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) { |
295 | |
296 | ElCLib::EllipseD3 (U, |
297 | E.Axis(), |
298 | E.MajorRadius(), |
299 | E.MinorRadius(), |
300 | P, V1, V2, V3); |
301 | } |
302 | |
303 | |
304 | inline void ElCLib::D3 ( |
305 | const Standard_Real U, const gp_Hypr2d& H, |
306 | gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) { |
307 | |
308 | ElCLib::HyperbolaD3 (U, |
309 | H.Axis(), |
310 | H.MajorRadius(), |
311 | H.MinorRadius(), |
312 | P, V1, V2, V3); |
313 | } |
314 | |
315 | |
316 | |
317 | inline gp_Vec ElCLib::DN ( |
318 | const Standard_Real U, const gp_Lin& L, const Standard_Integer N) { |
319 | |
320 | return ElCLib::LineDN (U, L.Position(), N); |
321 | } |
322 | |
323 | |
324 | inline gp_Vec ElCLib::DN ( |
325 | const Standard_Real U, const gp_Circ& C, const Standard_Integer N) { |
326 | |
327 | return ElCLib::CircleDN (U, C.Position(), C.Radius(), N); |
328 | } |
329 | |
330 | |
331 | inline gp_Vec ElCLib::DN ( |
332 | const Standard_Real U, const gp_Elips& E, const Standard_Integer N) { |
333 | |
334 | return ElCLib::EllipseDN (U, |
335 | E.Position(), |
336 | E.MajorRadius(), |
337 | E.MinorRadius(), |
338 | N); |
339 | } |
340 | |
341 | |
342 | inline gp_Vec ElCLib::DN ( |
343 | const Standard_Real U, const gp_Hypr& H, const Standard_Integer N) { |
344 | |
345 | return ElCLib::HyperbolaDN (U, |
346 | H.Position(), |
347 | H.MajorRadius(), |
348 | H.MinorRadius(), |
349 | N); |
350 | } |
351 | |
352 | inline gp_Vec ElCLib::DN ( |
353 | const Standard_Real U, const gp_Parab& Prb, const Standard_Integer N) { |
354 | |
355 | return ElCLib::ParabolaDN (U, Prb.Position(), Prb.Focal(), N); |
356 | } |
357 | |
358 | |
359 | inline gp_Vec2d ElCLib::DN ( |
360 | const Standard_Real U, const gp_Lin2d& L, const Standard_Integer N) { |
361 | |
362 | return ElCLib::LineDN (U, L.Position(), N); |
363 | } |
364 | |
365 | |
366 | inline gp_Vec2d ElCLib::DN ( |
367 | const Standard_Real U, const gp_Circ2d& C, const Standard_Integer N) { |
368 | |
369 | return ElCLib::CircleDN (U, C.Axis(), C.Radius(), N); |
370 | } |
371 | |
372 | |
373 | inline gp_Vec2d ElCLib::DN ( |
374 | const Standard_Real U, const gp_Elips2d& E, const Standard_Integer N){ |
375 | return ElCLib::EllipseDN (U, E.Axis(), E.MajorRadius(), E.MinorRadius(), N); |
376 | } |
377 | |
378 | |
379 | inline gp_Vec2d ElCLib::DN ( |
380 | const Standard_Real U, const gp_Hypr2d& H, const Standard_Integer N) { |
381 | |
382 | return ElCLib::HyperbolaDN (U, |
383 | H.Axis(), |
384 | H.MajorRadius(), |
385 | H.MinorRadius(), |
386 | N); |
387 | } |
388 | |
389 | |
390 | inline gp_Vec2d ElCLib::DN ( |
391 | const Standard_Real U, const gp_Parab2d& Prb, const Standard_Integer N){ |
392 | |
393 | return ElCLib::ParabolaDN (U, Prb.Axis(), Prb.Focal(), N); |
394 | } |
395 | |
396 | |
397 | |
398 | inline Standard_Real ElCLib::Parameter (const gp_Lin& L, const gp_Pnt& P) { |
399 | |
400 | return ElCLib::LineParameter (L.Position(), P); |
401 | } |
402 | |
403 | |
404 | inline Standard_Real ElCLib::Parameter (const gp_Circ& C, const gp_Pnt& P) { |
405 | |
406 | return ElCLib::CircleParameter (C.Position(), P); |
407 | } |
408 | |
409 | |
410 | inline Standard_Real ElCLib::Parameter (const gp_Elips& E, const gp_Pnt& P) { |
411 | |
412 | return ElCLib::EllipseParameter (E.Position(), |
413 | E.MajorRadius(), |
414 | E.MinorRadius(), |
415 | P); |
416 | } |
417 | |
418 | |
419 | inline Standard_Real ElCLib::Parameter (const gp_Hypr& H, const gp_Pnt& P) { |
420 | |
421 | return ElCLib::HyperbolaParameter (H.Position(), |
422 | H.MajorRadius(), |
423 | H.MinorRadius(), |
424 | P); |
425 | } |
426 | |
427 | |
428 | inline Standard_Real ElCLib::Parameter (const gp_Parab& Prb, const gp_Pnt& P) { |
429 | |
430 | return ElCLib::ParabolaParameter (Prb.Position(), P); |
431 | } |
432 | |
433 | |
434 | |
435 | inline Standard_Real ElCLib::Parameter (const gp_Lin2d& L, const gp_Pnt2d& P) { |
436 | |
437 | return ElCLib::LineParameter (L.Position(), P); |
438 | } |
439 | |
440 | |
441 | inline Standard_Real ElCLib::Parameter ( |
442 | const gp_Circ2d& C, const gp_Pnt2d& P) { |
443 | |
444 | return ElCLib::CircleParameter (C.Axis(), P); |
445 | } |
446 | |
447 | |
448 | inline Standard_Real ElCLib::Parameter ( |
449 | const gp_Elips2d& E, const gp_Pnt2d& P) { |
450 | |
451 | return ElCLib::EllipseParameter (E.Axis(), |
452 | E.MajorRadius(), |
453 | E.MinorRadius(), |
454 | P); |
455 | } |
456 | |
457 | |
458 | inline Standard_Real ElCLib::Parameter ( |
459 | const gp_Hypr2d& H, const gp_Pnt2d& P) { |
460 | |
461 | return ElCLib::HyperbolaParameter (H.Axis(), |
462 | H.MajorRadius(), |
463 | H.MinorRadius(), |
464 | P); |
465 | } |
466 | |
467 | |
468 | inline Standard_Real ElCLib::Parameter ( |
469 | const gp_Parab2d& Prb, const gp_Pnt2d& P) { |
470 | |
471 | return ElCLib::ParabolaParameter (Prb.Axis(), P); |
472 | } |
473 | |
474 | |