b311480e |
1 | // Created on: 1994-02-24 |
2 | // Created by: Laurent BOURESCHE |
3 | // Copyright (c) 1994-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 | // |
973c2be1 |
8 | // This library is free software; you can redistribute it and / or modify it |
9 | // under the terms of the GNU Lesser General Public version 2.1 as published |
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 <LProp3d_SurfaceTool.ixx> |
18 | |
19 | //======================================================================= |
20 | //function : Value |
21 | //purpose : |
22 | //======================================================================= |
23 | |
24 | void LProp3d_SurfaceTool::Value(const Handle(Adaptor3d_HSurface)& S, |
25 | const Standard_Real U, |
26 | const Standard_Real V, |
27 | gp_Pnt& P) |
28 | { |
29 | P = S->Value(U, V); |
30 | } |
31 | |
32 | |
33 | //======================================================================= |
34 | //function : D1 |
35 | //purpose : |
36 | //======================================================================= |
37 | |
38 | void LProp3d_SurfaceTool::D1(const Handle(Adaptor3d_HSurface)& S, |
39 | const Standard_Real U, |
40 | const Standard_Real V, |
41 | gp_Pnt& P, |
42 | gp_Vec& D1U, |
43 | gp_Vec& D1V) |
44 | { |
45 | S->D1(U, V, P, D1U, D1V); |
46 | } |
47 | |
48 | |
49 | //======================================================================= |
50 | //function : D2 |
51 | //purpose : |
52 | //======================================================================= |
53 | |
54 | void LProp3d_SurfaceTool::D2(const Handle(Adaptor3d_HSurface)& S, |
55 | const Standard_Real U, |
56 | const Standard_Real V, |
57 | gp_Pnt& P, |
58 | gp_Vec& D1U, |
59 | gp_Vec& D1V, |
60 | gp_Vec& D2U, |
61 | gp_Vec& D2V, |
62 | gp_Vec& DUV) |
63 | { |
64 | S->D2(U, V, P, D1U, D1V, D2U, D2V, DUV); |
65 | } |
66 | |
67 | //======================================================================= |
68 | //function : DN |
69 | //purpose : |
70 | //======================================================================= |
71 | gp_Vec LProp3d_SurfaceTool::DN(const Handle(Adaptor3d_HSurface)& S, |
72 | const Standard_Real U, |
73 | const Standard_Real V, |
74 | const Standard_Integer IU, |
75 | const Standard_Integer IV) |
76 | { |
77 | return S->DN(U, V, IU, IV); |
78 | } |
79 | |
80 | |
81 | //======================================================================= |
82 | //function : Continuity |
83 | //purpose : |
84 | //======================================================================= |
85 | |
86 | Standard_Integer LProp3d_SurfaceTool::Continuity |
87 | (const Handle(Adaptor3d_HSurface)& S) |
88 | { |
89 | GeomAbs_Shape s = (GeomAbs_Shape) Min(S->UContinuity(),S->VContinuity()); |
90 | switch (s) { |
91 | case GeomAbs_C0: |
92 | return 0; |
93 | case GeomAbs_C1: |
94 | return 1; |
95 | case GeomAbs_C2: |
96 | return 2; |
97 | case GeomAbs_C3: |
98 | return 3; |
99 | case GeomAbs_G1: |
100 | return 0; |
101 | case GeomAbs_G2: |
102 | return 0; |
103 | case GeomAbs_CN: |
104 | return 3; |
105 | }; |
106 | return 0; |
107 | } |
108 | |
109 | |
110 | //======================================================================= |
111 | //function : Bounds |
112 | //purpose : |
113 | //======================================================================= |
114 | |
115 | void LProp3d_SurfaceTool::Bounds(const Handle(Adaptor3d_HSurface)& S, |
116 | Standard_Real& U1, |
117 | Standard_Real& V1, |
118 | Standard_Real& U2, |
119 | Standard_Real& V2) |
120 | { |
121 | U1 = S->FirstUParameter(); |
122 | V1 = S->FirstVParameter(); |
123 | U2 = S->LastUParameter(); |
124 | V2 = S->LastVParameter(); |
125 | } |
126 | |
127 | |
128 | |
129 | |
130 | |
131 | |
132 | |
133 | |