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

RAII helper that captures state for undoing a group insert operation. More...

#include <mitkSegChangeOperationApplier.h>

Collaboration diagram for mitk::SegGroupInsertUndoRedoHelper:

Public Types

using GroupIndexSetType = std::set< MultiLabelSegmentation::GroupIndexType >
 

Public Member Functions

 SegGroupInsertUndoRedoHelper (MultiLabelSegmentation *segmentation, const GroupIndexSetType &relevantGroupIDs, bool noLabels=false, bool noGroupImages=false)
 Prepare the undo operation (removal) for the groups that will be inserted. More...
 
 ~SegGroupInsertUndoRedoHelper ()
 
void RegisterUndoRedoOperationEvent (const std::string &description)
 Capture the current (inserted) state as the redo operation and register the undo/redo pair. More...
 

Protected Attributes

MultiLabelSegmentation::Pointer m_Segmentation
 
GroupIndexSetType m_RelevantGroupIDs
 
bool m_NoLabels
 
bool m_NoGroupImages
 
SegChangeOperationBase * m_UndoOperation
 

Detailed Description

RAII helper that captures state for undoing a group insert operation.

On construction, a SegGroupRemoveOperation is prepared as the undo operation. After the insert is performed, call RegisterUndoRedoOperationEvent() to capture the redo (insert) state and register both on the undo stack.

See also
SegGroupInsertOperation
SegChangeOperationApplier

Definition at line 114 of file mitkSegChangeOperationApplier.h.

Member Typedef Documentation

◆ GroupIndexSetType

Constructor & Destructor Documentation

◆ SegGroupInsertUndoRedoHelper()

mitk::SegGroupInsertUndoRedoHelper::SegGroupInsertUndoRedoHelper ( MultiLabelSegmentation *  segmentation,
const GroupIndexSetType &  relevantGroupIDs,
bool  noLabels = false,
bool  noGroupImages = false 
)

Prepare the undo operation (removal) for the groups that will be inserted.

Parameters
segmentationThe segmentation to operate on.
relevantGroupIDsThe group indices that will be inserted.
noLabelsIf true, label information is not captured in the redo operation.
noGroupImagesIf true, group image data is not captured in the redo operation.

◆ ~SegGroupInsertUndoRedoHelper()

mitk::SegGroupInsertUndoRedoHelper::~SegGroupInsertUndoRedoHelper ( )

Member Function Documentation

◆ RegisterUndoRedoOperationEvent()

void mitk::SegGroupInsertUndoRedoHelper::RegisterUndoRedoOperationEvent ( const std::string &  description)

Capture the current (inserted) state as the redo operation and register the undo/redo pair.

Parameters
descriptionA human-readable description of the operation for the undo stack.

Member Data Documentation

◆ m_NoGroupImages

bool mitk::SegGroupInsertUndoRedoHelper::m_NoGroupImages
protected

Definition at line 140 of file mitkSegChangeOperationApplier.h.

◆ m_NoLabels

bool mitk::SegGroupInsertUndoRedoHelper::m_NoLabels
protected

Definition at line 139 of file mitkSegChangeOperationApplier.h.

◆ m_RelevantGroupIDs

GroupIndexSetType mitk::SegGroupInsertUndoRedoHelper::m_RelevantGroupIDs
protected

Definition at line 138 of file mitkSegChangeOperationApplier.h.

◆ m_Segmentation

MultiLabelSegmentation::Pointer mitk::SegGroupInsertUndoRedoHelper::m_Segmentation
protected

Definition at line 137 of file mitkSegChangeOperationApplier.h.

◆ m_UndoOperation

SegChangeOperationBase* mitk::SegGroupInsertUndoRedoHelper::m_UndoOperation
protected

Definition at line 142 of file mitkSegChangeOperationApplier.h.


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