0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / LProp3d / LProp3d_SurfaceTool.cxx
CommitLineData
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//
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
18#include <Adaptor3d_HSurface.hxx>
19#include <gp_Pnt.hxx>
20#include <gp_Vec.hxx>
21#include <LProp3d_SurfaceTool.hxx>
7fd59977 22
23//=======================================================================
24//function : Value
25//purpose :
26//=======================================================================
7fd59977 27void LProp3d_SurfaceTool::Value(const Handle(Adaptor3d_HSurface)& S,
28 const Standard_Real U,
29 const Standard_Real V,
30 gp_Pnt& P)
31{
32 P = S->Value(U, V);
33}
34
35
36//=======================================================================
37//function : D1
38//purpose :
39//=======================================================================
40
41void LProp3d_SurfaceTool::D1(const Handle(Adaptor3d_HSurface)& S,
42 const Standard_Real U,
43 const Standard_Real V,
44 gp_Pnt& P,
45 gp_Vec& D1U,
46 gp_Vec& D1V)
47{
48 S->D1(U, V, P, D1U, D1V);
49}
50
51
52//=======================================================================
53//function : D2
54//purpose :
55//=======================================================================
56
57void LProp3d_SurfaceTool::D2(const Handle(Adaptor3d_HSurface)& S,
58 const Standard_Real U,
59 const Standard_Real V,
60 gp_Pnt& P,
61 gp_Vec& D1U,
62 gp_Vec& D1V,
63 gp_Vec& D2U,
64 gp_Vec& D2V,
65 gp_Vec& DUV)
66{
67 S->D2(U, V, P, D1U, D1V, D2U, D2V, DUV);
68}
69
70//=======================================================================
71//function : DN
72//purpose :
73//=======================================================================
74gp_Vec LProp3d_SurfaceTool::DN(const Handle(Adaptor3d_HSurface)& S,
75 const Standard_Real U,
76 const Standard_Real V,
77 const Standard_Integer IU,
78 const Standard_Integer IV)
79{
80 return S->DN(U, V, IU, IV);
81}
82
83
84//=======================================================================
85//function : Continuity
86//purpose :
87//=======================================================================
88
89Standard_Integer LProp3d_SurfaceTool::Continuity
90 (const Handle(Adaptor3d_HSurface)& S)
91{
92 GeomAbs_Shape s = (GeomAbs_Shape) Min(S->UContinuity(),S->VContinuity());
93 switch (s) {
94 case GeomAbs_C0:
95 return 0;
96 case GeomAbs_C1:
97 return 1;
98 case GeomAbs_C2:
99 return 2;
100 case GeomAbs_C3:
101 return 3;
102 case GeomAbs_G1:
103 return 0;
104 case GeomAbs_G2:
105 return 0;
106 case GeomAbs_CN:
107 return 3;
108 };
109 return 0;
110}
111
112
113//=======================================================================
114//function : Bounds
115//purpose :
116//=======================================================================
117
118void LProp3d_SurfaceTool::Bounds(const Handle(Adaptor3d_HSurface)& S,
119 Standard_Real& U1,
120 Standard_Real& V1,
121 Standard_Real& U2,
122 Standard_Real& V2)
123{
124 U1 = S->FirstUParameter();
125 V1 = S->FirstVParameter();
126 U2 = S->LastUParameter();
127 V2 = S->LastVParameter();
128}
129
130
131
132
133
134
135
136