svcore
1.9
|
Command to add or remove a series of points, with undo. More...
#include <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 EditCommand * | finish () |
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 |
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.
SparseModel< PointType >::EditCommand::EditCommand | ( | SparseModel< PointType > * | model, |
QString | commandName | ||
) |
Definition at line 831 of file SparseModel.h.
void SparseModel< PointType >::EditCommand::addPoint | ( | const PointType & | point | ) | [virtual] |
Definition at line 840 of file SparseModel.h.
void SparseModel< PointType >::EditCommand::deletePoint | ( | const PointType & | point | ) | [virtual] |
Definition at line 847 of file SparseModel.h.
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().
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.
void SparseModel< PointType >::EditCommand::addCommand | ( | Command * | command, |
bool | executeFirst | ||
) | [protected, virtual] |
Definition at line 866 of file SparseModel.h.
References MacroCommand::addCommand(), Command::execute(), SparseModel< PointType >::AddPointCommand::getPoint(), and SparseModel< PointType >::DeletePointCommand::getPoint().
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] |
void MacroCommand::unexecute | ( | ) | [virtual, inherited] |
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.
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().
std::vector<Command *> MacroCommand::m_commands [protected, inherited] |
Definition at line 53 of file Command.h.
Referenced by MacroCommand::addCommand(), MacroCommand::deleteCommand(), MacroCommand::execute(), BundleCommand::getName(), MacroCommand::haveCommands(), MacroCommand::unexecute(), and MacroCommand::~MacroCommand().