b311480e |
1 | // Created on: 1994-02-24 |
2 | // Created by: Laurent BOURESCHE |
3 | // Copyright (c) 1994-1999 Matra Datavision |
4 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | // |
6 | // The content of this file is subject to the Open CASCADE Technology Public |
7 | // License Version 6.5 (the "License"). You may not use the content of this file |
8 | // except in compliance with the License. Please obtain a copy of the License |
9 | // at http://www.opencascade.org and read it completely before using this file. |
10 | // |
11 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | // |
14 | // The Original Code and all software distributed under the License is |
15 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | // Initial Developer hereby disclaims all such warranties, including without |
17 | // limitation, any warranties of merchantability, fitness for a particular |
18 | // purpose or non-infringement. Please see the License for the specific terms |
19 | // and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | |
23 | #include <LProp3d_SurfaceTool.ixx> |
24 | |
25 | //======================================================================= |
26 | //function : Value |
27 | //purpose : |
28 | //======================================================================= |
29 | |
30 | void LProp3d_SurfaceTool::Value(const Handle(Adaptor3d_HSurface)& S, |
31 | const Standard_Real U, |
32 | const Standard_Real V, |
33 | gp_Pnt& P) |
34 | { |
35 | P = S->Value(U, V); |
36 | } |
37 | |
38 | |
39 | //======================================================================= |
40 | //function : D1 |
41 | //purpose : |
42 | //======================================================================= |
43 | |
44 | void LProp3d_SurfaceTool::D1(const Handle(Adaptor3d_HSurface)& S, |
45 | const Standard_Real U, |
46 | const Standard_Real V, |
47 | gp_Pnt& P, |
48 | gp_Vec& D1U, |
49 | gp_Vec& D1V) |
50 | { |
51 | S->D1(U, V, P, D1U, D1V); |
52 | } |
53 | |
54 | |
55 | //======================================================================= |
56 | //function : D2 |
57 | //purpose : |
58 | //======================================================================= |
59 | |
60 | void LProp3d_SurfaceTool::D2(const Handle(Adaptor3d_HSurface)& S, |
61 | const Standard_Real U, |
62 | const Standard_Real V, |
63 | gp_Pnt& P, |
64 | gp_Vec& D1U, |
65 | gp_Vec& D1V, |
66 | gp_Vec& D2U, |
67 | gp_Vec& D2V, |
68 | gp_Vec& DUV) |
69 | { |
70 | S->D2(U, V, P, D1U, D1V, D2U, D2V, DUV); |
71 | } |
72 | |
73 | //======================================================================= |
74 | //function : DN |
75 | //purpose : |
76 | //======================================================================= |
77 | gp_Vec LProp3d_SurfaceTool::DN(const Handle(Adaptor3d_HSurface)& S, |
78 | const Standard_Real U, |
79 | const Standard_Real V, |
80 | const Standard_Integer IU, |
81 | const Standard_Integer IV) |
82 | { |
83 | return S->DN(U, V, IU, IV); |
84 | } |
85 | |
86 | |
87 | //======================================================================= |
88 | //function : Continuity |
89 | //purpose : |
90 | //======================================================================= |
91 | |
92 | Standard_Integer LProp3d_SurfaceTool::Continuity |
93 | (const Handle(Adaptor3d_HSurface)& S) |
94 | { |
95 | GeomAbs_Shape s = (GeomAbs_Shape) Min(S->UContinuity(),S->VContinuity()); |
96 | switch (s) { |
97 | case GeomAbs_C0: |
98 | return 0; |
99 | case GeomAbs_C1: |
100 | return 1; |
101 | case GeomAbs_C2: |
102 | return 2; |
103 | case GeomAbs_C3: |
104 | return 3; |
105 | case GeomAbs_G1: |
106 | return 0; |
107 | case GeomAbs_G2: |
108 | return 0; |
109 | case GeomAbs_CN: |
110 | return 3; |
111 | }; |
112 | return 0; |
113 | } |
114 | |
115 | |
116 | //======================================================================= |
117 | //function : Bounds |
118 | //purpose : |
119 | //======================================================================= |
120 | |
121 | void LProp3d_SurfaceTool::Bounds(const Handle(Adaptor3d_HSurface)& S, |
122 | Standard_Real& U1, |
123 | Standard_Real& V1, |
124 | Standard_Real& U2, |
125 | Standard_Real& V2) |
126 | { |
127 | U1 = S->FirstUParameter(); |
128 | V1 = S->FirstVParameter(); |
129 | U2 = S->LastUParameter(); |
130 | V2 = S->LastVParameter(); |
131 | } |
132 | |
133 | |
134 | |
135 | |
136 | |
137 | |
138 | |
139 | |