diff --git a/src/app/tools/drawTools/vtoolspline.cpp b/src/app/tools/drawTools/vtoolspline.cpp index be3d9c641..822aa2aaa 100644 --- a/src/app/tools/drawTools/vtoolspline.cpp +++ b/src/app/tools/drawTools/vtoolspline.cpp @@ -188,6 +188,22 @@ VToolSpline* VToolSpline::Create(const quint32 _id, const quint32 &p1, const qui return nullptr; } +//--------------------------------------------------------------------------------------------------------------------- +VSpline VToolSpline::getSpline() const +{ + QSharedPointer spline = VAbstractTool::data.GeometricObject(id); + return *spline.data(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSpline::setSpline(const VSpline &spl) +{ + QSharedPointer obj = VAbstractTool::data.GetGObject(id); + QSharedPointer spline = qSharedPointerDynamicCast(obj); + *spline.data() = spl; + SaveOption(obj); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ControlPointChangePosition handle change position control point. diff --git a/src/app/tools/drawTools/vtoolspline.h b/src/app/tools/drawTools/vtoolspline.h index 7d7cf2ca5..cbbb09f92 100644 --- a/src/app/tools/drawTools/vtoolspline.h +++ b/src/app/tools/drawTools/vtoolspline.h @@ -50,6 +50,9 @@ public: static const QString ToolType; virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::Spline)}; + + VSpline getSpline()const; + void setSpline(const VSpline &spl); public slots: void ControlPointChangePosition (const qint32 &indexSpline, const SplinePointPosition &position, const QPointF &pos);