Medical Imaging Interaction Toolkit  2016.11.0
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 NULL 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 28 of file mitkUndoController.h.

Member Typedef Documentation

Definition at line 40 of file mitkUndoController.h.

Member Enumeration Documentation

Enumerator
LIMITEDLINEARUNDO 
VERBOSE_LIMITEDLINEARUNDO 
TREEUNDO 

Definition at line 32 of file mitkUndoController.h.

Constructor & Destructor Documentation

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 31 of file mitkUndoController.cpp.

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

mitk::UndoController::~UndoController ( )
virtual

Definition at line 58 of file mitkUndoController.cpp.

Member Function Documentation

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 137 of file mitkUndoController.cpp.

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

void mitk::UndoController::Clear ( )

Clears the Undo and the RedoList.

Definition at line 96 of file mitkUndoController.cpp.

void mitk::UndoController::ClearRedoList ( )

Clears the RedoList.

Definition at line 101 of file mitkUndoController.cpp.

mitk::UndoModel * mitk::UndoController::GetCurrentUndoModel ( )
static
int mitk::UndoController::GetLastGroupEventIdInList ( )

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

Definition at line 204 of file mitkUndoController.cpp.

int mitk::UndoController::GetLastObjectEventIdInList ( )

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

Definition at line 199 of file mitkUndoController.cpp.

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 NULL

Definition at line 209 of file mitkUndoController.cpp.

bool mitk::UndoController::Redo ( )

calls the RedoMechanism to redo the operations undone

read the Documentation of Undo!

Definition at line 82 of file mitkUndoController.cpp.

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 87 of file mitkUndoController.cpp.

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

bool mitk::UndoController::RedoListEmpty ( )

returns true, if the RedoList is empty

Definition at line 106 of file mitkUndoController.cpp.

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 168 of file mitkUndoController.cpp.

bool mitk::UndoController::SetOperationEvent ( UndoStackItem operationEvent)

Definition at line 62 of file mitkUndoController.cpp.

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 114 of file mitkUndoController.cpp.

Referenced by UndoController().

bool mitk::UndoController::Undo ( )

calls the UndoMechanism to undo the last change

Definition at line 68 of file mitkUndoController.cpp.

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 73 of file mitkUndoController.cpp.

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

Member Data Documentation

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

Default UndoModel to use.

Definition at line 43 of file mitkUndoController.h.


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