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