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

Move point command class. More...

#include <Commands.h>

Inheritance diagram for MovePointCommand:
Collaboration diagram for MovePointCommand:

Public Member Functions

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

Private Attributes

Editorm_editor
 
int m_index
 
QPointF m_from
 
QPointF m_to
 

Detailed Description

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.

Constructor & Destructor Documentation

MovePointCommand::MovePointCommand ( Editor editor,
int  index,
const QPointF &  from,
const QPointF &  to 
)

Constructor

Parameters
editora pointer to the Editor
indexthe index of the point in the Editor::m_points list
froma const reference to a QPointF representing the original position
toa const reference to a QPointF representing the new position

Definition at line 286 of file Commands.cpp.

MovePointCommand::~MovePointCommand ( )
virtual

Destructor

Definition at line 299 of file Commands.cpp.

Member Function Documentation

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

Here is the call graph for this function:

void MovePointCommand::undo ( )
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.

Here is the call graph for this function:

Member Data Documentation

Editor* MovePointCommand::m_editor
private

pointer to the editor

Definition at line 176 of file Commands.h.

QPointF MovePointCommand::m_from
private

original position

Definition at line 178 of file Commands.h.

int MovePointCommand::m_index
private

index of the point in m_editor->m_points

Definition at line 177 of file Commands.h.

QPointF MovePointCommand::m_to
private

destination position

Definition at line 179 of file Commands.h.


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