b311480e |
1 | // Created by: Laurent BUCHARD |
2 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
3 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
7fd59977 |
15 | |
16 | #include <gp_Pnt.hxx> |
17 | #include <gp_Vec.hxx> |
18 | #include <gp_Pln.hxx> |
19 | #include <gp_Cylinder.hxx> |
20 | #include <gp_Cone.hxx> |
21 | #include <gp_Torus.hxx> |
22 | #include <gp_Sphere.hxx> |
23 | #include <gp_Ax1.hxx> |
24 | #include <gp_Dir.hxx> |
cb389a77 |
25 | #include <Geom_BezierSurface.hxx> |
26 | #include <Geom_BSplineSurface.hxx> |
c22b52d6 |
27 | #include <Adaptor3d_Surface.hxx> |
28 | #include <Adaptor3d_Curve.hxx> |
7fd59977 |
29 | #include <BRepAdaptor_Surface.hxx> |
30 | |
31 | //======================================================================= |
32 | //function : FirstUParameter |
33 | //purpose : |
34 | //======================================================================= |
35 | |
36 | inline Standard_Real |
37 | HLRBRep_BSurfaceTool::FirstUParameter(const BRepAdaptor_Surface& Surf) |
38 | { return Surf.FirstUParameter(); } |
39 | |
40 | //======================================================================= |
41 | //function : FirstVParameter |
42 | //purpose : |
43 | //======================================================================= |
44 | |
45 | inline Standard_Real |
46 | HLRBRep_BSurfaceTool::FirstVParameter(const BRepAdaptor_Surface& Surf) |
47 | { return Surf.FirstVParameter(); } |
48 | |
49 | //======================================================================= |
50 | //function : LastUParameter |
51 | //purpose : |
52 | //======================================================================= |
53 | |
54 | inline Standard_Real |
55 | HLRBRep_BSurfaceTool::LastUParameter(const BRepAdaptor_Surface& Surf) |
56 | { return Surf.LastUParameter(); } |
57 | |
58 | //======================================================================= |
59 | //function : LastVParameter |
60 | //purpose : |
61 | //======================================================================= |
62 | |
63 | inline Standard_Real |
64 | HLRBRep_BSurfaceTool::LastVParameter(const BRepAdaptor_Surface& Surf) |
65 | { return Surf.LastVParameter(); } |
66 | |
67 | //======================================================================= |
68 | //function : NbUIntervals |
69 | //purpose : |
70 | //======================================================================= |
71 | |
72 | inline Standard_Integer |
73 | HLRBRep_BSurfaceTool::NbUIntervals(const BRepAdaptor_Surface& Surf, |
74 | const GeomAbs_Shape S) |
75 | { return Surf.NbUIntervals(S); } |
76 | |
77 | //======================================================================= |
78 | //function : NbVIntervals |
79 | //purpose : |
80 | //======================================================================= |
81 | |
82 | inline Standard_Integer |
83 | HLRBRep_BSurfaceTool::NbVIntervals(const BRepAdaptor_Surface& Surf, |
84 | const GeomAbs_Shape S) |
85 | { return Surf.NbVIntervals(S); } |
86 | |
87 | //======================================================================= |
88 | //function : UIntervals |
89 | //purpose : |
90 | //======================================================================= |
91 | |
92 | inline void |
93 | HLRBRep_BSurfaceTool::UIntervals(const BRepAdaptor_Surface& Surf, |
94 | TColStd_Array1OfReal& Tab, |
95 | const GeomAbs_Shape S) |
96 | { Surf.UIntervals(Tab,S); } |
97 | |
98 | //======================================================================= |
99 | //function : VIntervals |
100 | //purpose : |
101 | //======================================================================= |
102 | |
103 | inline void |
104 | HLRBRep_BSurfaceTool::VIntervals(const BRepAdaptor_Surface& Surf, |
105 | TColStd_Array1OfReal& Tab, |
106 | const GeomAbs_Shape S) |
107 | { Surf.VIntervals(Tab,S); } |
108 | |
109 | |
110 | //======================================================================= |
111 | //function : UTrim |
112 | //purpose : |
113 | //======================================================================= |
114 | |
c22b52d6 |
115 | inline Handle(Adaptor3d_Surface) |
7fd59977 |
116 | HLRBRep_BSurfaceTool::UTrim(const BRepAdaptor_Surface& Surf, |
117 | const Standard_Real F, |
118 | const Standard_Real L, |
119 | const Standard_Real Tol) |
120 | { return Surf.UTrim(F,L,Tol); } |
121 | |
122 | //======================================================================= |
123 | //function : VTrim |
124 | //purpose : |
125 | //======================================================================= |
126 | |
c22b52d6 |
127 | inline Handle(Adaptor3d_Surface) |
7fd59977 |
128 | HLRBRep_BSurfaceTool::VTrim(const BRepAdaptor_Surface& Surf, |
129 | const Standard_Real F, |
130 | const Standard_Real L, |
131 | const Standard_Real Tol) |
132 | { return Surf.VTrim(F,L,Tol); } |
133 | |
134 | //======================================================================= |
135 | //function : IsUClosed |
136 | //purpose : |
137 | //======================================================================= |
138 | |
139 | inline Standard_Boolean |
140 | HLRBRep_BSurfaceTool::IsUClosed(const BRepAdaptor_Surface& S) |
141 | { return S.IsUClosed(); } |
142 | |
143 | //======================================================================= |
144 | //function : IsVClosed |
145 | //purpose : |
146 | //======================================================================= |
147 | |
148 | inline Standard_Boolean |
149 | HLRBRep_BSurfaceTool::IsVClosed(const BRepAdaptor_Surface& S) |
150 | { return S.IsVClosed(); } |
151 | |
152 | //======================================================================= |
153 | //function : IsUPeriodic |
154 | //purpose : |
155 | //======================================================================= |
156 | |
157 | inline Standard_Boolean |
158 | HLRBRep_BSurfaceTool::IsUPeriodic(const BRepAdaptor_Surface& S) |
159 | { return S.IsUPeriodic(); } |
160 | |
161 | //======================================================================= |
162 | //function : UPeriod |
163 | //purpose : |
164 | //======================================================================= |
165 | |
166 | inline Standard_Real |
167 | HLRBRep_BSurfaceTool::UPeriod(const BRepAdaptor_Surface& S) |
168 | { return S.UPeriod(); } |
169 | |
170 | //======================================================================= |
171 | //function : IsVPeriodic |
172 | //purpose : |
173 | //======================================================================= |
174 | |
175 | inline Standard_Boolean |
176 | HLRBRep_BSurfaceTool::IsVPeriodic(const BRepAdaptor_Surface& S) |
177 | { return S.IsVPeriodic(); } |
178 | |
179 | //======================================================================= |
180 | //function : VPeriod |
181 | //purpose : |
182 | //======================================================================= |
183 | |
184 | inline Standard_Real |
185 | HLRBRep_BSurfaceTool::VPeriod(const BRepAdaptor_Surface& S) |
186 | { return S.VPeriod(); } |
187 | |
188 | //======================================================================= |
189 | //function : Value |
190 | //purpose : |
191 | //======================================================================= |
192 | |
193 | inline gp_Pnt |
194 | HLRBRep_BSurfaceTool::Value(const BRepAdaptor_Surface& S, |
195 | const Standard_Real U, |
196 | const Standard_Real V ) |
197 | { return S.Value(U,V); } |
198 | |
199 | //======================================================================= |
200 | //function : D0 |
201 | //purpose : |
202 | //======================================================================= |
203 | |
204 | inline void |
205 | HLRBRep_BSurfaceTool::D0(const BRepAdaptor_Surface& S, |
206 | const Standard_Real U, |
207 | const Standard_Real V, |
208 | gp_Pnt& P) |
209 | { S.D0(U,V,P); } |
210 | |
211 | //======================================================================= |
212 | //function : D1 |
213 | //purpose : |
214 | //======================================================================= |
215 | |
216 | inline void |
217 | HLRBRep_BSurfaceTool::D1(const BRepAdaptor_Surface& S, |
218 | const Standard_Real U, |
219 | const Standard_Real V, |
220 | gp_Pnt& P, |
221 | gp_Vec& D1U, |
222 | gp_Vec& D1V) |
223 | { S.D1(U,V,P,D1U,D1V); } |
224 | |
225 | //======================================================================= |
226 | //function : D2 |
227 | //purpose : |
228 | //======================================================================= |
229 | |
230 | inline void |
231 | HLRBRep_BSurfaceTool::D2(const BRepAdaptor_Surface& S, |
232 | const Standard_Real U, |
233 | const Standard_Real V, |
234 | gp_Pnt& P, |
235 | gp_Vec& D1U, |
236 | gp_Vec& D1V, |
237 | gp_Vec& D2U, |
238 | gp_Vec& D2V, |
239 | gp_Vec& D2UV) |
240 | { S.D2(U,V,P,D1U,D1V,D2U,D2V,D2UV); } |
241 | |
242 | //======================================================================= |
243 | //function : D3 |
244 | //purpose : |
245 | //======================================================================= |
246 | |
247 | inline void |
248 | HLRBRep_BSurfaceTool::D3(const BRepAdaptor_Surface& S, |
249 | const Standard_Real U, |
250 | const Standard_Real V, |
251 | gp_Pnt& P, |
252 | gp_Vec& D1U, |
253 | gp_Vec& D1V, |
254 | gp_Vec& D2U, |
255 | gp_Vec& D2V, |
256 | gp_Vec& D2UV, |
257 | gp_Vec& D3U, |
258 | gp_Vec& D3V, |
259 | gp_Vec& D3UUV, |
260 | gp_Vec& D3UVV) |
261 | { S.D3(U,V,P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV); } |
262 | |
263 | //======================================================================= |
264 | //function : DN |
265 | //purpose : |
266 | //======================================================================= |
267 | |
268 | inline gp_Vec |
269 | HLRBRep_BSurfaceTool::DN(const BRepAdaptor_Surface& S, |
270 | const Standard_Real U, |
271 | const Standard_Real V, |
272 | const Standard_Integer Nu, |
273 | const Standard_Integer Nv) |
274 | { return S.DN(U,V,Nu,Nv); } |
275 | |
276 | //======================================================================= |
277 | //function : UResolution |
278 | //purpose : |
279 | //======================================================================= |
280 | |
281 | inline Standard_Real |
282 | HLRBRep_BSurfaceTool::UResolution(const BRepAdaptor_Surface& S, |
283 | const Standard_Real R3d) |
284 | { return S.UResolution(R3d); } |
285 | |
286 | //======================================================================= |
287 | //function : VResolution |
288 | //purpose : |
289 | //======================================================================= |
290 | |
291 | inline Standard_Real |
292 | HLRBRep_BSurfaceTool::VResolution(const BRepAdaptor_Surface& S, |
293 | const Standard_Real R3d) |
294 | { return S.VResolution(R3d); } |
295 | |
296 | //======================================================================= |
297 | //function : GetType |
298 | //purpose : |
299 | //======================================================================= |
300 | |
301 | inline GeomAbs_SurfaceType |
302 | HLRBRep_BSurfaceTool::GetType(const BRepAdaptor_Surface& S ) |
303 | { return S.GetType(); } |
304 | |
305 | //======================================================================= |
306 | //function : Plane |
307 | //purpose : |
308 | //======================================================================= |
309 | |
310 | inline gp_Pln |
311 | HLRBRep_BSurfaceTool::Plane(const BRepAdaptor_Surface& S) |
312 | { return S.Plane(); } |
313 | |
314 | //======================================================================= |
315 | //function : Cylinder |
316 | //purpose : |
317 | //======================================================================= |
318 | |
319 | inline gp_Cylinder |
320 | HLRBRep_BSurfaceTool::Cylinder(const BRepAdaptor_Surface& S) |
321 | { return S.Cylinder(); } |
322 | |
323 | //======================================================================= |
324 | //function : Cone |
325 | //purpose : |
326 | //======================================================================= |
327 | |
328 | inline gp_Cone |
329 | HLRBRep_BSurfaceTool::Cone(const BRepAdaptor_Surface& S) |
330 | { return S.Cone(); } |
331 | |
332 | //======================================================================= |
333 | //function : Sphere |
334 | //purpose : |
335 | //======================================================================= |
336 | |
337 | inline gp_Sphere |
338 | HLRBRep_BSurfaceTool::Sphere(const BRepAdaptor_Surface& S) |
339 | { return S.Sphere(); } |
340 | |
341 | //======================================================================= |
342 | //function : Torus |
343 | //purpose : |
344 | //======================================================================= |
345 | |
346 | inline gp_Torus |
347 | HLRBRep_BSurfaceTool::Torus(const BRepAdaptor_Surface& S) |
348 | { return S.Torus(); } |
349 | |
350 | //======================================================================= |
351 | //function : Bezier |
352 | //purpose : |
353 | //======================================================================= |
354 | |
355 | inline Handle(Geom_BezierSurface) |
356 | HLRBRep_BSurfaceTool::Bezier(const BRepAdaptor_Surface& S) |
357 | { return(S.Bezier()); } |
358 | |
359 | //======================================================================= |
360 | //function : BSpline |
361 | //purpose : |
362 | //======================================================================= |
363 | |
364 | inline Handle(Geom_BSplineSurface) |
365 | HLRBRep_BSurfaceTool::BSpline(const BRepAdaptor_Surface& S) |
366 | { return(S.BSpline()); } |
367 | |
368 | //======================================================================= |
369 | //function : AxeOfRevolution |
370 | //purpose : |
371 | //======================================================================= |
372 | |
373 | inline gp_Ax1 |
374 | HLRBRep_BSurfaceTool::AxeOfRevolution(const BRepAdaptor_Surface& S) |
375 | { return(S.AxeOfRevolution()); } |
376 | |
377 | //======================================================================= |
378 | //function : Direction |
379 | //purpose : |
380 | //======================================================================= |
381 | |
382 | inline gp_Dir |
383 | HLRBRep_BSurfaceTool::Direction(const BRepAdaptor_Surface& S) |
384 | { return(S.Direction()); } |
385 | |
386 | //======================================================================= |
387 | //function : BasisCurve |
388 | //purpose : |
389 | //======================================================================= |
390 | |
c22b52d6 |
391 | inline Handle(Adaptor3d_Curve) |
7fd59977 |
392 | HLRBRep_BSurfaceTool::BasisCurve(const BRepAdaptor_Surface& S) |
393 | { return(S.BasisCurve()); } |
394 | |
395 | //======================================================================= |
396 | //function : UContinuity |
397 | //purpose : |
398 | //======================================================================= |
399 | |
400 | inline GeomAbs_Shape |
401 | HLRBRep_BSurfaceTool::UContinuity(const BRepAdaptor_Surface& S) |
402 | { return(S.UContinuity()); } |
403 | |
404 | //======================================================================= |
405 | //function : VContinuity |
406 | //purpose : |
407 | //======================================================================= |
408 | |
409 | inline GeomAbs_Shape |
410 | HLRBRep_BSurfaceTool::VContinuity(const BRepAdaptor_Surface& S) |
411 | { return(S.VContinuity()); } |
412 | |
413 | //======================================================================= |
414 | //function : UDegree |
415 | //purpose : |
416 | //======================================================================= |
417 | |
418 | inline Standard_Integer |
419 | HLRBRep_BSurfaceTool::UDegree(const BRepAdaptor_Surface& S) |
420 | { return(S.UDegree()); } |
421 | |
422 | //======================================================================= |
423 | //function : NbUPoles |
424 | //purpose : |
425 | //======================================================================= |
426 | |
427 | inline Standard_Integer |
428 | HLRBRep_BSurfaceTool::NbUPoles(const BRepAdaptor_Surface& S) |
429 | { return(S.NbUPoles()); } |
430 | |
431 | //======================================================================= |
432 | //function : NbUKnots |
433 | //purpose : |
434 | //======================================================================= |
435 | |
436 | inline Standard_Integer |
437 | HLRBRep_BSurfaceTool::NbUKnots(const BRepAdaptor_Surface& S) |
438 | { return(S.NbUKnots()); } |
439 | |
440 | //======================================================================= |
441 | //function : IsURational |
442 | //purpose : |
443 | //======================================================================= |
444 | |
445 | inline Standard_Boolean |
446 | HLRBRep_BSurfaceTool::IsURational(const BRepAdaptor_Surface& S) |
447 | { return(S.IsURational()); } |
448 | |
449 | //======================================================================= |
450 | //function : VDegree |
451 | //purpose : |
452 | //======================================================================= |
453 | |
454 | inline Standard_Integer |
455 | HLRBRep_BSurfaceTool::VDegree(const BRepAdaptor_Surface& S) |
456 | { return(S.VDegree()); } |
457 | |
458 | //======================================================================= |
459 | //function : NbVPoles |
460 | //purpose : |
461 | //======================================================================= |
462 | |
463 | inline Standard_Integer |
464 | HLRBRep_BSurfaceTool::NbVPoles(const BRepAdaptor_Surface& S) |
465 | { return(S.NbVPoles()); } |
466 | |
467 | //======================================================================= |
468 | //function : NbVKnots |
469 | //purpose : |
470 | //======================================================================= |
471 | |
472 | inline Standard_Integer |
473 | HLRBRep_BSurfaceTool::NbVKnots(const BRepAdaptor_Surface& S) |
474 | { return(S.NbVKnots()); } |
475 | |
476 | //======================================================================= |
477 | //function : IsVRational |
478 | //purpose : |
479 | //======================================================================= |
480 | |
481 | inline Standard_Boolean |
482 | HLRBRep_BSurfaceTool::IsVRational(const BRepAdaptor_Surface& S) |
483 | { return(S.IsVRational()); } |