1 // Created on: 1994-02-24
2 // Created by: Laurent BOURESCHE
3 // Copyright (c) 1994-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 <Adaptor3d_Curve.hxx>
19 #include <gp_Pnt.hxx>
20 #include <gp_Vec.hxx>
21 #include <LProp3d_CurveTool.hxx>
22 
23 //=======================================================================
24 //function : Value
25 //purpose  :
26 //=======================================================================
Value(const Handle (Adaptor3d_Curve)& C,const Standard_Real U,gp_Pnt & P)27 void LProp3d_CurveTool::Value(const Handle(Adaptor3d_Curve)& C,
28                               const Standard_Real U,
29                               gp_Pnt& P)
30 {
31   P = C->Value(U);
32 }
33 
34 
35 //=======================================================================
36 //function : D1
37 //purpose  :
38 //=======================================================================
39 
D1(const Handle (Adaptor3d_Curve)& C,const Standard_Real U,gp_Pnt & P,gp_Vec & V1)40 void LProp3d_CurveTool::D1(const Handle(Adaptor3d_Curve)& C,
41                            const Standard_Real U,
42                            gp_Pnt& P,
43                            gp_Vec& V1)
44 {
45   C->D1(U,P,V1);
46 }
47 
48 
49 //=======================================================================
50 //function : D2
51 //purpose  :
52 //=======================================================================
53 
D2(const Handle (Adaptor3d_Curve)& C,const Standard_Real U,gp_Pnt & P,gp_Vec & V1,gp_Vec & V2)54 void LProp3d_CurveTool::D2(const Handle(Adaptor3d_Curve)& C,
55                            const Standard_Real U,
56                            gp_Pnt& P,
57                            gp_Vec& V1,
58                            gp_Vec& V2)
59 {
60   C->D2(U,P,V1,V2);
61 }
62 
63 
64 //=======================================================================
65 //function : D3
66 //purpose  :
67 //=======================================================================
68 
D3(const Handle (Adaptor3d_Curve)& C,const Standard_Real U,gp_Pnt & P,gp_Vec & V1,gp_Vec & V2,gp_Vec & V3)69 void LProp3d_CurveTool::D3(const Handle(Adaptor3d_Curve)& C,
70                            const Standard_Real U,
71                            gp_Pnt& P,
72                            gp_Vec& V1,
73                            gp_Vec& V2,
74                            gp_Vec& V3)
75 {
76   C->D3(U,P,V1,V2,V3);
77 }
78 
79 
80 //=======================================================================
81 //function : Continuity
82 //purpose  :
83 //=======================================================================
84 
Continuity(const Handle (Adaptor3d_Curve)& C)85 Standard_Integer LProp3d_CurveTool::Continuity
86   (const Handle(Adaptor3d_Curve)& C)
87 {
88   GeomAbs_Shape s = C->Continuity();
89   switch (s) {
90   case GeomAbs_C0:
91     return 0;
92   case GeomAbs_C1:
93     return 1;
94   case GeomAbs_C2:
95     return 2;
96   case GeomAbs_C3:
97     return 3;
98   case GeomAbs_G1:
99     return 0;
100   case GeomAbs_G2:
101     return 0;
102   case GeomAbs_CN:
103     return 3;
104   };
105   return 0;
106 }
107 
108 
109 //=======================================================================
110 //function : FirstParameter
111 //purpose  :
112 //=======================================================================
113 
FirstParameter(const Handle (Adaptor3d_Curve)& C)114 Standard_Real LProp3d_CurveTool::FirstParameter
115   (const Handle(Adaptor3d_Curve)& C)
116 {
117   return C->FirstParameter();
118 }
119 
120 
121 //=======================================================================
122 //function : LastParameter
123 //purpose  :
124 //=======================================================================
125 
LastParameter(const Handle (Adaptor3d_Curve)& C)126 Standard_Real LProp3d_CurveTool::LastParameter
127   (const Handle(Adaptor3d_Curve)& C)
128 {
129   return C->LastParameter();
130 }
131 
132 
133