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 <BRepAdaptor_Curve.hxx> |
19 | #include <BRepLProp_CurveTool.hxx> |
20 | #include <gp_Pnt.hxx> |
21 | #include <gp_Vec.hxx> |
7fd59977 |
22 | |
23 | //======================================================================= |
24 | //function : Value |
25 | //purpose : |
26 | //======================================================================= |
7fd59977 |
27 | void BRepLProp_CurveTool::Value(const BRepAdaptor_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 | |
40 | void BRepLProp_CurveTool::D1(const BRepAdaptor_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 | |
54 | void BRepLProp_CurveTool::D2(const BRepAdaptor_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 | |
69 | void BRepLProp_CurveTool::D3(const BRepAdaptor_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 | |
85 | Standard_Integer BRepLProp_CurveTool::Continuity(const BRepAdaptor_Curve& C) |
86 | { |
87 | GeomAbs_Shape s = C.Continuity(); |
88 | switch (s) { |
89 | case GeomAbs_C0: |
90 | return 0; |
91 | case GeomAbs_C1: |
92 | return 1; |
93 | case GeomAbs_C2: |
94 | return 2; |
95 | case GeomAbs_C3: |
96 | return 3; |
97 | case GeomAbs_G1: |
98 | return 0; |
99 | case GeomAbs_G2: |
100 | return 0; |
101 | case GeomAbs_CN: |
102 | return 3; |
103 | }; |
104 | return 0; |
105 | } |
106 | |
107 | |
108 | //======================================================================= |
109 | //function : FirstParameter |
110 | //purpose : |
111 | //======================================================================= |
112 | |
113 | Standard_Real BRepLProp_CurveTool::FirstParameter(const BRepAdaptor_Curve& C) |
114 | { |
115 | return C.FirstParameter(); |
116 | } |
117 | |
118 | |
119 | //======================================================================= |
120 | //function : LastParameter |
121 | //purpose : |
122 | //======================================================================= |
123 | |
124 | Standard_Real BRepLProp_CurveTool::LastParameter(const BRepAdaptor_Curve& C) |
125 | { |
126 | return C.LastParameter(); |
127 | } |
128 | |
129 | |