1 // Created on: 1991-12-17
2 // Created by: Jean-Claude Vauthier
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.
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>
29 inline gp_Pnt ElCLib::Value (const Standard_Real U, const gp_Lin& L) {
31 return ElCLib::LineValue (U, L.Position());
36 inline gp_Pnt ElCLib::Value (const Standard_Real U, const gp_Circ& C) {
38 return ElCLib::CircleValue (U, C.Position(), C.Radius());
42 inline void ElCLib::D1 (
43 const Standard_Real U, const gp_Lin& L, gp_Pnt& P, gp_Vec& V1) {
45 ElCLib::LineD1 (U, L.Position(), P, V1);
49 inline void ElCLib::D1 (
50 const Standard_Real U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1) {
52 ElCLib::CircleD1 (U, C.Position(), C.Radius(), P, V1);
56 inline void ElCLib::D2 (
57 const Standard_Real U, const gp_Circ& C, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) {
59 ElCLib::CircleD2 (U, C.Position(), C.Radius(), P, V1, V2);
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) {
67 ElCLib::CircleD3 (U, C.Position(), C.Radius(), P, V1, V2, V3);
72 inline gp_Pnt ElCLib::Value (const Standard_Real U, const gp_Elips& E) {
73 return ElCLib::EllipseValue (U,
80 inline void ElCLib::D1 (
81 const Standard_Real U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1) {
83 ElCLib::EllipseD1 (U, E.Position(), E.MajorRadius(), E.MinorRadius(), P, V1);
88 inline void ElCLib::D2 (
89 const Standard_Real U, const gp_Elips& E, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) {
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) {
103 ElCLib::EllipseD3 (U,
112 inline gp_Pnt ElCLib::Value (const Standard_Real U, const gp_Hypr& H) {
114 return ElCLib::HyperbolaValue (U,
122 inline void ElCLib::D1 (
123 const Standard_Real U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1) {
125 ElCLib::HyperbolaD1 (U,
133 inline void ElCLib::D2 (
134 const Standard_Real U, const gp_Hypr& H, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) {
136 ElCLib::HyperbolaD2 (U,
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) {
148 ElCLib::HyperbolaD3 (U,
157 inline gp_Pnt ElCLib::Value (const Standard_Real U, const gp_Parab& Prb) {
159 return ElCLib::ParabolaValue (U, Prb.Position(), Prb.Focal());
164 inline void ElCLib::D1 (
165 const Standard_Real U, const gp_Parab& Prb, gp_Pnt& P, gp_Vec& V1) {
167 ElCLib::ParabolaD1 (U, Prb.Position(), Prb.Focal(), P, V1);
172 inline void ElCLib::D2 (
173 const Standard_Real U, const gp_Parab& Prb,
174 gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) {
176 ElCLib::ParabolaD2 (U, Prb.Position(), Prb.Focal(), P, V1, V2);
181 inline gp_Pnt2d ElCLib::Value (const Standard_Real U, const gp_Lin2d& L) {
183 return ElCLib::LineValue (U, L.Position());
187 inline gp_Pnt2d ElCLib::Value (const Standard_Real U, const gp_Circ2d& C) {
189 return ElCLib::CircleValue (U, C.Axis(), C.Radius());
193 inline gp_Pnt2d ElCLib::Value (const Standard_Real U, const gp_Elips2d& E) {
195 return ElCLib::EllipseValue (U, E.Axis(), E.MajorRadius(), E.MinorRadius());
199 inline gp_Pnt2d ElCLib::Value (const Standard_Real U, const gp_Hypr2d& H) {
201 return ElCLib::HyperbolaValue (U,
208 inline gp_Pnt2d ElCLib::Value (const Standard_Real U, const gp_Parab2d& Prb) {
210 return ElCLib::ParabolaValue (U, Prb.Axis(), Prb.Focal());
214 inline void ElCLib::D1 (
215 const Standard_Real U, const gp_Lin2d& L, gp_Pnt2d& P, gp_Vec2d& V1) {
217 ElCLib::LineD1 (U, L.Position(), P, V1);
221 inline void ElCLib::D1 (
222 const Standard_Real U, const gp_Circ2d& C, gp_Pnt2d& P, gp_Vec2d& V1) {
224 ElCLib::CircleD1 (U, C.Axis(), C.Radius(), P, V1);
228 inline void ElCLib::D1 (
229 const Standard_Real U, const gp_Elips2d& E, gp_Pnt2d& P, gp_Vec2d& V1) {
231 ElCLib::EllipseD1 (U, E.Axis(), E.MajorRadius(), E.MinorRadius(), P, V1);
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);
241 inline void ElCLib::D1 (
242 const Standard_Real U, const gp_Parab2d& Prb, gp_Pnt2d& P, gp_Vec2d& V1) {
244 ElCLib::ParabolaD1 (U, Prb.Axis(), Prb.Focal(), P, V1);
248 inline void ElCLib::D2 (
249 const Standard_Real U, const gp_Circ2d& C,
250 gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) {
252 ElCLib::CircleD2 (U, C.Axis(), C.Radius(), P, V1, V2);
256 inline void ElCLib::D2 (
257 const Standard_Real U, const gp_Elips2d& E,
258 gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2){
260 ElCLib::EllipseD2 (U, E.Axis(), E.MajorRadius(), E.MinorRadius(), P, V1, V2);
264 inline void ElCLib::D2 (
265 const Standard_Real U, const gp_Hypr2d& H,
266 gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) {
268 ElCLib::HyperbolaD2 (U,
276 inline void ElCLib::D2 (
277 const Standard_Real U, const gp_Parab2d& Prb,
278 gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) {
280 ElCLib::ParabolaD2 (U, Prb.Axis(), Prb.Focal(), P, V1, V2);
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) {
288 ElCLib::CircleD3 (U, C.Axis(), C.Radius(), P, V1, V2, V3);
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) {
296 ElCLib::EllipseD3 (U,
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) {
308 ElCLib::HyperbolaD3 (U,
317 inline gp_Vec ElCLib::DN (
318 const Standard_Real U, const gp_Lin& L, const Standard_Integer N) {
320 return ElCLib::LineDN (U, L.Position(), N);
324 inline gp_Vec ElCLib::DN (
325 const Standard_Real U, const gp_Circ& C, const Standard_Integer N) {
327 return ElCLib::CircleDN (U, C.Position(), C.Radius(), N);
331 inline gp_Vec ElCLib::DN (
332 const Standard_Real U, const gp_Elips& E, const Standard_Integer N) {
334 return ElCLib::EllipseDN (U,
342 inline gp_Vec ElCLib::DN (
343 const Standard_Real U, const gp_Hypr& H, const Standard_Integer N) {
345 return ElCLib::HyperbolaDN (U,
352 inline gp_Vec ElCLib::DN (
353 const Standard_Real U, const gp_Parab& Prb, const Standard_Integer N) {
355 return ElCLib::ParabolaDN (U, Prb.Position(), Prb.Focal(), N);
359 inline gp_Vec2d ElCLib::DN (
360 const Standard_Real U, const gp_Lin2d& L, const Standard_Integer N) {
362 return ElCLib::LineDN (U, L.Position(), N);
366 inline gp_Vec2d ElCLib::DN (
367 const Standard_Real U, const gp_Circ2d& C, const Standard_Integer N) {
369 return ElCLib::CircleDN (U, C.Axis(), C.Radius(), N);
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);
379 inline gp_Vec2d ElCLib::DN (
380 const Standard_Real U, const gp_Hypr2d& H, const Standard_Integer N) {
382 return ElCLib::HyperbolaDN (U,
390 inline gp_Vec2d ElCLib::DN (
391 const Standard_Real U, const gp_Parab2d& Prb, const Standard_Integer N){
393 return ElCLib::ParabolaDN (U, Prb.Axis(), Prb.Focal(), N);
398 inline Standard_Real ElCLib::Parameter (const gp_Lin& L, const gp_Pnt& P) {
400 return ElCLib::LineParameter (L.Position(), P);
404 inline Standard_Real ElCLib::Parameter (const gp_Circ& C, const gp_Pnt& P) {
406 return ElCLib::CircleParameter (C.Position(), P);
410 inline Standard_Real ElCLib::Parameter (const gp_Elips& E, const gp_Pnt& P) {
412 return ElCLib::EllipseParameter (E.Position(),
419 inline Standard_Real ElCLib::Parameter (const gp_Hypr& H, const gp_Pnt& P) {
421 return ElCLib::HyperbolaParameter (H.Position(),
428 inline Standard_Real ElCLib::Parameter (const gp_Parab& Prb, const gp_Pnt& P) {
430 return ElCLib::ParabolaParameter (Prb.Position(), P);
435 inline Standard_Real ElCLib::Parameter (const gp_Lin2d& L, const gp_Pnt2d& P) {
437 return ElCLib::LineParameter (L.Position(), P);
441 inline Standard_Real ElCLib::Parameter (
442 const gp_Circ2d& C, const gp_Pnt2d& P) {
444 return ElCLib::CircleParameter (C.Axis(), P);
448 inline Standard_Real ElCLib::Parameter (
449 const gp_Elips2d& E, const gp_Pnt2d& P) {
451 return ElCLib::EllipseParameter (E.Axis(),
458 inline Standard_Real ElCLib::Parameter (
459 const gp_Hypr2d& H, const gp_Pnt2d& P) {
461 return ElCLib::HyperbolaParameter (H.Axis(),
468 inline Standard_Real ElCLib::Parameter (
469 const gp_Parab2d& Prb, const gp_Pnt2d& P) {
471 return ElCLib::ParabolaParameter (Prb.Axis(), P);