973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
b311480e |
13 | |
7fd59977 |
14 | |
42cf5bc1 |
15 | #include <Standard_Type.hxx> |
16 | #include <StepGeom_BSplineCurve.hxx> |
17 | #include <StepGeom_CartesianPoint.hxx> |
18 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
19 | |
20 | StepGeom_BSplineCurve::StepGeom_BSplineCurve () {} |
21 | |
22 | void StepGeom_BSplineCurve::Init( |
23 | const Handle(TCollection_HAsciiString)& aName) |
24 | { |
25 | |
26 | StepRepr_RepresentationItem::Init(aName); |
27 | } |
28 | |
29 | void StepGeom_BSplineCurve::Init( |
30 | const Handle(TCollection_HAsciiString)& aName, |
31 | const Standard_Integer aDegree, |
32 | const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList, |
33 | const StepGeom_BSplineCurveForm aCurveForm, |
34 | const StepData_Logical aClosedCurve, |
35 | const StepData_Logical aSelfIntersect) |
36 | { |
37 | // --- classe own fields --- |
38 | degree = aDegree; |
39 | controlPointsList = aControlPointsList; |
40 | curveForm = aCurveForm; |
41 | closedCurve = aClosedCurve; |
42 | selfIntersect = aSelfIntersect; |
43 | // --- classe inherited fields --- |
44 | StepRepr_RepresentationItem::Init(aName); |
45 | } |
46 | |
47 | |
48 | void StepGeom_BSplineCurve::SetDegree(const Standard_Integer aDegree) |
49 | { |
50 | degree = aDegree; |
51 | } |
52 | |
53 | Standard_Integer StepGeom_BSplineCurve::Degree() const |
54 | { |
55 | return degree; |
56 | } |
57 | |
58 | void StepGeom_BSplineCurve::SetControlPointsList(const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList) |
59 | { |
60 | controlPointsList = aControlPointsList; |
61 | } |
62 | |
63 | Handle(StepGeom_HArray1OfCartesianPoint) StepGeom_BSplineCurve::ControlPointsList() const |
64 | { |
65 | return controlPointsList; |
66 | } |
67 | |
68 | Handle(StepGeom_CartesianPoint) StepGeom_BSplineCurve::ControlPointsListValue(const Standard_Integer num) const |
69 | { |
70 | return controlPointsList->Value(num); |
71 | } |
72 | |
73 | Standard_Integer StepGeom_BSplineCurve::NbControlPointsList () const |
74 | { |
75 | if (controlPointsList.IsNull()) return 0; |
76 | return controlPointsList->Length(); |
77 | } |
78 | |
79 | void StepGeom_BSplineCurve::SetCurveForm(const StepGeom_BSplineCurveForm aCurveForm) |
80 | { |
81 | curveForm = aCurveForm; |
82 | } |
83 | |
84 | StepGeom_BSplineCurveForm StepGeom_BSplineCurve::CurveForm() const |
85 | { |
86 | return curveForm; |
87 | } |
88 | |
89 | void StepGeom_BSplineCurve::SetClosedCurve(const StepData_Logical aClosedCurve) |
90 | { |
91 | closedCurve = aClosedCurve; |
92 | } |
93 | |
94 | StepData_Logical StepGeom_BSplineCurve::ClosedCurve() const |
95 | { |
96 | return closedCurve; |
97 | } |
98 | |
99 | void StepGeom_BSplineCurve::SetSelfIntersect(const StepData_Logical aSelfIntersect) |
100 | { |
101 | selfIntersect = aSelfIntersect; |
102 | } |
103 | |
104 | StepData_Logical StepGeom_BSplineCurve::SelfIntersect() const |
105 | { |
106 | return selfIntersect; |
107 | } |