1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <Standard_Type.hxx>
16 #include <StepGeom_BSplineCurve.hxx>
17 #include <StepGeom_CartesianPoint.hxx>
18 #include <TCollection_HAsciiString.hxx>
20 IMPLEMENT_STANDARD_RTTIEXT(StepGeom_BSplineCurve,StepGeom_BoundedCurve)
22 StepGeom_BSplineCurve::StepGeom_BSplineCurve () {}
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)
32 // --- classe own fields ---
34 controlPointsList = aControlPointsList;
35 curveForm = aCurveForm;
36 closedCurve = aClosedCurve;
37 selfIntersect = aSelfIntersect;
38 // --- classe inherited fields ---
39 StepRepr_RepresentationItem::Init(aName);
43 void StepGeom_BSplineCurve::SetDegree(const Standard_Integer aDegree)
48 Standard_Integer StepGeom_BSplineCurve::Degree() const
53 void StepGeom_BSplineCurve::SetControlPointsList(const Handle(StepGeom_HArray1OfCartesianPoint)& aControlPointsList)
55 controlPointsList = aControlPointsList;
58 Handle(StepGeom_HArray1OfCartesianPoint) StepGeom_BSplineCurve::ControlPointsList() const
60 return controlPointsList;
63 Handle(StepGeom_CartesianPoint) StepGeom_BSplineCurve::ControlPointsListValue(const Standard_Integer num) const
65 return controlPointsList->Value(num);
68 Standard_Integer StepGeom_BSplineCurve::NbControlPointsList () const
70 if (controlPointsList.IsNull()) return 0;
71 return controlPointsList->Length();
74 void StepGeom_BSplineCurve::SetCurveForm(const StepGeom_BSplineCurveForm aCurveForm)
76 curveForm = aCurveForm;
79 StepGeom_BSplineCurveForm StepGeom_BSplineCurve::CurveForm() const
84 void StepGeom_BSplineCurve::SetClosedCurve(const StepData_Logical aClosedCurve)
86 closedCurve = aClosedCurve;
89 StepData_Logical StepGeom_BSplineCurve::ClosedCurve() const
94 void StepGeom_BSplineCurve::SetSelfIntersect(const StepData_Logical aSelfIntersect)
96 selfIntersect = aSelfIntersect;
99 StepData_Logical StepGeom_BSplineCurve::SelfIntersect() const
101 return selfIntersect;