Setter and getter for options VToolTriangle.

--HG--
branch : feature
This commit is contained in:
dismine 2014-09-01 19:27:30 +03:00
parent 754901bff1
commit 82d82f9b0a
2 changed files with 85 additions and 0 deletions

View File

@ -296,3 +296,75 @@ void VToolTriangle::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
doc->SetAttribute(tag, AttrFirstPoint, firstPointId);
doc->SetAttribute(tag, AttrSecondPoint, secondPointId);
}
//---------------------------------------------------------------------------------------------------------------------
quint32 VToolTriangle::getSecondPointId() const
{
return secondPointId;
}
//---------------------------------------------------------------------------------------------------------------------
void VToolTriangle::setSecondPointId(const quint32 &value)
{
if (value != NULL_ID)
{
secondPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
SaveOption(obj);
}
}
//---------------------------------------------------------------------------------------------------------------------
quint32 VToolTriangle::getFirstPointId() const
{
return firstPointId;
}
//---------------------------------------------------------------------------------------------------------------------
void VToolTriangle::setFirstPointId(const quint32 &value)
{
if (value != NULL_ID)
{
firstPointId = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
SaveOption(obj);
}
}
//---------------------------------------------------------------------------------------------------------------------
quint32 VToolTriangle::getAxisP2Id() const
{
return axisP2Id;
}
//---------------------------------------------------------------------------------------------------------------------
void VToolTriangle::setAxisP2Id(const quint32 &value)
{
if (value != NULL_ID)
{
axisP2Id = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
SaveOption(obj);
}
}
//---------------------------------------------------------------------------------------------------------------------
quint32 VToolTriangle::getAxisP1Id() const
{
return axisP1Id;
}
//---------------------------------------------------------------------------------------------------------------------
void VToolTriangle::setAxisP1Id(const quint32 &value)
{
if (value != NULL_ID)
{
axisP1Id = value;
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
SaveOption(obj);
}
}

View File

@ -53,6 +53,19 @@ public:
static const QString ToolType;
virtual int type() const {return Type;}
enum { Type = UserType + static_cast<int>(Tool::Triangle)};
quint32 getAxisP1Id() const;
void setAxisP1Id(const quint32 &value);
quint32 getAxisP2Id() const;
void setAxisP2Id(const quint32 &value);
quint32 getFirstPointId() const;
void setFirstPointId(const quint32 &value);
quint32 getSecondPointId() const;
void setSecondPointId(const quint32 &value);
public slots:
virtual void FullUpdateFromFile();
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);