|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Represents an entry on the undo or redo stack. More...
#include <mitkOperationEvent.h>

Public Member Functions | |
| UndoStackItem (std::string description="") | |
| Construct an UndoStackItem with an optional description. More... | |
| virtual | ~UndoStackItem () |
| Virtual destructor. More... | |
| int | GetGroupEventId () |
| Get this item's GroupEventId. More... | |
| int | GetObjectEventId () |
| Get this item's ObjectEventId. More... | |
| std::string | GetDescription () |
| Get the textual description of this undo entry. More... | |
| virtual void | ReverseOperations () |
| Swap the do/undo operations (toggle reversed state). More... | |
| virtual void | ReverseAndExecute () |
| Reverse the operations and execute them. More... | |
| virtual bool | IsValid () const =0 |
| Check whether this entry is still valid. More... | |
Static Public Member Functions | |
| static int | GetCurrGroupEventId () |
| Get the current global GroupEventId. More... | |
| static int | GetCurrObjectEventId () |
| Get the current global ObjectEventId. More... | |
| static void | IncCurrObjectEventId () |
| Increment the global ObjectEventId counter. More... | |
| static void | IncCurrGroupEventId () |
| Increment the global GroupEventId counter. More... | |
Protected Attributes | |
| bool | m_Reversed |
| true, if operation and undooperation have been swapped/changed More... | |
Represents an entry on the undo or redo stack.
This base class stores a textual description and a pair of IDs (ObjectEventId and GroupEventId) for grouping related operations. Static member functions manage creation and incrementing of these IDs.
The GroupEventId is intended for logical grouping of several related operations so they can be undone together with a single Undo(false) call.
Definition at line 43 of file mitkOperationEvent.h.
| mitk::UndoStackItem::UndoStackItem | ( | std::string | description = "" | ) |
Construct an UndoStackItem with an optional description.
| [in] | description | Human-readable description of this undo entry. |
|
virtual |
Virtual destructor.
|
static |
Get the current global GroupEventId.
Operations sharing the same GroupEventId are undone together when Undo(false) is called.
|
static |
Get the current global ObjectEventId.
Operations sharing the same ObjectEventId belong to the same logical object change and are always undone together (both Undo(true) and Undo(false)).
| std::string mitk::UndoStackItem::GetDescription | ( | ) |
Get the textual description of this undo entry.
| int mitk::UndoStackItem::GetGroupEventId | ( | ) |
Get this item's GroupEventId.
| int mitk::UndoStackItem::GetObjectEventId | ( | ) |
Get this item's ObjectEventId.
|
static |
Increment the global GroupEventId counter.
Call this to start a new logical group of operations. Multiple ObjectEventIds within the same GroupEventId are undone together by Undo(false).
|
static |
Increment the global ObjectEventId counter.
Call this when a new user interaction produces operations that should be grouped as a single object change. The ObjectEventId groups all operations from one event; the GroupEventId groups multiple ObjectEventIds for coarser undo granularity.
|
pure virtual |
Check whether this entry is still valid.
Returns false if the destination object has been deleted or the operations are no longer valid.
Implemented in mitk::OperationEvent.
|
virtual |
Reverse the operations and execute them.
Reimplemented in mitk::OperationEvent.
|
virtual |
Swap the do/undo operations (toggle reversed state).
Reimplemented in mitk::OperationEvent.
|
protected |
true, if operation and undooperation have been swapped/changed
Definition at line 132 of file mitkOperationEvent.h.