Setter and getter for options VToolNormal.

--HG--
branch : feature
This commit is contained in:
dismine 2014-09-01 18:36:08 +03:00
parent eb6eff3486
commit 4a6a3f3cc9
4 changed files with 40 additions and 0 deletions

View file

@ -108,6 +108,20 @@ void VToolLinePoint::SetFactor(qreal factor)
RefreshGeometry();
}
//---------------------------------------------------------------------------------------------------------------------
qreal VToolLinePoint::getAngle() const
{
return angle;
}
//---------------------------------------------------------------------------------------------------------------------
void VToolLinePoint::setAngle(const qreal &value)
{
angle = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
SaveOption(obj);
}
//---------------------------------------------------------------------------------------------------------------------
quint32 VToolLinePoint::getBasePointId() const
{

View file

@ -49,6 +49,9 @@ public:
quint32 getBasePointId() const;
void setBasePointId(const quint32 &value);
qreal getAngle() const;
void setAngle(const qreal &value);
public slots:
virtual void ChangedActivDraw(const QString &newName);
virtual void SetFactor(qreal factor);

View file

@ -287,3 +287,22 @@ void VToolNormal::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
doc->SetAttribute(tag, AttrFirstPoint, basePointId);
doc->SetAttribute(tag, AttrSecondPoint, secondPointId);
}
//---------------------------------------------------------------------------------------------------------------------
quint32 VToolNormal::getSecondPointId() const
{
return secondPointId;
}
//---------------------------------------------------------------------------------------------------------------------
void VToolNormal::setSecondPointId(const quint32 &value)
{
if (value != NULL_ID)
{
secondPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
SaveOption(obj);
}
}

View file

@ -52,6 +52,10 @@ public:
static const QString ToolType;
virtual int type() const {return Type;}
enum { Type = UserType + static_cast<int>(Tool::Normal)};
quint32 getSecondPointId() const;
void setSecondPointId(const quint32 &value);
public slots:
virtual void FullUpdateFromFile();
virtual void SetFactor(qreal factor);