0027047: STEP -- eliminate useless polymorhic methods Init()
[occt.git] / src / StepGeom / StepGeom_BSplineCurve.cxx
CommitLineData
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
92efcf78 20IMPLEMENT_STANDARD_RTTIEXT(StepGeom_BSplineCurve,StepGeom_BoundedCurve)
21
7fd59977 22StepGeom_BSplineCurve::StepGeom_BSplineCurve () {}
23
7fd59977 24void 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
43void StepGeom_BSplineCurve::SetDegree(const Standard_Integer aDegree)
44{
45 degree = aDegree;
46}
47
48Standard_Integer StepGeom_BSplineCurve::Degree() const
49{
50 return degree;
51}
52
53void StepGeom_BSplineCurve::SetControlPointsList(const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList)
54{
55 controlPointsList = aControlPointsList;
56}
57
58Handle(StepGeom_HArray1OfCartesianPoint) StepGeom_BSplineCurve::ControlPointsList() const
59{
60 return controlPointsList;
61}
62
63Handle(StepGeom_CartesianPoint) StepGeom_BSplineCurve::ControlPointsListValue(const Standard_Integer num) const
64{
65 return controlPointsList->Value(num);
66}
67
68Standard_Integer StepGeom_BSplineCurve::NbControlPointsList () const
69{
70 if (controlPointsList.IsNull()) return 0;
71 return controlPointsList->Length();
72}
73
74void StepGeom_BSplineCurve::SetCurveForm(const StepGeom_BSplineCurveForm aCurveForm)
75{
76 curveForm = aCurveForm;
77}
78
79StepGeom_BSplineCurveForm StepGeom_BSplineCurve::CurveForm() const
80{
81 return curveForm;
82}
83
84void StepGeom_BSplineCurve::SetClosedCurve(const StepData_Logical aClosedCurve)
85{
86 closedCurve = aClosedCurve;
87}
88
89StepData_Logical StepGeom_BSplineCurve::ClosedCurve() const
90{
91 return closedCurve;
92}
93
94void StepGeom_BSplineCurve::SetSelfIntersect(const StepData_Logical aSelfIntersect)
95{
96 selfIntersect = aSelfIntersect;
97}
98
99StepData_Logical StepGeom_BSplineCurve::SelfIntersect() const
100{
101 return selfIntersect;
102}