svcore  1.9
SparseModel< PointType >::EditCommand Class Reference

Command to add or remove a series of points, with undo. More...

#include <SparseModel.h>

Inheritance diagram for SparseModel< PointType >::EditCommand:
Collaboration diagram for SparseModel< PointType >::EditCommand:

List of all members.

Public Member Functions

 EditCommand (SparseModel< PointType > *model, QString commandName)
virtual void addPoint (const PointType &point)
virtual void deletePoint (const PointType &point)
virtual void addCommand (Command *command)
 Stack an arbitrary other command in the same sequence.
virtual EditCommandfinish ()
 If any points have been added or deleted, return this command (so the caller can add it to the command history).
virtual void deleteCommand (Command *command)
virtual bool haveCommands () const
virtual void execute ()
virtual void unexecute ()
virtual QString getName () const
virtual void setName (QString name)

Protected Member Functions

virtual void addCommand (Command *command, bool executeFirst)

Protected Attributes

SparseModel< PointType > * m_model
QString m_name
std::vector< Command * > m_commands

Detailed Description

template<typename PointType>
class SparseModel< PointType >::EditCommand

Command to add or remove a series of points, with undo.

Consecutive add/remove pairs for the same point are collapsed.

Definition at line 225 of file SparseModel.h.


Constructor & Destructor Documentation

template<typename PointType>
SparseModel< PointType >::EditCommand::EditCommand ( SparseModel< PointType > *  model,
QString  commandName 
)

Definition at line 831 of file SparseModel.h.


Member Function Documentation

template<typename PointType>
void SparseModel< PointType >::EditCommand::addPoint ( const PointType &  point) [virtual]

Definition at line 840 of file SparseModel.h.

template<typename PointType>
void SparseModel< PointType >::EditCommand::deletePoint ( const PointType &  point) [virtual]

Definition at line 847 of file SparseModel.h.

template<typename PointType>
virtual void SparseModel< PointType >::EditCommand::addCommand ( Command command) [inline, virtual]

Stack an arbitrary other command in the same sequence.

Reimplemented from MacroCommand.

Definition at line 236 of file SparseModel.h.

References SparseModel< PointType >::EditCommand::addCommand().

Referenced by SparseModel< PointType >::EditCommand::addCommand().

template<typename PointType >
SparseModel< PointType >::EditCommand * SparseModel< PointType >::EditCommand::finish ( ) [virtual]

If any points have been added or deleted, return this command (so the caller can add it to the command history).

Otherwise delete the command and return NULL.

Definition at line 854 of file SparseModel.h.

template<typename PointType >
void SparseModel< PointType >::EditCommand::addCommand ( Command command,
bool  executeFirst 
) [protected, virtual]
void MacroCommand::deleteCommand ( Command command) [virtual, inherited]

Definition at line 38 of file Command.cpp.

References MacroCommand::m_commands.

bool MacroCommand::haveCommands ( ) const [virtual, inherited]

Definition at line 52 of file Command.cpp.

References MacroCommand::m_commands.

void MacroCommand::execute ( ) [virtual, inherited]

Implements Command.

Definition at line 58 of file Command.cpp.

References MacroCommand::m_commands.

void MacroCommand::unexecute ( ) [virtual, inherited]

Implements Command.

Definition at line 66 of file Command.cpp.

References MacroCommand::m_commands.

QString MacroCommand::getName ( ) const [virtual, inherited]

Implements Command.

Reimplemented in BundleCommand.

Definition at line 74 of file Command.cpp.

References MacroCommand::m_name.

void MacroCommand::setName ( QString  name) [virtual, inherited]

Definition at line 80 of file Command.cpp.

References MacroCommand::m_name.


Member Data Documentation

template<typename PointType>
SparseModel<PointType>* SparseModel< PointType >::EditCommand::m_model [protected]

Definition at line 248 of file SparseModel.h.

QString MacroCommand::m_name [protected, inherited]

Definition at line 52 of file Command.h.

Referenced by MacroCommand::getName(), BundleCommand::getName(), and MacroCommand::setName().


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