Setter and getter for options VToolSplinePath.

--HG--
branch : feature
This commit is contained in:
dismine 2014-09-01 19:39:16 +03:00
parent e6f9b81dba
commit df2c9853a1
2 changed files with 19 additions and 0 deletions

View File

@ -264,6 +264,22 @@ void VToolSplinePath::UpdatePathPoint(VPattern *doc, QDomNode& node, const VSpli
}
}
//---------------------------------------------------------------------------------------------------------------------
VSplinePath VToolSplinePath::getSplinePath() const
{
QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
return *splPath.data();
}
//---------------------------------------------------------------------------------------------------------------------
void VToolSplinePath::setSplinePath(const VSplinePath &splPath)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VSplinePath> splinePath = qSharedPointerDynamicCast<VSplinePath>(obj);
*splinePath.data() = splPath;
SaveOption(obj);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief contextMenuEvent handle context menu events.

View File

@ -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<int>(Tool::SplinePath)};
VSplinePath getSplinePath()const;
void setSplinePath(const VSplinePath &splPath);
signals:
/**
* @brief RefreshLine refresh control line.