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

Ellipse command class. More...

#include <Commands.h>

Inheritance diagram for EllipseCommand:
Collaboration diagram for EllipseCommand:

Public Member Functions

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

Private Attributes

Editorm_editor
 
QPointF m_from
 
QPointF m_to
 
QPainterPath m_path
 

Detailed Description

Ellipse command class.

Implement an ellipse operation on the QPainterPath for the current symbol. The current sub path is closed and the ellipse is added as a new sub path as a series of cubic to operations.

The original path is stored for a possible undo.

Definition at line 141 of file Commands.h.

Constructor & Destructor Documentation

EllipseCommand::EllipseCommand ( 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 242 of file Commands.cpp.

EllipseCommand::~EllipseCommand ( )
virtual

Destructor

Definition at line 254 of file Commands.cpp.

Member Function Documentation

void EllipseCommand::redo ( )
virtual

Redo the ellipse command. Call the Editor addEllipse function with the two points returning the QPainterPath existing before the addEllipse which is saved for undo.

Definition at line 272 of file Commands.cpp.

Here is the call graph for this function:

void EllipseCommand::undo ( )
virtual

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

Definition at line 262 of file Commands.cpp.

Here is the call graph for this function:

Member Data Documentation

Editor* EllipseCommand::m_editor
private

pointer to the editor

Definition at line 151 of file Commands.h.

QPointF EllipseCommand::m_from
private

first corner

Definition at line 152 of file Commands.h.

QPainterPath EllipseCommand::m_path
private

original path to be restored on undo

Definition at line 154 of file Commands.h.

QPointF EllipseCommand::m_to
private

second corner

Definition at line 153 of file Commands.h.


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