0024428: Implementation of LGPL license
[occt.git] / src / BRepLProp / BRepLProp_CurveTool.cxx
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
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <BRepLProp_CurveTool.ixx>
18
19 //=======================================================================
20 //function : Value
21 //purpose  : 
22 //=======================================================================
23
24 void BRepLProp_CurveTool::Value(const BRepAdaptor_Curve& C, 
25                                 const Standard_Real U, 
26                                 gp_Pnt& P)
27 {
28   P = C.Value(U);
29 }
30
31
32 //=======================================================================
33 //function : D1
34 //purpose  : 
35 //=======================================================================
36
37 void BRepLProp_CurveTool::D1(const BRepAdaptor_Curve& C, 
38                              const Standard_Real U, 
39                              gp_Pnt& P, 
40                              gp_Vec& V1)
41 {
42   C.D1(U,P,V1);
43 }
44
45
46 //=======================================================================
47 //function : D2
48 //purpose  : 
49 //=======================================================================
50
51 void BRepLProp_CurveTool::D2(const BRepAdaptor_Curve& C, 
52                              const Standard_Real U, 
53                              gp_Pnt& P, 
54                              gp_Vec& V1, 
55                              gp_Vec& V2)
56 {
57   C.D2(U,P,V1,V2);
58 }
59
60
61 //=======================================================================
62 //function : D3
63 //purpose  : 
64 //=======================================================================
65
66 void BRepLProp_CurveTool::D3(const BRepAdaptor_Curve& C, 
67                              const Standard_Real U, 
68                              gp_Pnt& P, 
69                              gp_Vec& V1, 
70                              gp_Vec& V2, 
71                              gp_Vec& V3)
72 {
73   C.D3(U,P,V1,V2,V3);
74 }
75
76
77 //=======================================================================
78 //function : Continuity
79 //purpose  : 
80 //=======================================================================
81
82 Standard_Integer BRepLProp_CurveTool::Continuity(const BRepAdaptor_Curve& C)
83 {
84   GeomAbs_Shape s = C.Continuity();
85   switch (s) {
86   case GeomAbs_C0:
87     return 0;
88   case GeomAbs_C1:
89     return 1;
90   case GeomAbs_C2:
91     return 2;
92   case GeomAbs_C3:
93     return 3;
94   case GeomAbs_G1:
95     return 0;
96   case GeomAbs_G2:
97     return 0;
98   case GeomAbs_CN:
99     return 3;
100   };
101   return 0;
102 }
103
104
105 //=======================================================================
106 //function : FirstParameter
107 //purpose  : 
108 //=======================================================================
109
110 Standard_Real BRepLProp_CurveTool::FirstParameter(const BRepAdaptor_Curve& C)
111 {
112   return C.FirstParameter();
113 }
114
115
116 //=======================================================================
117 //function : LastParameter
118 //purpose  : 
119 //=======================================================================
120
121 Standard_Real BRepLProp_CurveTool::LastParameter(const BRepAdaptor_Curve& C)
122 {
123   return C.LastParameter();
124 }
125
126