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

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

#include <mitkSegChangeOperationApplier.h>

Collaboration diagram for mitk::SegGroupRemoveUndoRedoHelper:

Public Types

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

Public Member Functions

 SegGroupRemoveUndoRedoHelper (MultiLabelSegmentation *segmentation, const GroupIndexSetType &relevantGroupIDs, bool noLabels=false, bool noGroupImages=false)
 Capture the current state of the groups that will be removed (for undo). More...
 
 ~SegGroupRemoveUndoRedoHelper ()
 
void RegisterUndoRedoOperationEvent (const std::string &description)
 Register the undo (insert) and redo (remove) operations on the undo stack. More...
 

Protected Attributes

MultiLabelSegmentation::Pointer m_Segmentation
 
GroupIndexSetType m_RelevantGroupIDs
 
SegChangeOperationBase * m_UndoOperation
 

Detailed Description

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

On construction, a SegGroupInsertOperation is prepared as the undo operation (capturing the groups that are about to be removed). After the removal is performed, call RegisterUndoRedoOperationEvent() to register the undo/redo pair.

See also
SegGroupRemoveOperation
SegChangeOperationApplier

Definition at line 154 of file mitkSegChangeOperationApplier.h.

Member Typedef Documentation

◆ GroupIndexSetType

Constructor & Destructor Documentation

◆ SegGroupRemoveUndoRedoHelper()

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

Capture the current state of the groups that will be removed (for undo).

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

◆ ~SegGroupRemoveUndoRedoHelper()

mitk::SegGroupRemoveUndoRedoHelper::~SegGroupRemoveUndoRedoHelper ( )

Member Function Documentation

◆ RegisterUndoRedoOperationEvent()

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

Register the undo (insert) and redo (remove) operations on the undo stack.

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

Member Data Documentation

◆ m_RelevantGroupIDs

GroupIndexSetType mitk::SegGroupRemoveUndoRedoHelper::m_RelevantGroupIDs
protected

Definition at line 178 of file mitkSegChangeOperationApplier.h.

◆ m_Segmentation

MultiLabelSegmentation::Pointer mitk::SegGroupRemoveUndoRedoHelper::m_Segmentation
protected

Definition at line 177 of file mitkSegChangeOperationApplier.h.

◆ m_UndoOperation

SegChangeOperationBase* mitk::SegGroupRemoveUndoRedoHelper::m_UndoOperation
protected

Definition at line 181 of file mitkSegChangeOperationApplier.h.


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