SymbolEditor
1.3.0
|
Move point command class. More...
#include <Commands.h>
Public Member Functions | |
MovePointCommand (Editor *editor, int index, const QPointF &from, const QPointF &to) | |
virtual | ~MovePointCommand () |
virtual void | undo () |
virtual void | redo () |
Private Attributes | |
Editor * | m_editor |
int | m_index |
QPointF | m_from |
QPointF | m_to |
Move point command class.
Implement moving a control point in the m_points list from one position to another. The Editor QPainterPath needs to be reconstructed with the moved position.
The original position is stored for a possible undo.
Definition at line 166 of file Commands.h.
MovePointCommand::MovePointCommand | ( | Editor * | editor, |
int | index, | ||
const QPointF & | from, | ||
const QPointF & | to | ||
) |
Constructor
editor | a pointer to the Editor |
index | the index of the point in the Editor::m_points list |
from | a const reference to a QPointF representing the original position |
to | a const reference to a QPointF representing the new position |
Definition at line 286 of file Commands.cpp.
|
virtual |
Destructor
Definition at line 299 of file Commands.cpp.
|
virtual |
Redo the move point command. Call the Editor::movePoint function to move the indexed point to the to position.
Definition at line 318 of file Commands.cpp.
|
virtual |
Undo the move point command. Call the Editor::movePoint function to move the indexed point to its original from position.
Definition at line 308 of file Commands.cpp.
|
private |
pointer to the editor
Definition at line 176 of file Commands.h.
|
private |
original position
Definition at line 178 of file Commands.h.
|
private |
index of the point in m_editor->m_points
Definition at line 177 of file Commands.h.
|
private |
destination position
Definition at line 179 of file Commands.h.