0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / src / StepGeom / StepGeom_BSplineCurve.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14
15 #include <Standard_Type.hxx>
16 #include <StepGeom_BSplineCurve.hxx>
17 #include <StepGeom_CartesianPoint.hxx>
18 #include <TCollection_HAsciiString.hxx>
19
20 IMPLEMENT_STANDARD_RTTIEXT(StepGeom_BSplineCurve,StepGeom_BoundedCurve)
21
22 StepGeom_BSplineCurve::StepGeom_BSplineCurve ()  {}
23
24 void StepGeom_BSplineCurve::Init(
25         const Handle(TCollection_HAsciiString)& aName,
26         const Standard_Integer aDegree,
27         const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList,
28         const StepGeom_BSplineCurveForm aCurveForm,
29         const StepData_Logical aClosedCurve,
30         const StepData_Logical aSelfIntersect)
31 {
32         // --- classe own fields ---
33         degree = aDegree;
34         controlPointsList = aControlPointsList;
35         curveForm = aCurveForm;
36         closedCurve = aClosedCurve;
37         selfIntersect = aSelfIntersect;
38         // --- classe inherited fields ---
39         StepRepr_RepresentationItem::Init(aName);
40 }
41
42
43 void StepGeom_BSplineCurve::SetDegree(const Standard_Integer aDegree)
44 {
45         degree = aDegree;
46 }
47
48 Standard_Integer StepGeom_BSplineCurve::Degree() const
49 {
50         return degree;
51 }
52
53 void StepGeom_BSplineCurve::SetControlPointsList(const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList)
54 {
55         controlPointsList = aControlPointsList;
56 }
57
58 Handle(StepGeom_HArray1OfCartesianPoint) StepGeom_BSplineCurve::ControlPointsList() const
59 {
60         return controlPointsList;
61 }
62
63 Handle(StepGeom_CartesianPoint) StepGeom_BSplineCurve::ControlPointsListValue(const Standard_Integer num) const
64 {
65         return controlPointsList->Value(num);
66 }
67
68 Standard_Integer StepGeom_BSplineCurve::NbControlPointsList () const
69 {
70         if (controlPointsList.IsNull()) return 0;
71         return controlPointsList->Length();
72 }
73
74 void StepGeom_BSplineCurve::SetCurveForm(const StepGeom_BSplineCurveForm aCurveForm)
75 {
76         curveForm = aCurveForm;
77 }
78
79 StepGeom_BSplineCurveForm StepGeom_BSplineCurve::CurveForm() const
80 {
81         return curveForm;
82 }
83
84 void StepGeom_BSplineCurve::SetClosedCurve(const StepData_Logical aClosedCurve)
85 {
86         closedCurve = aClosedCurve;
87 }
88
89 StepData_Logical StepGeom_BSplineCurve::ClosedCurve() const
90 {
91         return closedCurve;
92 }
93
94 void StepGeom_BSplineCurve::SetSelfIntersect(const StepData_Logical aSelfIntersect)
95 {
96         selfIntersect = aSelfIntersect;
97 }
98
99 StepData_Logical StepGeom_BSplineCurve::SelfIntersect() const
100 {
101         return selfIntersect;
102 }