Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::LimitedLinearUndo Class Reference

A linear undo model with one undo and one redo stack. More...

#include <mitkLimitedLinearUndo.h>

Inheritance diagram for mitk::LimitedLinearUndo:
Collaboration diagram for mitk::LimitedLinearUndo:

Public Types

typedef std::vector< UndoStackItem * > UndoContainer
 
typedef std::vector< UndoStackItem * >::reverse_iterator UndoContainerRevIter
 
typedef LimitedLinearUndo Self
 
typedef UndoModel Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
- Public Types inherited from mitk::UndoModel
typedef UndoModel Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
virtual bool SetOperationEvent (UndoStackItem *stackItem) override
 
virtual bool Undo () override
 Undoes the last changes. More...
 
virtual bool Undo (bool) override
 
virtual bool Undo (int oeid)
 Undoes all changes until ObjectEventID oeid. More...
 
virtual bool Redo () override
 Undoes the last changes. More...
 
virtual bool Redo (bool) override
 
virtual bool Redo (int oeid)
 Redoes all changes until ObjectEventID oeid. More...
 
virtual void Clear () override
 Clears UndoList and RedoList. More...
 
virtual void ClearRedoList () override
 Clears the RedoList. More...
 
virtual bool RedoListEmpty () override
 True, if RedoList is empty. More...
 
virtual int GetLastObjectEventIdInList () override
 Returns the ObjectEventId of the top element in the OperationHistory. More...
 
virtual int GetLastGroupEventIdInList () override
 Returns the GroupEventId of the top element in the OperationHistory. More...
 
virtual OperationEventGetLastOfType (OperationActor *destination, OperationType opType) override
 Returns the last specified OperationEvent in Undo-list corresponding to the given values; if nothing found, then returns NULL. More...
 

Static Public Member Functions

static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::UndoModel
static const char * GetStaticNameOfClass ()
 

Protected Member Functions

 LimitedLinearUndo ()
 
virtual ~LimitedLinearUndo ()
 
void ClearList (UndoContainer *list)
 
- Protected Member Functions inherited from mitk::UndoModel
 UndoModel ()
 
virtual ~UndoModel ()
 

Protected Attributes

UndoContainer m_UndoList
 
UndoContainer m_RedoList
 

Detailed Description

A linear undo model with one undo and one redo stack.

Derived from UndoModel AND itk::Object. Invokes ITK-events to signal listening GUI elements, whether each of the stacks is empty or not (to enable/disable button, ...)

Definition at line 38 of file mitkLimitedLinearUndo.h.

Member Typedef Documentation

Definition at line 41 of file mitkLimitedLinearUndo.h.

typedef std::vector<UndoStackItem *>::reverse_iterator mitk::LimitedLinearUndo::UndoContainerRevIter

Definition at line 42 of file mitkLimitedLinearUndo.h.

Constructor & Destructor Documentation

mitk::LimitedLinearUndo::LimitedLinearUndo ( )
protected

Constructor

Definition at line 20 of file mitkLimitedLinearUndo.cpp.

mitk::LimitedLinearUndo::~LimitedLinearUndo ( )
protectedvirtual

Destructor

Definition at line 25 of file mitkLimitedLinearUndo.cpp.

Member Function Documentation

void mitk::LimitedLinearUndo::Clear ( )
overridevirtual

Clears UndoList and RedoList.

Implements mitk::UndoModel.

Definition at line 153 of file mitkLimitedLinearUndo.cpp.

void mitk::LimitedLinearUndo::ClearList ( UndoContainer list)
protected

Definition at line 32 of file mitkLimitedLinearUndo.cpp.

void mitk::LimitedLinearUndo::ClearRedoList ( )
overridevirtual

Clears the RedoList.

Implements mitk::UndoModel.

Definition at line 162 of file mitkLimitedLinearUndo.cpp.

Pointer mitk::LimitedLinearUndo::Clone ( ) const
virtual std::vector<std::string> mitk::LimitedLinearUndo::GetClassHierarchy ( ) const
inlineoverridevirtual

Reimplemented from mitk::UndoModel.

Reimplemented in mitk::VerboseLimitedLinearUndo.

Definition at line 44 of file mitkLimitedLinearUndo.h.

virtual const char* mitk::LimitedLinearUndo::GetClassName ( ) const
virtual

Reimplemented from mitk::UndoModel.

Reimplemented in mitk::VerboseLimitedLinearUndo.

int mitk::LimitedLinearUndo::GetLastGroupEventIdInList ( )
overridevirtual

Returns the GroupEventId of the top element in the OperationHistory.

Implements mitk::UndoModel.

Definition at line 178 of file mitkLimitedLinearUndo.cpp.

int mitk::LimitedLinearUndo::GetLastObjectEventIdInList ( )
overridevirtual

Returns the ObjectEventId of the top element in the OperationHistory.

Implements mitk::UndoModel.

Definition at line 173 of file mitkLimitedLinearUndo.cpp.

mitk::OperationEvent * mitk::LimitedLinearUndo::GetLastOfType ( OperationActor destination,
OperationType  opType 
)
overridevirtual

Returns the last specified OperationEvent in Undo-list corresponding to the given values; if nothing found, then returns NULL.

Implements mitk::UndoModel.

Definition at line 183 of file mitkLimitedLinearUndo.cpp.

References mitk::OperationEvent::GetDestination(), mitk::OperationEvent::GetOperation(), mitk::Operation::GetOperationType(), and mitk::OperationEvent::IsValid().

static const char* mitk::LimitedLinearUndo::GetStaticNameOfClass ( )
inlinestatic

Definition at line 44 of file mitkLimitedLinearUndo.h.

static Pointer mitk::LimitedLinearUndo::New ( )
static
bool mitk::LimitedLinearUndo::Redo ( )
overridevirtual

Undoes the last changes.

Reads the top element of the Redo-Stack, executes the operation, swaps the OperationEvent-Operation with the Undo-Operation and sets it to Undo-Stack

Implements mitk::UndoModel.

Definition at line 119 of file mitkLimitedLinearUndo.cpp.

bool mitk::LimitedLinearUndo::Redo ( bool  )
overridevirtual

Implements mitk::UndoModel.

Definition at line 114 of file mitkLimitedLinearUndo.cpp.

bool mitk::LimitedLinearUndo::Redo ( int  oeid)
virtual

Redoes all changes until ObjectEventID oeid.

Definition at line 128 of file mitkLimitedLinearUndo.cpp.

References mitk::RenderingManager::GetInstance(), and mitk::RenderingManager::RequestUpdateAll().

bool mitk::LimitedLinearUndo::RedoListEmpty ( )
overridevirtual

True, if RedoList is empty.

Implements mitk::UndoModel.

Definition at line 168 of file mitkLimitedLinearUndo.cpp.

bool mitk::LimitedLinearUndo::SetOperationEvent ( UndoStackItem stackItem)
overridevirtual

Implements mitk::UndoModel.

Reimplemented in mitk::VerboseLimitedLinearUndo.

Definition at line 42 of file mitkLimitedLinearUndo.cpp.

bool mitk::LimitedLinearUndo::Undo ( )
overridevirtual

Undoes the last changes.

Reads the top element of the Undo-Stack, executes the operation, swaps the OperationEvent-Undo with the Operation and sets it to Redo-Stack

Implements mitk::UndoModel.

Definition at line 78 of file mitkLimitedLinearUndo.cpp.

bool mitk::LimitedLinearUndo::Undo ( bool  fine)
overridevirtual

Implements mitk::UndoModel.

Definition at line 62 of file mitkLimitedLinearUndo.cpp.

bool mitk::LimitedLinearUndo::Undo ( int  oeid)
virtual

Undoes all changes until ObjectEventID oeid.

Definition at line 87 of file mitkLimitedLinearUndo.cpp.

References mitk::RenderingManager::GetInstance(), and mitk::RenderingManager::RequestUpdateAll().

Member Data Documentation

UndoContainer mitk::LimitedLinearUndo::m_RedoList
protected

Definition at line 119 of file mitkLimitedLinearUndo.h.

UndoContainer mitk::LimitedLinearUndo::m_UndoList
protected

Definition at line 117 of file mitkLimitedLinearUndo.h.


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