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:

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. More...
 
virtual EditCommandfinish ()
 If any points have been added or deleted, return this command (so the caller can add it to the command history). More...
 
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

◆ EditCommand()

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

Definition at line 831 of file SparseModel.h.

Member Function Documentation

◆ addPoint()

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

Definition at line 840 of file SparseModel.h.

◆ deletePoint()

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

Definition at line 847 of file SparseModel.h.

◆ addCommand() [1/2]

template<typename PointType>
virtual void SparseModel< PointType >::EditCommand::addCommand ( Command command)
inlinevirtual

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().

◆ finish()

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.

◆ addCommand() [2/2]

template<typename PointType >
void SparseModel< PointType >::EditCommand::addCommand ( Command command,
bool  executeFirst 
)
protectedvirtual

◆ deleteCommand()

void MacroCommand::deleteCommand ( Command command)
virtualinherited

Definition at line 38 of file Command.cpp.

References MacroCommand::m_commands.

◆ haveCommands()

bool MacroCommand::haveCommands ( ) const
virtualinherited

Definition at line 52 of file Command.cpp.

References MacroCommand::m_commands.

◆ execute()

void MacroCommand::execute ( )
virtualinherited

Implements Command.

Definition at line 58 of file Command.cpp.

References MacroCommand::m_commands.

◆ unexecute()

void MacroCommand::unexecute ( )
virtualinherited

Implements Command.

Definition at line 66 of file Command.cpp.

References MacroCommand::m_commands.

◆ getName()

QString MacroCommand::getName ( ) const
virtualinherited

Implements Command.

Reimplemented in BundleCommand.

Definition at line 74 of file Command.cpp.

References MacroCommand::m_name.

◆ setName()

void MacroCommand::setName ( QString  name)
virtualinherited

Definition at line 80 of file Command.cpp.

References MacroCommand::m_name.

Member Data Documentation

◆ m_model

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

Definition at line 248 of file SparseModel.h.

◆ m_name

QString MacroCommand::m_name
protectedinherited

Definition at line 52 of file Command.h.

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

◆ m_commands


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