Medical Imaging Interaction Toolkit  2018.4.99-b585543d
Medical Imaging Interaction Toolkit
mitk::UndoController Class Reference

#include <mitkUndoController.h>

Public Types

enum  UndoType { LIMITEDLINEARUNDO, VERBOSE_LIMITEDLINEARUNDO, TREEUNDO }
 
typedef std::map< UndoType, UndoModel::PointerUndoModelMap
 
typedef std::map< UndoType, UndoModel::Pointer >::iterator UndoModelMapIter
 

Public Member Functions

 UndoController (UndoType undoType=DEFAULTUNDOMODEL)
 
virtual ~UndoController ()
 
bool SetOperationEvent (UndoStackItem *operationEvent)
 
bool Undo ()
 calls the UndoMechanism to undo the last change More...
 
bool Undo (bool fine)
 calls the UndoMechanism to undo the last change More...
 
bool Redo ()
 calls the RedoMechanism to redo the operations undone More...
 
bool Redo (bool fine)
 calls the RedoMechanism to redo the operations undone More...
 
void Clear ()
 Clears the Undo and the RedoList. More...
 
void ClearRedoList ()
 Clears the RedoList. More...
 
bool RedoListEmpty ()
 returns true, if the RedoList is empty More...
 
bool SwitchUndoModel (UndoType undoType)
 
bool AddUndoModel (UndoType undoType)
 
bool RemoveUndoModel (UndoType undoType)
 
int GetLastObjectEventIdInList ()
 returns the ObjectEventId of the top Element in the OperationHistory of the selected UndoModel More...
 
int GetLastGroupEventIdInList ()
 returns the GroupEventId of the top Element in the OperationHistory of the selected UndoModel More...
 
OperationEventGetLastOfType (OperationActor *destination, OperationType opType)
 returns the last specified OperationEvent in Undo-list corresponding to the given value; if nothing found, then returns nullptr More...
 

Static Public Member Functions

static UndoModelGetCurrentUndoModel ()
 gives access to the currently used UndoModel Introduced to access special functions of more specific UndoModels, especially to retrieve text descriptions of the undo/redo stack More...
 

Static Public Attributes

static const UndoType DEFAULTUNDOMODEL
 Default UndoModel to use. More...
 

Detailed Description

Definition at line 24 of file mitkUndoController.h.

Member Typedef Documentation

◆ UndoModelMap

◆ UndoModelMapIter

Definition at line 36 of file mitkUndoController.h.

Member Enumeration Documentation

◆ UndoType

Enumerator
LIMITEDLINEARUNDO 
VERBOSE_LIMITEDLINEARUNDO 
TREEUNDO 

Definition at line 28 of file mitkUndoController.h.

Constructor & Destructor Documentation

◆ UndoController()

mitk::UndoController::UndoController ( UndoType  undoType = DEFAULTUNDOMODEL)

Constructor; Adds the new UndoType or if undoType exists , switches it to undoType; for UndoTypes see definitionmitkInteractionConst.h

Definition at line 27 of file mitkUndoController.cpp.

References LIMITEDLINEARUNDO, mitk::VerboseLimitedLinearUndo::New(), mitk::LimitedLinearUndo::New(), SwitchUndoModel(), and VERBOSE_LIMITEDLINEARUNDO.

◆ ~UndoController()

mitk::UndoController::~UndoController ( )
virtual

Definition at line 54 of file mitkUndoController.cpp.

Member Function Documentation

◆ AddUndoModel()

bool mitk::UndoController::AddUndoModel ( UndoType  undoType)

adds a new kind of UndoModel to the set of UndoModels and switches to that UndoModel if the UndoModel exists already in the List, then nothing is done

Definition at line 133 of file mitkUndoController.cpp.

References LIMITEDLINEARUNDO, mitk::VerboseLimitedLinearUndo::New(), mitk::LimitedLinearUndo::New(), and VERBOSE_LIMITEDLINEARUNDO.

◆ Clear()

void mitk::UndoController::Clear ( )

Clears the Undo and the RedoList.

Definition at line 92 of file mitkUndoController.cpp.

◆ ClearRedoList()

void mitk::UndoController::ClearRedoList ( )

Clears the RedoList.

Definition at line 97 of file mitkUndoController.cpp.

◆ GetCurrentUndoModel()

◆ GetLastGroupEventIdInList()

int mitk::UndoController::GetLastGroupEventIdInList ( )

returns the GroupEventId of the top Element in the OperationHistory of the selected UndoModel

Definition at line 200 of file mitkUndoController.cpp.

◆ GetLastObjectEventIdInList()

int mitk::UndoController::GetLastObjectEventIdInList ( )

returns the ObjectEventId of the top Element in the OperationHistory of the selected UndoModel

Definition at line 195 of file mitkUndoController.cpp.

◆ GetLastOfType()

mitk::OperationEvent * mitk::UndoController::GetLastOfType ( OperationActor destination,
OperationType  opType 
)

returns the last specified OperationEvent in Undo-list corresponding to the given value; if nothing found, then returns nullptr

Definition at line 205 of file mitkUndoController.cpp.

◆ Redo() [1/2]

bool mitk::UndoController::Redo ( )

calls the RedoMechanism to redo the operations undone

read the Documentation of Undo!

Definition at line 78 of file mitkUndoController.cpp.

◆ Redo() [2/2]

bool mitk::UndoController::Redo ( bool  fine)

calls the RedoMechanism to redo the operations undone

read the Documentation of Undo! only with the possibility to fine redo, like fine undo

Definition at line 83 of file mitkUndoController.cpp.

References mitk::RenderingManager::GetInstance(), and mitk::RenderingManager::RequestUpdateAll().

◆ RedoListEmpty()

bool mitk::UndoController::RedoListEmpty ( )

returns true, if the RedoList is empty

Definition at line 102 of file mitkUndoController.cpp.

◆ RemoveUndoModel()

bool mitk::UndoController::RemoveUndoModel ( UndoType  undoType)

Removes an UndoModel from the set of UndoModels If that UndoModel is currently selected, then the DefaultUndoModel(const) is set. If the default is not in List, then the first UndoModel is set. UndoList may not be empty, so if the UndoType is the last, then return false;

Definition at line 164 of file mitkUndoController.cpp.

References DEFAULTUNDOMODEL.

◆ SetOperationEvent()

◆ SwitchUndoModel()

bool mitk::UndoController::SwitchUndoModel ( UndoType  undoType)

Switches the UndoModel to the given Type if there is no equal Type in List, then return false

Definition at line 110 of file mitkUndoController.cpp.

Referenced by UndoController().

◆ Undo() [1/2]

bool mitk::UndoController::Undo ( )

calls the UndoMechanism to undo the last change

Definition at line 64 of file mitkUndoController.cpp.

◆ Undo() [2/2]

bool mitk::UndoController::Undo ( bool  fine)

calls the UndoMechanism to undo the last change

the UndoMechanism has the possibility to undo the last changes in two different ways: first it can Undo a group of operations done at last (e.g. build up a new object; Undo leads to deleting that

Definition at line 69 of file mitkUndoController.cpp.

References mitk::RenderingManager::GetInstance(), and mitk::RenderingManager::RequestUpdateAll().

Member Data Documentation

◆ DEFAULTUNDOMODEL

const mitk::UndoController::UndoType mitk::UndoController::DEFAULTUNDOMODEL
static

Default UndoModel to use.

Definition at line 39 of file mitkUndoController.h.

Referenced by RemoveUndoModel().


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