From df2c9853a169f3bc12bd3991c8e40b91b128182c Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 1 Sep 2014 19:39:16 +0300 Subject: [PATCH] Setter and getter for options VToolSplinePath. --HG-- branch : feature --- src/app/tools/drawTools/vtoolsplinepath.cpp | 16 ++++++++++++++++ src/app/tools/drawTools/vtoolsplinepath.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index e157340fe..5521027c4 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -264,6 +264,22 @@ void VToolSplinePath::UpdatePathPoint(VPattern *doc, QDomNode& node, const VSpli } } +//--------------------------------------------------------------------------------------------------------------------- +VSplinePath VToolSplinePath::getSplinePath() const +{ + QSharedPointer splPath = VAbstractTool::data.GeometricObject(id); + return *splPath.data(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolSplinePath::setSplinePath(const VSplinePath &splPath) +{ + QSharedPointer obj = VAbstractTool::data.GetGObject(id); + QSharedPointer splinePath = qSharedPointerDynamicCast(obj); + *splinePath.data() = splPath; + SaveOption(obj); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief contextMenuEvent handle context menu events. diff --git a/src/app/tools/drawTools/vtoolsplinepath.h b/src/app/tools/drawTools/vtoolsplinepath.h index e854c6d4f..cd8046a89 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.h +++ b/src/app/tools/drawTools/vtoolsplinepath.h @@ -48,6 +48,9 @@ public: static void UpdatePathPoint(VPattern *doc, QDomNode& node, const VSplinePath &path); virtual int type() const {return Type;} enum { Type = UserType + static_cast(Tool::SplinePath)}; + + VSplinePath getSplinePath()const; + void setSplinePath(const VSplinePath &splPath); signals: /** * @brief RefreshLine refresh control line.