Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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::deque< UndoStackItem * > UndoContainer
 
typedef std::deque< 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
 
bool SetOperationEvent (UndoStackItem *stackItem) override
 
bool Undo () override
 Undoes the last changes. More...
 
bool Undo (bool) override
 
virtual bool Undo (int oeid)
 Undoes all changes until ObjectEventID oeid. More...
 
bool Redo () override
 Undoes the last changes. More...
 
bool Redo (bool) override
 
virtual bool Redo (int oeid)
 Redoes all changes until ObjectEventID oeid. More...
 
void Clear () override
 Clears UndoList and RedoList. More...
 
void ClearRedoList () override
 Clears the RedoList. More...
 
bool RedoListEmpty () override
 True, if RedoList is empty. More...
 
std::size_t GetUndoLimit () const override
 Gets the limit on the size of the undo history. The undo limit determines how many items can be stored in the undo stack. If the value is 0 that means that there is no limit. More...
 
void SetUndoLimit (std::size_t limit) override
 Sets a limit on the size of the undo history. If the limit is reached, the oldest undo items will be dropped from the bottom of the undo stack. The 0 value means that there is no limit. More...
 
int GetLastObjectEventIdInList () override
 Returns the ObjectEventId of the top element in the OperationHistory. More...
 
int GetLastGroupEventIdInList () override
 Returns the GroupEventId of the top element in the OperationHistory. More...
 
OperationEventGetLastOfType (OperationActor *destination, OperationType opType) override
 Returns the last specified OperationEvent in Undo-list corresponding to the given values; if nothing found, then returns nullptr. 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 ()
 
 ~LimitedLinearUndo () override
 
void ClearList (UndoContainer *list)
 
- Protected Member Functions inherited from mitk::UndoModel
 UndoModel ()
 
 ~UndoModel () override
 

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 36 of file mitkLimitedLinearUndo.h.

Member Typedef Documentation

◆ ConstPointer

◆ Pointer

◆ Self

◆ Superclass

◆ UndoContainer

Definition at line 39 of file mitkLimitedLinearUndo.h.

◆ UndoContainerRevIter

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

Definition at line 40 of file mitkLimitedLinearUndo.h.

Constructor & Destructor Documentation

◆ LimitedLinearUndo()

mitk::LimitedLinearUndo::LimitedLinearUndo ( )
protected

Constructor

◆ ~LimitedLinearUndo()

mitk::LimitedLinearUndo::~LimitedLinearUndo ( )
overrideprotected

Destructor

Member Function Documentation

◆ Clear()

void mitk::LimitedLinearUndo::Clear ( )
overridevirtual

Clears UndoList and RedoList.

Implements mitk::UndoModel.

◆ ClearList()

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

◆ ClearRedoList()

void mitk::LimitedLinearUndo::ClearRedoList ( )
overridevirtual

Clears the RedoList.

Implements mitk::UndoModel.

◆ Clone()

Pointer mitk::LimitedLinearUndo::Clone ( ) const

◆ GetClassHierarchy()

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

Reimplemented from mitk::UndoModel.

Reimplemented in mitk::VerboseLimitedLinearUndo.

Definition at line 42 of file mitkLimitedLinearUndo.h.

◆ GetClassName()

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

Reimplemented from mitk::UndoModel.

Reimplemented in mitk::VerboseLimitedLinearUndo.

◆ GetLastGroupEventIdInList()

int mitk::LimitedLinearUndo::GetLastGroupEventIdInList ( )
overridevirtual

Returns the GroupEventId of the top element in the OperationHistory.

Implements mitk::UndoModel.

◆ GetLastObjectEventIdInList()

int mitk::LimitedLinearUndo::GetLastObjectEventIdInList ( )
overridevirtual

Returns the ObjectEventId of the top element in the OperationHistory.

Implements mitk::UndoModel.

◆ GetLastOfType()

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 nullptr.

Implements mitk::UndoModel.

◆ GetStaticNameOfClass()

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

Definition at line 42 of file mitkLimitedLinearUndo.h.

◆ GetUndoLimit()

std::size_t mitk::LimitedLinearUndo::GetUndoLimit ( ) const
overridevirtual

Gets the limit on the size of the undo history. The undo limit determines how many items can be stored in the undo stack. If the value is 0 that means that there is no limit.

Implements mitk::UndoModel.

◆ New()

static Pointer mitk::LimitedLinearUndo::New ( )
static

◆ Redo() [1/3]

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.

◆ Redo() [2/3]

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

Implements mitk::UndoModel.

◆ Redo() [3/3]

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

Redoes all changes until ObjectEventID oeid.

◆ RedoListEmpty()

bool mitk::LimitedLinearUndo::RedoListEmpty ( )
overridevirtual

True, if RedoList is empty.

Implements mitk::UndoModel.

◆ SetOperationEvent()

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

Implements mitk::UndoModel.

Reimplemented in mitk::VerboseLimitedLinearUndo.

◆ SetUndoLimit()

void mitk::LimitedLinearUndo::SetUndoLimit ( std::size_t  limit)
overridevirtual

Sets a limit on the size of the undo history. If the limit is reached, the oldest undo items will be dropped from the bottom of the undo stack. The 0 value means that there is no limit.

Parameters
limitthe maximum number of items on the stack

Implements mitk::UndoModel.

◆ Undo() [1/3]

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.

◆ Undo() [2/3]

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

Implements mitk::UndoModel.

◆ Undo() [3/3]

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

Undoes all changes until ObjectEventID oeid.

Member Data Documentation

◆ m_RedoList

UndoContainer mitk::LimitedLinearUndo::m_RedoList
protected

Definition at line 133 of file mitkLimitedLinearUndo.h.

◆ m_UndoList

UndoContainer mitk::LimitedLinearUndo::m_UndoList
protected

Definition at line 131 of file mitkLimitedLinearUndo.h.


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