b311480e |
1 | // Created by: Jean-Claude Vauthier |
2 | // Copyright (c) 1995-1999 Matra Datavision |
3 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
4 | // |
5 | // The content of this file is subject to the Open CASCADE Technology Public |
6 | // License Version 6.5 (the "License"). You may not use the content of this file |
7 | // except in compliance with the License. Please obtain a copy of the License |
8 | // at http://www.opencascade.org and read it completely before using this file. |
9 | // |
10 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | // |
13 | // The Original Code and all software distributed under the License is |
14 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | // Initial Developer hereby disclaims all such warranties, including without |
16 | // limitation, any warranties of merchantability, fitness for a particular |
17 | // purpose or non-infringement. Please see the License for the specific terms |
18 | // and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | |
21 | #include <gp_Pln.hxx> |
22 | #include <gp_Sphere.hxx> |
23 | #include <gp_Torus.hxx> |
24 | #include <gp_Cylinder.hxx> |
25 | #include <gp_Cone.hxx> |
26 | #include <gp_Ax3.hxx> |
27 | |
28 | |
29 | inline gp_Pnt ElSLib::Value (const Standard_Real U, const Standard_Real V, const gp_Pln& Pl) { |
30 | |
31 | return ElSLib::PlaneValue (U, V, Pl.Position()); |
32 | } |
33 | |
34 | |
35 | inline gp_Pnt ElSLib::Value (const Standard_Real U, const Standard_Real V, const gp_Cone& C) { |
36 | |
37 | return ElSLib::ConeValue (U, V, C.Position(), C.RefRadius(), C.SemiAngle()); |
38 | } |
39 | |
40 | |
41 | inline gp_Pnt ElSLib::Value (const Standard_Real U, const Standard_Real V, const gp_Cylinder& C) { |
42 | |
43 | return ElSLib::CylinderValue (U, V, C.Position(), C.Radius()); |
44 | } |
45 | |
46 | |
47 | inline gp_Pnt ElSLib::Value (const Standard_Real U, const Standard_Real V, const gp_Sphere& S) { |
48 | |
49 | return ElSLib::SphereValue (U, V, S.Position(), S.Radius()); |
50 | } |
51 | |
52 | |
53 | inline gp_Pnt ElSLib::Value (const Standard_Real U, const Standard_Real V, const gp_Torus& T) { |
54 | |
55 | return ElSLib::TorusValue (U, V, T.Position(), T.MajorRadius(), T.MinorRadius()); |
56 | } |
57 | |
58 | |
59 | |
60 | 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) { |
61 | |
62 | return ElSLib::PlaneDN (U, V, Pl.Position(), Nu, Nv); |
63 | } |
64 | |
65 | |
66 | 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) { |
67 | |
68 | return ElSLib::ConeDN (U, V, C.Position(), C.RefRadius(), C.SemiAngle(), Nu, Nv); |
69 | } |
70 | |
71 | |
72 | 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) { |
73 | |
74 | return ElSLib::CylinderDN (U, V, C.Position(), C.Radius(), Nu, Nv); |
75 | } |
76 | |
77 | |
78 | 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) { |
79 | |
80 | return ElSLib::SphereDN (U, V, S.Position(), S.Radius(), Nu, Nv); |
81 | } |
82 | |
83 | |
84 | 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) { |
85 | |
86 | return ElSLib::TorusDN (U, V, T.Position(), T.MajorRadius(), T.MinorRadius(), Nu, Nv); |
87 | } |
88 | |
89 | |
90 | |
91 | |
92 | inline void ElSLib::D0 (const Standard_Real U, const Standard_Real V, const gp_Pln& Pl, gp_Pnt& P) { |
93 | |
94 | ElSLib::PlaneD0 (U, V, Pl.Position(), P); |
95 | } |
96 | |
97 | inline void ElSLib::D0 (const Standard_Real U, const Standard_Real V, const gp_Cone& C, gp_Pnt& P) { |
98 | |
99 | ElSLib::ConeD0 (U, V, C.Position(), C.RefRadius(), C.SemiAngle(), P); |
100 | } |
101 | |
102 | inline void ElSLib::D0 (const Standard_Real U, const Standard_Real V, const gp_Cylinder& C, gp_Pnt& P) { |
103 | |
104 | ElSLib::CylinderD0 (U, V, C.Position(), C.Radius(), P); |
105 | } |
106 | |
107 | inline void ElSLib::D0 (const Standard_Real U, const Standard_Real V, const gp_Sphere& S, gp_Pnt& P) { |
108 | |
109 | ElSLib::SphereD0 (U, V, S.Position(), S.Radius(), P); |
110 | } |
111 | |
112 | inline void ElSLib::D0 (const Standard_Real U, const Standard_Real V, const gp_Torus& T, gp_Pnt& P) { |
113 | |
114 | ElSLib::TorusD0 (U, V, T.Position(), T.MajorRadius(), T.MinorRadius(), P); |
115 | } |
116 | |
117 | |
118 | |
119 | 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) { |
120 | |
121 | ElSLib::PlaneD1 (U, V, Pl.Position(), P, Vu, Vv); |
122 | } |
123 | |
124 | |
125 | 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) { |
126 | |
127 | ElSLib::ConeD1 (U, V, C.Position(), C.RefRadius(), C.SemiAngle(), P, Vu, Vv); |
128 | } |
129 | |
130 | |
131 | 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) { |
132 | |
133 | ElSLib::CylinderD1 (U, V, C.Position(), C.Radius(), P, Vu, Vv); |
134 | } |
135 | |
136 | |
137 | 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) { |
138 | |
139 | ElSLib::SphereD1 (U, V, S.Position(), S.Radius(), P, Vu, Vv); |
140 | } |
141 | |
142 | |
143 | 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) { |
144 | |
145 | ElSLib::TorusD1 (U, V, T.Position(), T.MajorRadius(), T.MinorRadius(), P, Vu, Vv); |
146 | } |
147 | |
148 | |
149 | |
150 | 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) { |
151 | |
152 | ElSLib::ConeD2 (U, V, C.Position(), C.RefRadius(), C.SemiAngle(), P, Vu, Vv, Vuu, Vvv, Vuv); |
153 | } |
154 | |
155 | |
156 | 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) { |
157 | |
158 | ElSLib::CylinderD2 (U, V, C.Position(), C.Radius(), P, Vu, Vv, Vuu, Vvv, Vuv); |
159 | } |
160 | |
161 | |
162 | 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) { |
163 | |
164 | ElSLib::SphereD2 (U, V, S.Position(), S.Radius(), P, Vu, Vv, Vuu, Vvv, Vuv); |
165 | } |
166 | |
167 | |
168 | 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) { |
169 | |
170 | ElSLib::TorusD2 (U, V, T.Position(), T.MajorRadius(), T.MinorRadius(), P, Vu, Vv, Vuu, Vvv, Vuv); |
171 | } |
172 | |
173 | |
174 | |
175 | |
176 | 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) { |
177 | |
178 | ElSLib::ConeD3 (U, V, C.Position(), C.RefRadius(), C.SemiAngle(), P, Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv); |
179 | } |
180 | |
181 | |
182 | 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) { |
183 | |
184 | ElSLib::CylinderD3 (U, V, C.Position(), C.Radius(), P, Vu, Vv, Vuu, Vvv, Vuv,Vuuu, Vvvv, Vuuv, Vuvv); |
185 | } |
186 | |
187 | |
188 | 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) { |
189 | |
190 | ElSLib::SphereD3 (U, V, S.Position(), S.Radius(), P, Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv); |
191 | } |
192 | |
193 | |
194 | 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) { |
195 | |
196 | ElSLib::TorusD3 (U, V, T.Position(), T.MajorRadius(), T.MinorRadius(), P, Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv); |
197 | } |
198 | |
199 | |
200 | |
201 | |
202 | inline void ElSLib::Parameters(const gp_Pln& Pl, |
203 | const gp_Pnt& P, |
204 | Standard_Real& U, |
205 | Standard_Real& V) { |
206 | |
207 | ElSLib::PlaneParameters(Pl.Position(),P,U,V); |
208 | } |
209 | |
210 | |
211 | inline void ElSLib::Parameters(const gp_Cylinder& C, |
212 | const gp_Pnt& P, |
213 | Standard_Real& U, |
214 | Standard_Real& V) { |
215 | |
216 | ElSLib::CylinderParameters(C.Position(),C.Radius(),P,U,V); |
217 | } |
218 | |
219 | |
220 | inline void ElSLib::Parameters(const gp_Cone& C, |
221 | const gp_Pnt& P, |
222 | Standard_Real& U, |
223 | Standard_Real& V) { |
224 | |
225 | ElSLib::ConeParameters(C.Position(),C.RefRadius(),C.SemiAngle(),P,U,V); |
226 | } |
227 | |
228 | |
229 | inline void ElSLib::Parameters(const gp_Sphere& S, |
230 | const gp_Pnt& P, |
231 | Standard_Real& U, |
232 | Standard_Real& V) { |
233 | |
234 | ElSLib::SphereParameters(S.Position(),S.Radius(),P,U,V); |
235 | } |
236 | |
237 | |
238 | inline void ElSLib::Parameters(const gp_Torus& T, |
239 | const gp_Pnt& P, |
240 | Standard_Real& U, |
241 | Standard_Real& V) { |
242 | |
243 | ElSLib::TorusParameters(T.Position(),T.MajorRadius(),T.MinorRadius(),P,U,V); |
244 | } |
245 | |
246 | |