SymbolEditor  1.3.0
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
RectangleCommand Class Reference

Rectangle command class. More...

#include <Commands.h>

Inheritance diagram for RectangleCommand:
Collaboration diagram for RectangleCommand:

Public Member Functions

 RectangleCommand (Editor *editor, const QPointF &from, const QPointF &to)
 
virtual ~RectangleCommand ()
 
virtual void undo ()
 
virtual void redo ()
 

Private Attributes

Editorm_editor
 
QPointF m_from
 
QPointF m_to
 
QPainterPath m_path
 

Detailed Description

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.

Constructor & Destructor Documentation

RectangleCommand::RectangleCommand ( Editor editor,
const QPointF &  from,
const QPointF &  to 
)

Constructor

Parameters
editora pointer to the Editor
froma const reference to a QPointF representing the first corner
toa const reference to a QPointF representing the second corner

Definition at line 199 of file Commands.cpp.

RectangleCommand::~RectangleCommand ( )
virtual

Destructor

Definition at line 211 of file Commands.cpp.

Member Function Documentation

void RectangleCommand::redo ( )
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.

Here is the call graph for this function:

void RectangleCommand::undo ( )
virtual

Undo the rectangle command. Restore the path saved during redo.

Definition at line 219 of file Commands.cpp.

Here is the call graph for this function:

Member Data Documentation

Editor* RectangleCommand::m_editor
private

pointer to the editor

Definition at line 125 of file Commands.h.

QPointF RectangleCommand::m_from
private

first corner

Definition at line 126 of file Commands.h.

QPainterPath RectangleCommand::m_path
private

original path to be restored on undo

Definition at line 128 of file Commands.h.

QPointF RectangleCommand::m_to
private

second corner

Definition at line 127 of file Commands.h.


The documentation for this class was generated from the following files: