SymbolEditor
1.3.0
|
Rectangle command class. More...
#include <Commands.h>
Public Member Functions | |
RectangleCommand (Editor *editor, const QPointF &from, const QPointF &to) | |
virtual | ~RectangleCommand () |
virtual void | undo () |
virtual void | redo () |
Private Attributes | |
Editor * | m_editor |
QPointF | m_from |
QPointF | m_to |
QPainterPath | m_path |
Rectangle command class.
Implement a rectangle operation on the QPainterPath for the current symbol. The current sub path is closed and the rectangle is added as a new sub path as a series of line to operations.
The original path is stored for a possible undo.
Definition at line 115 of file Commands.h.
RectangleCommand::RectangleCommand | ( | Editor * | editor, |
const QPointF & | from, | ||
const QPointF & | to | ||
) |
Constructor
editor | a pointer to the Editor |
from | a const reference to a QPointF representing the first corner |
to | a const reference to a QPointF representing the second corner |
Definition at line 199 of file Commands.cpp.
|
virtual |
Destructor
Definition at line 211 of file Commands.cpp.
|
virtual |
Redo the rectangle command. Call the Editor addRectangle function with the two points returning the QPainterPath existing before the addRectangle which is saved for undo.
Definition at line 229 of file Commands.cpp.
|
virtual |
Undo the rectangle command. Restore the path saved during redo.
Definition at line 219 of file Commands.cpp.
|
private |
pointer to the editor
Definition at line 125 of file Commands.h.
|
private |
first corner
Definition at line 126 of file Commands.h.
|
private |
original path to be restored on undo
Definition at line 128 of file Commands.h.
|
private |
second corner
Definition at line 127 of file Commands.h.