0024166: Unable to create file with "Save" menu of voxeldemo Qt sample
[occt.git] / src / LProp3d / LProp3d_CurveTool.cxx
CommitLineData
b311480e 1// Created on: 1994-02-24
2// Created by: Laurent BOURESCHE
3// Copyright (c) 1994-1999 Matra Datavision
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
7fd59977 21
22
23#include <LProp3d_CurveTool.ixx>
24
25//=======================================================================
26//function : Value
27//purpose :
28//=======================================================================
29
30void LProp3d_CurveTool::Value(const Handle(Adaptor3d_HCurve)& C,
31 const Standard_Real U,
32 gp_Pnt& P)
33{
34 P = C->Value(U);
35}
36
37
38//=======================================================================
39//function : D1
40//purpose :
41//=======================================================================
42
43void LProp3d_CurveTool::D1(const Handle(Adaptor3d_HCurve)& C,
44 const Standard_Real U,
45 gp_Pnt& P,
46 gp_Vec& V1)
47{
48 C->D1(U,P,V1);
49}
50
51
52//=======================================================================
53//function : D2
54//purpose :
55//=======================================================================
56
57void LProp3d_CurveTool::D2(const Handle(Adaptor3d_HCurve)& C,
58 const Standard_Real U,
59 gp_Pnt& P,
60 gp_Vec& V1,
61 gp_Vec& V2)
62{
63 C->D2(U,P,V1,V2);
64}
65
66
67//=======================================================================
68//function : D3
69//purpose :
70//=======================================================================
71
72void LProp3d_CurveTool::D3(const Handle(Adaptor3d_HCurve)& C,
73 const Standard_Real U,
74 gp_Pnt& P,
75 gp_Vec& V1,
76 gp_Vec& V2,
77 gp_Vec& V3)
78{
79 C->D3(U,P,V1,V2,V3);
80}
81
82
83//=======================================================================
84//function : Continuity
85//purpose :
86//=======================================================================
87
88Standard_Integer LProp3d_CurveTool::Continuity
89 (const Handle(Adaptor3d_HCurve)& C)
90{
91 GeomAbs_Shape s = C->Continuity();
92 switch (s) {
93 case GeomAbs_C0:
94 return 0;
95 case GeomAbs_C1:
96 return 1;
97 case GeomAbs_C2:
98 return 2;
99 case GeomAbs_C3:
100 return 3;
101 case GeomAbs_G1:
102 return 0;
103 case GeomAbs_G2:
104 return 0;
105 case GeomAbs_CN:
106 return 3;
107 };
108 return 0;
109}
110
111
112//=======================================================================
113//function : FirstParameter
114//purpose :
115//=======================================================================
116
117Standard_Real LProp3d_CurveTool::FirstParameter
118 (const Handle(Adaptor3d_HCurve)& C)
119{
120 return C->FirstParameter();
121}
122
123
124//=======================================================================
125//function : LastParameter
126//purpose :
127//=======================================================================
128
129Standard_Real LProp3d_CurveTool::LastParameter
130 (const Handle(Adaptor3d_HCurve)& C)
131{
132 return C->LastParameter();
133}
134
135