54 #include <QDomElement>
56 #include "../ifc/ifcdef.h"
57 #include "../ifc/xml/vabstractpattern.h"
58 #include "../vmisc/logging.h"
59 #include "../vmisc/vabstractapplication.h"
60 #include "../vmisc/def.h"
61 #include "../vtools/tools/drawTools/vdrawtool.h"
62 #include "../vundocommand.h"
68 quint32 toolId, quint32 pointId, QUndoCommand *parent)
72 , m_scene(
qApp->getCurrentScene())
76 setText(tr(
"move the first dart label"));
80 setText(tr(
"move the second dart label"));
84 if (domElement.isElement())
91 qCDebug(vUndo,
"Label old Mx1 %f",
m_oldPos.x());
92 qCDebug(vUndo,
"Label old My1 %f",
m_oldPos.y());
99 qCDebug(vUndo,
"Label old Mx2 %f",
m_oldPos.x());
100 qCDebug(vUndo,
"Label old My2 %f",
m_oldPos.y());
105 qCDebug(vUndo,
"Can't find point with id = %u.",
nodeId);
127 qCDebug(vUndo,
"Label new Mx1 %f",
m_newPos.x());
128 qCDebug(vUndo,
"Label new My1 %f",
m_newPos.y());
132 qCDebug(vUndo,
"Label new Mx2 %f",
m_newPos.x());
133 qCDebug(vUndo,
"Label new My2 %f",
m_newPos.y());
149 qCDebug(vUndo,
"New mx1 %f", pos.x());
150 qCDebug(vUndo,
"New my1 %f", pos.y());
154 qCDebug(vUndo,
"New mx2 %f", pos.x());
155 qCDebug(vUndo,
"New my2 %f", pos.y());
159 if (domElement.isElement())
174 tool->setPointNamePosition(
nodeId, pos);
179 qCDebug(vUndo,
"Can't find point with id = %u.",
nodeId);
QPointF GetNewPos() const
quint32 GetPointId() const
quint32 GetToolId() const
virtual void Do(const QPointF &pos) Q_DECL_OVERRIDE
MoveDoublePoint GetPointType() const
virtual bool mergeWith(const QUndoCommand *command) Q_DECL_OVERRIDE
MoveDoubleLabel(VAbstractPattern *doc, const QPointF &pos, MoveDoublePoint type, quint32 toolId, quint32 pointId, QUndoCommand *parent=nullptr)
virtual int id() const Q_DECL_OVERRIDE
static VDataTool * getTool(quint32 id)
getTool return tool from tool list.
static const QString TagPoint
QDomElement elementById(quint32 id, const QString &tagName=QString())
static qreal GetParametrDouble(const QDomElement &domElement, const QString &name, const QString &defValue)
Returns the double value of the given attribute.
void SetAttribute(QDomElement &domElement, const QString &name, const T &value) const
SetAttribute set attribute in pattern file. Replace "," by ".".