Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::VerboseLimitedLinearUndo Class Reference

A limited linear undo model providing GUI elements with stack status information. More...

#include <mitkVerboseLimitedLinearUndo.h>

Inheritance diagram for mitk::VerboseLimitedLinearUndo:
Collaboration diagram for mitk::VerboseLimitedLinearUndo:

Public Types

typedef std::pair< int, std::string > StackDescriptionItem
 A pair of ObjectEventId and its human-readable description. More...
 
typedef std::vector< StackDescriptionItem > StackDescription
 A list of (ObjectEventId, description) pairs representing a stack. More...
 
- Public Types inherited from mitk::LimitedLinearUndo
typedef std::deque< UndoStackItem * > UndoContainer
 
typedef std::deque< UndoStackItem * >::reverse_iterator UndoContainerRevIter
 

Public Member Functions

 mitkClassMacro (VerboseLimitedLinearUndo, LimitedLinearUndo)
 
Pointer Clone () const
 
bool SetOperationEvent (UndoStackItem *undoStackItem) override
 Store an operation event on the undo stack. More...
 
virtual StackDescription GetUndoDescriptions ()
 Return human-readable descriptions of the undo stack. More...
 
virtual StackDescription GetRedoDescriptions ()
 Return human-readable descriptions of the redo stack. More...
 
- Public Member Functions inherited from mitk::LimitedLinearUndo
 mitkClassMacro (LimitedLinearUndo, UndoModel)
 
Pointer Clone () const
 
bool Undo () override
 Undoes the last changes. More...
 
bool Undo (bool) override
 Undoes the last changes. More...
 
virtual bool Undo (int oeid)
 Undoes all changes until ObjectEventID oeid. More...
 
bool Redo () override
 Redoes the last undone changes. More...
 
bool Redo (bool) override
 Redoes changes (parameter currently unused). More...
 
virtual bool Redo (int oeid)
 Redoes all changes until ObjectEventID oeid. More...
 
void Clear () override
 Clears both the UndoList and RedoList. More...
 
void ClearRedoList () override
 Clears the RedoList. More...
 
bool RedoListEmpty () override
 Returns true if the RedoList is empty. More...
 
bool UndoListEmpty () override
 Returns true if the UndoList is empty. More...
 
std::size_t GetUndoLimit () const override
 Gets the limit on the size of the undo history. More...
 
void SetUndoLimit (std::size_t limit) override
 Sets a limit on the size of the undo history. 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...
 
OperationEvent * GetLastOfType (OperationActor *destination, OperationType opType) override
 Returns the last OperationEvent in the Undo-list matching the given destination and operation type. More...
 
unsigned int RemoveInvalidOperations () override
 Removes invalid operations from the undo/redo stack. More...
 
- Public Member Functions inherited from mitk::UndoModel
 mitkClassMacroItkParent (UndoModel, itk::Object)
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from mitk::LimitedLinearUndo
static Pointer New ()
 

Protected Member Functions

 VerboseLimitedLinearUndo ()
 
 ~VerboseLimitedLinearUndo () override
 
- Protected Member Functions inherited from mitk::LimitedLinearUndo
 LimitedLinearUndo ()
 Constructor. More...
 
 ~LimitedLinearUndo () override
 Destructor. Deletes all undo and redo entries. More...
 
void ClearList (UndoContainer *list)
 Convenience method to free the memory of elements in the list and clear it. More...
 
- Protected Member Functions inherited from mitk::UndoModel
 UndoModel ()
 
 ~UndoModel () override
 

Additional Inherited Members

- Protected Attributes inherited from mitk::LimitedLinearUndo
UndoContainer m_UndoList
 
UndoContainer m_RedoList
 

Detailed Description

A limited linear undo model providing GUI elements with stack status information.

Extends LimitedLinearUndo by allowing retrieval of human-readable description lists for the undo and redo stacks. These descriptions can be displayed in GUI elements such as undo/redo menus.

Definition at line 38 of file mitkVerboseLimitedLinearUndo.h.

Member Typedef Documentation

◆ StackDescription

A list of (ObjectEventId, description) pairs representing a stack.

Definition at line 49 of file mitkVerboseLimitedLinearUndo.h.

◆ StackDescriptionItem

typedef std::pair<int, std::string> mitk::VerboseLimitedLinearUndo::StackDescriptionItem

A pair of ObjectEventId and its human-readable description.

Definition at line 46 of file mitkVerboseLimitedLinearUndo.h.

Constructor & Destructor Documentation

◆ VerboseLimitedLinearUndo()

mitk::VerboseLimitedLinearUndo::VerboseLimitedLinearUndo ( )
protected

◆ ~VerboseLimitedLinearUndo()

mitk::VerboseLimitedLinearUndo::~VerboseLimitedLinearUndo ( )
overrideprotected

Member Function Documentation

◆ Clone()

Pointer mitk::VerboseLimitedLinearUndo::Clone ( ) const

◆ GetRedoDescriptions()

virtual StackDescription mitk::VerboseLimitedLinearUndo::GetRedoDescriptions ( )
virtual

Return human-readable descriptions of the redo stack.

Groups operations by ObjectEventId and generates a description for each group.

Returns
A StackDescription vector with entries ordered from most recent to oldest.

◆ GetUndoDescriptions()

virtual StackDescription mitk::VerboseLimitedLinearUndo::GetUndoDescriptions ( )
virtual

Return human-readable descriptions of the undo stack.

Groups operations by ObjectEventId and generates a description for each group.

Returns
A StackDescription vector with entries ordered from most recent to oldest.

◆ mitkClassMacro()

mitk::VerboseLimitedLinearUndo::mitkClassMacro ( VerboseLimitedLinearUndo  ,
LimitedLinearUndo   
)

◆ New()

static Pointer mitk::VerboseLimitedLinearUndo::New ( )
static

◆ SetOperationEvent()

bool mitk::VerboseLimitedLinearUndo::SetOperationEvent ( UndoStackItem *  undoStackItem)
overridevirtual

Store an operation event on the undo stack.

Clears the redo list when a new operation is stored. Respects the undo limit by removing the oldest entry if necessary.

Parameters
[in]undoStackItemThe undo stack item to store.
Returns
True if the item was stored successfully, false if the item is nullptr.

Reimplemented from mitk::LimitedLinearUndo.


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