1 // Created on: 1992-08-18
2 // Created by: Herve LEGRAND
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17
18 #include <Geom_Surface.hxx>
19 #include <GeomAbs_Shape.hxx>
20 #include <GeomLProp_SurfaceTool.hxx>
21 #include <gp_Pnt.hxx>
22 #include <gp_Vec.hxx>
23
Value(const Handle (Geom_Surface)& S,const Standard_Real U,const Standard_Real V,gp_Pnt & P)24 void GeomLProp_SurfaceTool::Value(const Handle(Geom_Surface)& S,
25 const Standard_Real U, const Standard_Real V, gp_Pnt& P)
26 {
27 P = S->Value(U, V);
28 }
29
D1(const Handle (Geom_Surface)& S,const Standard_Real U,const Standard_Real V,gp_Pnt & P,gp_Vec & D1U,gp_Vec & D1V)30 void GeomLProp_SurfaceTool::D1(const Handle(Geom_Surface)& S,
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
D2(const Handle (Geom_Surface)& S,const Standard_Real U,const Standard_Real V,gp_Pnt & P,gp_Vec & D1U,gp_Vec & D1V,gp_Vec & D2U,gp_Vec & D2V,gp_Vec & DUV)37 void GeomLProp_SurfaceTool::D2(const Handle(Geom_Surface)& S,
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 //=======================================================================
DN(const Handle (Geom_Surface)& S,const Standard_Real U,const Standard_Real V,const Standard_Integer IU,const Standard_Integer IV)48 gp_Vec GeomLProp_SurfaceTool::DN(const Handle(Geom_Surface)& S,
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
Continuity(const Handle (Geom_Surface)& S)57 Standard_Integer GeomLProp_SurfaceTool::Continuity(const Handle(Geom_Surface)& S)
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
Bounds(const Handle (Geom_Surface)& S,Standard_Real & U1,Standard_Real & V1,Standard_Real & U2,Standard_Real & V2)79 void GeomLProp_SurfaceTool::Bounds(const Handle(Geom_Surface)& S,
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
90