b311480e |
1 | // Created on: 1992-08-18 |
2 | // Created by: Herve LEGRAND |
3 | // Copyright (c) 1992-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 | |
42cf5bc1 |
17 | |
7fd59977 |
18 | #include <Geom_Surface.hxx> |
19 | #include <GeomAbs_Shape.hxx> |
42cf5bc1 |
20 | #include <GeomLProp_SurfaceTool.hxx> |
21 | #include <gp_Pnt.hxx> |
22 | #include <gp_Vec.hxx> |
7fd59977 |
23 | |
857ffd5e |
24 | void GeomLProp_SurfaceTool::Value(const Handle(Geom_Surface)& S, |
7fd59977 |
25 | const Standard_Real U, const Standard_Real V, gp_Pnt& P) |
26 | { |
27 | P = S->Value(U, V); |
28 | } |
29 | |
857ffd5e |
30 | void GeomLProp_SurfaceTool::D1(const Handle(Geom_Surface)& S, |
7fd59977 |
31 | const Standard_Real U, const Standard_Real V, |
32 | gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) |
33 | { |
34 | S->D1(U, V, P, D1U, D1V); |
35 | } |
36 | |
857ffd5e |
37 | void GeomLProp_SurfaceTool::D2(const Handle(Geom_Surface)& S, |
7fd59977 |
38 | const Standard_Real U, const Standard_Real V, |
39 | gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& DUV) |
40 | { |
41 | S->D2(U, V, P, D1U, D1V, D2U, D2V, DUV); |
42 | } |
43 | |
44 | //======================================================================= |
45 | //function : DN |
46 | //purpose : |
47 | //======================================================================= |
857ffd5e |
48 | gp_Vec GeomLProp_SurfaceTool::DN(const Handle(Geom_Surface)& S, |
7fd59977 |
49 | const Standard_Real U, |
50 | const Standard_Real V, |
51 | const Standard_Integer IU, |
52 | const Standard_Integer IV) |
53 | { |
54 | return S->DN(U, V, IU, IV); |
55 | } |
56 | |
857ffd5e |
57 | Standard_Integer GeomLProp_SurfaceTool::Continuity(const Handle(Geom_Surface)& S) |
7fd59977 |
58 | { |
59 | GeomAbs_Shape s = S->Continuity(); |
60 | switch (s) { |
61 | case GeomAbs_C0: |
62 | return 0; |
63 | case GeomAbs_C1: |
64 | return 1; |
65 | case GeomAbs_C2: |
66 | return 2; |
67 | case GeomAbs_C3: |
68 | return 3; |
69 | case GeomAbs_G1: |
70 | return 0; |
71 | case GeomAbs_G2: |
72 | return 0; |
73 | case GeomAbs_CN: |
74 | return 3; |
75 | }; |
76 | return 0; |
77 | } |
78 | |
857ffd5e |
79 | void GeomLProp_SurfaceTool::Bounds(const Handle(Geom_Surface)& S, |
7fd59977 |
80 | Standard_Real& U1, Standard_Real& V1, |
81 | Standard_Real& U2, Standard_Real& V2) |
82 | { |
83 | S->Bounds(U1, U2, V1, V2); |
84 | } |
85 | |
86 | |
87 | |
88 | |
89 | |