SparseModel< PointType >::EditCommand Class Reference

#include <SparseModel.h>

Inherits MacroCommand.

Inheritance diagram for SparseModel< PointType >::EditCommand:

Inheritance graph
[legend]
Collaboration diagram for SparseModel< PointType >::EditCommand:

Collaboration graph
[legend]
List of all members.

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 204 of file SparseModel.h.

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 void finish ()
 If any points have been added or deleted, add this command 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


Constructor & Destructor Documentation

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

Definition at line 581 of file SparseModel.h.


Member Function Documentation

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

Definition at line 590 of file SparseModel.h.

References SparseModel< PointType >::EditCommand::addCommand(), and SparseModel< PointType >::EditCommand::m_model.

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

Definition at line 597 of file SparseModel.h.

References SparseModel< PointType >::EditCommand::addCommand(), and SparseModel< PointType >::EditCommand::m_model.

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 215 of file SparseModel.h.

Referenced by SparseModel< PointType >::EditCommand::addPoint(), and SparseModel< PointType >::EditCommand::deletePoint().

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

If any points have been added or deleted, add this command to the command history.

Otherwise delete the command.

Definition at line 604 of file SparseModel.h.

References CommandHistory::addCommand(), CommandHistory::getInstance(), and MacroCommand::m_commands.

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

Definition at line 615 of file SparseModel.h.

References MacroCommand::addCommand(), MacroCommand::deleteCommand(), Command::execute(), SparseModel< PointType >::AddPointCommand::getPoint(), and MacroCommand::m_commands.

void MacroCommand::deleteCommand ( Command command  )  [virtual, inherited]

Definition at line 37 of file Command.cpp.

References MacroCommand::m_commands.

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

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

Definition at line 51 of file Command.cpp.

References MacroCommand::m_commands.

Referenced by CommandHistory::endCompoundOperation().

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

Implements Command.

Definition at line 57 of file Command.cpp.

References MacroCommand::m_commands.

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

Implements Command.

Definition at line 65 of file Command.cpp.

References MacroCommand::m_commands.

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

Implements Command.

Definition at line 73 of file Command.cpp.

References MacroCommand::m_name.

Referenced by CommandHistory::startCompoundOperation().

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

Definition at line 79 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 226 of file SparseModel.h.

Referenced by SparseModel< PointType >::EditCommand::addPoint(), and SparseModel< PointType >::EditCommand::deletePoint().

QString MacroCommand::m_name [protected, inherited]

Definition at line 49 of file Command.h.

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

std::vector<Command *> MacroCommand::m_commands [protected, inherited]

Definition at line 50 of file Command.h.

Referenced by SparseModel< PointType >::EditCommand::addCommand(), MacroCommand::addCommand(), MacroCommand::deleteCommand(), MacroCommand::execute(), SparseModel< PointType >::EditCommand::finish(), MacroCommand::haveCommands(), MacroCommand::unexecute(), and MacroCommand::~MacroCommand().


The documentation for this class was generated from the following file:
Generated on Wed Feb 20 15:45:35 2008 for SonicVisualiser by  doxygen 1.5.1