Setter and getter for options VToolSpline.

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

View File

@ -188,6 +188,22 @@ VToolSpline* VToolSpline::Create(const quint32 _id, const quint32 &p1, const qui
return nullptr;
}
//---------------------------------------------------------------------------------------------------------------------
VSpline VToolSpline::getSpline() const
{
QSharedPointer<VSpline> spline = VAbstractTool::data.GeometricObject<VSpline>(id);
return *spline.data();
}
//---------------------------------------------------------------------------------------------------------------------
void VToolSpline::setSpline(const VSpline &spl)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
QSharedPointer<VSpline> spline = qSharedPointerDynamicCast<VSpline>(obj);
*spline.data() = spl;
SaveOption(obj);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ControlPointChangePosition handle change position control point.

View File

@ -50,6 +50,9 @@ public:
static const QString ToolType;
virtual int type() const {return Type;}
enum { Type = UserType + static_cast<int>(Tool::Spline)};
VSpline getSpline()const;
void setSpline(const VSpline &spl);
public slots:
void ControlPointChangePosition (const qint32 &indexSpline, const SplinePointPosition &position,
const QPointF &pos);