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