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

RAII helper that captures the state of segmentation groups for undo/redo support. More...

#include <mitkSegChangeOperationApplier.h>

Collaboration diagram for mitk::SegGroupModifyUndoRedoHelper:

Public Types

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

Public Member Functions

 SegGroupModifyUndoRedoHelper (MultiLabelSegmentation *segmentation, const GroupIndexSetType &relevantGroupIDs, bool coverAllTimeSteps, TimeStepType timeStep=0, bool noLabels=false, bool noGroupImages=false, bool noNames=false)
 Capture the current state of the given groups as the undo operation. More...
 
 ~SegGroupModifyUndoRedoHelper ()
 
void RegisterUndoRedoOperationEvent (const std::string &description)
 Capture the current (modified) state as the redo operation and register the undo/redo pair. More...
 

Protected Attributes

MultiLabelSegmentation::Pointer m_Segmentation
 
GroupIndexSetType m_RelevantGroupIDs
 
bool m_CoverAllTimeSteps
 
TimeStepType m_TimeStep
 
bool m_NoLabels
 
bool m_NoGroupImages
 
bool m_NoNames
 
SegChangeOperationBase * m_UndoOperation
 

Detailed Description

RAII helper that captures the state of segmentation groups for undo/redo support.

On construction, a snapshot of the specified groups is taken (the undo operation). After the modification is performed, call RegisterUndoRedoOperationEvent() to capture the redo state and register both operations on the undo stack.

See also
SegGroupModifyOperation
SegChangeOperationApplier

Definition at line 67 of file mitkSegChangeOperationApplier.h.

Member Typedef Documentation

◆ GroupIndexSetType

Constructor & Destructor Documentation

◆ SegGroupModifyUndoRedoHelper()

mitk::SegGroupModifyUndoRedoHelper::SegGroupModifyUndoRedoHelper ( MultiLabelSegmentation *  segmentation,
const GroupIndexSetType &  relevantGroupIDs,
bool  coverAllTimeSteps,
TimeStepType  timeStep = 0,
bool  noLabels = false,
bool  noGroupImages = false,
bool  noNames = false 
)

Capture the current state of the given groups as the undo operation.

Parameters
segmentationThe segmentation to operate on.
relevantGroupIDsThe group indices to capture.
coverAllTimeStepsIf true, all time steps are captured; otherwise only the specified one.
timeStepThe time step to capture (only used if coverAllTimeSteps is false).
noLabelsIf true, label information is not captured.
noGroupImagesIf true, group image data is not captured.
noNamesIf true, group names are not captured.

◆ ~SegGroupModifyUndoRedoHelper()

mitk::SegGroupModifyUndoRedoHelper::~SegGroupModifyUndoRedoHelper ( )

Member Function Documentation

◆ RegisterUndoRedoOperationEvent()

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

Capture the current (modified) 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_CoverAllTimeSteps

bool mitk::SegGroupModifyUndoRedoHelper::m_CoverAllTimeSteps
protected

Definition at line 96 of file mitkSegChangeOperationApplier.h.

◆ m_NoGroupImages

bool mitk::SegGroupModifyUndoRedoHelper::m_NoGroupImages
protected

Definition at line 99 of file mitkSegChangeOperationApplier.h.

◆ m_NoLabels

bool mitk::SegGroupModifyUndoRedoHelper::m_NoLabels
protected

Definition at line 98 of file mitkSegChangeOperationApplier.h.

◆ m_NoNames

bool mitk::SegGroupModifyUndoRedoHelper::m_NoNames
protected

Definition at line 100 of file mitkSegChangeOperationApplier.h.

◆ m_RelevantGroupIDs

GroupIndexSetType mitk::SegGroupModifyUndoRedoHelper::m_RelevantGroupIDs
protected

Definition at line 95 of file mitkSegChangeOperationApplier.h.

◆ m_Segmentation

MultiLabelSegmentation::Pointer mitk::SegGroupModifyUndoRedoHelper::m_Segmentation
protected

Definition at line 94 of file mitkSegChangeOperationApplier.h.

◆ m_TimeStep

TimeStepType mitk::SegGroupModifyUndoRedoHelper::m_TimeStep
protected

Definition at line 97 of file mitkSegChangeOperationApplier.h.

◆ m_UndoOperation

SegChangeOperationBase* mitk::SegGroupModifyUndoRedoHelper::m_UndoOperation
protected

Definition at line 102 of file mitkSegChangeOperationApplier.h.


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