54 #include <QDomElement>
56 #include "../ifc/xml/vabstractpattern.h"
57 #include "../ifc/ifcdef.h"
58 #include "../vmisc/logging.h"
59 #include "../vmisc/vabstractapplication.h"
60 #include "../vmisc/def.h"
65 QGraphicsScene *scene, QUndoCommand *parent)
66 :
VUndoCommand(QDomElement(), doc, parent), oldX(0.0), oldY(0.0), newX(x), newY(y), scene(scene)
68 setText(tr(
"move single point"));
70 qCDebug(vUndo,
"SPoint id %u",
nodeId);
72 qCDebug(vUndo,
"SPoint newX %f",
newX);
73 qCDebug(vUndo,
"SPoint newY %f",
newY);
77 if (domElement.isElement())
82 qCDebug(vUndo,
"SPoint oldX %f",
oldX);
83 qCDebug(vUndo,
"SPoint oldY %f",
oldY);
87 qCDebug(vUndo,
"Can't find spoint with id = %u.",
nodeId);
99 qCDebug(vUndo,
"Undo.");
107 qCDebug(vUndo,
"Redo.");
119 qCDebug(vUndo,
"Mergin.");
122 qCDebug(vUndo,
"Merging canceled.");
126 qCDebug(vUndo,
"Mergin undo.");
129 qCDebug(vUndo,
"SPoint newX %f",
newX);
130 qCDebug(vUndo,
"SPoint newY %f",
newY);
143 qCDebug(vUndo,
"Move to x %f", x);
144 qCDebug(vUndo,
"Move to y %f", y);
147 if (domElement.isElement())
156 qCDebug(vUndo,
"Can't find spoint with id = %u.",
nodeId);
virtual bool mergeWith(const QUndoCommand *command) Q_DECL_OVERRIDE
virtual int id() const Q_DECL_OVERRIDE
virtual void undo() Q_DECL_OVERRIDE
MoveSPoint(VAbstractPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, QUndoCommand *parent=nullptr)
virtual ~MoveSPoint() Q_DECL_OVERRIDE
quint32 getSPointId() const
void Do(double x, double y)
virtual void redo() Q_DECL_OVERRIDE
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 ".".
void NeedLiteParsing(const Document &parse)