1 // Created by: Jean-Claude Vauthier
2 // Copyright (c) 1995-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
17 #include <gp_Sphere.hxx>
18 #include <gp_Torus.hxx>
19 #include <gp_Cylinder.hxx>
20 #include <gp_Cone.hxx>
24 inline gp_Pnt ElSLib::Value (const Standard_Real U, const Standard_Real V, const gp_Pln& Pl) {
26 return ElSLib::PlaneValue (U, V, Pl.Position());
30 inline gp_Pnt ElSLib::Value (const Standard_Real U, const Standard_Real V, const gp_Cone& C) {
32 return ElSLib::ConeValue (U, V, C.Position(), C.RefRadius(), C.SemiAngle());
36 inline gp_Pnt ElSLib::Value (const Standard_Real U, const Standard_Real V, const gp_Cylinder& C) {
38 return ElSLib::CylinderValue (U, V, C.Position(), C.Radius());
42 inline gp_Pnt ElSLib::Value (const Standard_Real U, const Standard_Real V, const gp_Sphere& S) {
44 return ElSLib::SphereValue (U, V, S.Position(), S.Radius());
48 inline gp_Pnt ElSLib::Value (const Standard_Real U, const Standard_Real V, const gp_Torus& T) {
50 return ElSLib::TorusValue (U, V, T.Position(), T.MajorRadius(), T.MinorRadius());
55 inline gp_Vec ElSLib::DN (const Standard_Real U, const Standard_Real V, const gp_Pln& Pl, const Standard_Integer Nu, const Standard_Integer Nv) {
57 return ElSLib::PlaneDN (U, V, Pl.Position(), Nu, Nv);
61 inline gp_Vec ElSLib::DN (const Standard_Real U, const Standard_Real V, const gp_Cone& C, const Standard_Integer Nu, const Standard_Integer Nv) {
63 return ElSLib::ConeDN (U, V, C.Position(), C.RefRadius(), C.SemiAngle(), Nu, Nv);
67 inline gp_Vec ElSLib::DN (const Standard_Real U, const Standard_Real V, const gp_Cylinder& C, const Standard_Integer Nu, const Standard_Integer Nv) {
69 return ElSLib::CylinderDN (U, V, C.Position(), C.Radius(), Nu, Nv);
73 inline gp_Vec ElSLib::DN (const Standard_Real U, const Standard_Real V, const gp_Sphere& S, const Standard_Integer Nu, const Standard_Integer Nv) {
75 return ElSLib::SphereDN (U, V, S.Position(), S.Radius(), Nu, Nv);
79 inline gp_Vec ElSLib::DN (const Standard_Real U, const Standard_Real V, const gp_Torus& T, const Standard_Integer Nu, const Standard_Integer Nv) {
81 return ElSLib::TorusDN (U, V, T.Position(), T.MajorRadius(), T.MinorRadius(), Nu, Nv);
87 inline void ElSLib::D0 (const Standard_Real U, const Standard_Real V, const gp_Pln& Pl, gp_Pnt& P) {
89 ElSLib::PlaneD0 (U, V, Pl.Position(), P);
92 inline void ElSLib::D0 (const Standard_Real U, const Standard_Real V, const gp_Cone& C, gp_Pnt& P) {
94 ElSLib::ConeD0 (U, V, C.Position(), C.RefRadius(), C.SemiAngle(), P);
97 inline void ElSLib::D0 (const Standard_Real U, const Standard_Real V, const gp_Cylinder& C, gp_Pnt& P) {
99 ElSLib::CylinderD0 (U, V, C.Position(), C.Radius(), P);
102 inline void ElSLib::D0 (const Standard_Real U, const Standard_Real V, const gp_Sphere& S, gp_Pnt& P) {
104 ElSLib::SphereD0 (U, V, S.Position(), S.Radius(), P);
107 inline void ElSLib::D0 (const Standard_Real U, const Standard_Real V, const gp_Torus& T, gp_Pnt& P) {
109 ElSLib::TorusD0 (U, V, T.Position(), T.MajorRadius(), T.MinorRadius(), P);
114 inline void ElSLib::D1 (const Standard_Real U, const Standard_Real V, const gp_Pln& Pl, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv) {
116 ElSLib::PlaneD1 (U, V, Pl.Position(), P, Vu, Vv);
120 inline void ElSLib::D1 (const Standard_Real U, const Standard_Real V, const gp_Cone& C, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv) {
122 ElSLib::ConeD1 (U, V, C.Position(), C.RefRadius(), C.SemiAngle(), P, Vu, Vv);
126 inline void ElSLib::D1 (const Standard_Real U, const Standard_Real V, const gp_Cylinder& C, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv) {
128 ElSLib::CylinderD1 (U, V, C.Position(), C.Radius(), P, Vu, Vv);
132 inline void ElSLib::D1 (const Standard_Real U, const Standard_Real V, const gp_Sphere& S, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv) {
134 ElSLib::SphereD1 (U, V, S.Position(), S.Radius(), P, Vu, Vv);
138 inline void ElSLib::D1 (const Standard_Real U, const Standard_Real V, const gp_Torus& T, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv) {
140 ElSLib::TorusD1 (U, V, T.Position(), T.MajorRadius(), T.MinorRadius(), P, Vu, Vv);
145 inline void ElSLib::D2 (const Standard_Real U, const Standard_Real V, const gp_Cone& C, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv, gp_Vec& Vuu, gp_Vec& Vvv, gp_Vec& Vuv) {
147 ElSLib::ConeD2 (U, V, C.Position(), C.RefRadius(), C.SemiAngle(), P, Vu, Vv, Vuu, Vvv, Vuv);
151 inline void ElSLib::D2 (const Standard_Real U, const Standard_Real V, const gp_Cylinder& C, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv, gp_Vec& Vuu, gp_Vec& Vvv, gp_Vec& Vuv) {
153 ElSLib::CylinderD2 (U, V, C.Position(), C.Radius(), P, Vu, Vv, Vuu, Vvv, Vuv);
157 inline void ElSLib::D2 (const Standard_Real U, const Standard_Real V, const gp_Sphere& S, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv, gp_Vec& Vuu, gp_Vec& Vvv, gp_Vec& Vuv) {
159 ElSLib::SphereD2 (U, V, S.Position(), S.Radius(), P, Vu, Vv, Vuu, Vvv, Vuv);
163 inline void ElSLib::D2 (const Standard_Real U, const Standard_Real V, const gp_Torus& T, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv, gp_Vec& Vuu, gp_Vec& Vvv, gp_Vec& Vuv) {
165 ElSLib::TorusD2 (U, V, T.Position(), T.MajorRadius(), T.MinorRadius(), P, Vu, Vv, Vuu, Vvv, Vuv);
171 inline void ElSLib::D3 (const Standard_Real U, const Standard_Real V, const gp_Cone& C, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv, gp_Vec& Vuu, gp_Vec& Vvv, gp_Vec& Vuv, gp_Vec& Vuuu, gp_Vec& Vvvv, gp_Vec& Vuuv, gp_Vec& Vuvv) {
173 ElSLib::ConeD3 (U, V, C.Position(), C.RefRadius(), C.SemiAngle(), P, Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv);
177 inline void ElSLib::D3 (const Standard_Real U, const Standard_Real V, const gp_Cylinder& C, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv, gp_Vec& Vuu, gp_Vec& Vvv, gp_Vec& Vuv, gp_Vec& Vuuu, gp_Vec& Vvvv, gp_Vec& Vuuv, gp_Vec& Vuvv) {
179 ElSLib::CylinderD3 (U, V, C.Position(), C.Radius(), P, Vu, Vv, Vuu, Vvv, Vuv,Vuuu, Vvvv, Vuuv, Vuvv);
183 inline void ElSLib::D3 (const Standard_Real U, const Standard_Real V, const gp_Sphere& S, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv, gp_Vec& Vuu, gp_Vec& Vvv, gp_Vec& Vuv, gp_Vec& Vuuu, gp_Vec& Vvvv, gp_Vec& Vuuv, gp_Vec& Vuvv) {
185 ElSLib::SphereD3 (U, V, S.Position(), S.Radius(), P, Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv);
189 inline void ElSLib::D3 (const Standard_Real U, const Standard_Real V, const gp_Torus& T, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv, gp_Vec& Vuu, gp_Vec& Vvv, gp_Vec& Vuv, gp_Vec& Vuuu, gp_Vec& Vvvv, gp_Vec& Vuuv, gp_Vec& Vuvv) {
191 ElSLib::TorusD3 (U, V, T.Position(), T.MajorRadius(), T.MinorRadius(), P, Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv);
197 inline void ElSLib::Parameters(const gp_Pln& Pl,
202 ElSLib::PlaneParameters(Pl.Position(),P,U,V);
206 inline void ElSLib::Parameters(const gp_Cylinder& C,
211 ElSLib::CylinderParameters(C.Position(),C.Radius(),P,U,V);
215 inline void ElSLib::Parameters(const gp_Cone& C,
220 ElSLib::ConeParameters(C.Position(),C.RefRadius(),C.SemiAngle(),P,U,V);
224 inline void ElSLib::Parameters(const gp_Sphere& S,
229 ElSLib::SphereParameters(S.Position(),S.Radius(),P,U,V);
233 inline void ElSLib::Parameters(const gp_Torus& T,
238 ElSLib::TorusParameters(T.Position(),T.MajorRadius(),T.MinorRadius(),P,U,V);