#include <movepiece.h>
Public Member Functions | |
MovePiece (VAbstractPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, QUndoCommand *parent=nullptr) | |
virtual | ~MovePiece () |
virtual void | undo () Q_DECL_OVERRIDE |
virtual void | redo () Q_DECL_OVERRIDE |
virtual bool | mergeWith (const QUndoCommand *command) Q_DECL_OVERRIDE |
virtual int | id () const Q_DECL_OVERRIDE |
quint32 | getPieceId () const |
double | getNewX () const |
double | getNewY () const |
Public Member Functions inherited from VUndoCommand | |
VUndoCommand (const QDomElement &xml, VAbstractPattern *doc, QUndoCommand *parent=nullptr) | |
virtual | ~VUndoCommand ()=default |
Private Member Functions | |
void | SaveCoordinates (QDomElement &domElement, double x, double y) |
Private Attributes | |
double | m_oldX |
double | m_oldY |
double | m_newX |
double | m_newY |
QGraphicsScene * | m_scene |
Additional Inherited Members | |
Signals inherited from VUndoCommand | |
void | ClearScene () |
void | NeedFullParsing () |
void | NeedLiteParsing (const Document &parse) |
Protected Member Functions inherited from VUndoCommand | |
virtual void | RedoFullParsing () |
void | UndoDeleteAfterSibling (QDomNode &parentNode, const quint32 &siblingId) const |
void | IncrementReferences (const QVector< quint32 > &nodes) const |
void | DecrementReferences (const QVector< quint32 > &nodes) const |
void | IncrementReferences (const QVector< CustomSARecord > &nodes) const |
void | DecrementReferences (const QVector< CustomSARecord > &nodes) const |
void | IncrementReferences (const QVector< VPieceNode > &nodes) const |
void | DecrementReferences (const QVector< VPieceNode > &nodes) const |
QDomElement | getDestinationObject (quint32 idTool, quint32 idPoint) const |
Protected Attributes inherited from VUndoCommand | |
QDomElement | xml |
VAbstractPattern * | doc |
quint32 | nodeId |
bool | redoFlag |
Definition at line 65 of file movepiece.h.
MovePiece::MovePiece | ( | VAbstractPattern * | doc, |
const double & | x, | ||
const double & | y, | ||
const quint32 & | id, | ||
QGraphicsScene * | scene, | ||
QUndoCommand * | parent = nullptr |
||
) |
Definition at line 67 of file movepiece.cpp.
References AttrMx, AttrMy, VUndoCommand::doc, VDomDocument::elementById(), VDomDocument::GetParametrDouble(), id(), m_oldX, m_oldY, VUndoCommand::nodeId, qApp, SCASSERT, and VAbstractPattern::TagPiece.
|
virtual |
Definition at line 94 of file movepiece.cpp.
|
inline |
|
inline |
|
inline |
Definition at line 94 of file movepiece.h.
References VUndoCommand::nodeId.
Referenced by mergeWith().
|
virtual |
|
virtual |
Definition at line 143 of file movepiece.cpp.
References getNewX(), getNewY(), getPieceId(), m_newX, m_newY, VUndoCommand::nodeId, and SCASSERT.
|
virtual |
Definition at line 116 of file movepiece.cpp.
References VUndoCommand::doc, VDomDocument::elementById(), LiteParse, m_newX, m_newY, m_scene, VUndoCommand::NeedLiteParsing(), VMainGraphicsView::NewSceneRect(), VUndoCommand::nodeId, qApp, VUndoCommand::redoFlag, SaveCoordinates(), and VAbstractPattern::TagPiece.
|
private |
Definition at line 166 of file movepiece.cpp.
References AttrMx, AttrMy, VUndoCommand::doc, qApp, and VDomDocument::SetAttribute().
|
virtual |
Definition at line 98 of file movepiece.cpp.
References VUndoCommand::doc, VDomDocument::elementById(), LiteParse, m_oldX, m_oldY, VUndoCommand::NeedLiteParsing(), VUndoCommand::nodeId, SaveCoordinates(), and VAbstractPattern::TagPiece.
|
private |
Definition at line 86 of file movepiece.h.
Referenced by getNewX(), mergeWith(), and redo().
|
private |
Definition at line 87 of file movepiece.h.
Referenced by getNewY(), mergeWith(), and redo().
|
private |
Definition at line 84 of file movepiece.h.
Referenced by MovePiece(), and undo().
|
private |
Definition at line 85 of file movepiece.h.
Referenced by MovePiece(), and undo().
|
private |
Definition at line 88 of file movepiece.h.
Referenced by redo().