Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::UndoStackItem Class Reference

Represents an entry of the undo or redo stack. More...

#include <mitkOperationEvent.h>

Inheritance diagram for mitk::UndoStackItem:

Public Member Functions

 UndoStackItem (std::string description="")
 
virtual ~UndoStackItem ()
 
int GetGroupEventId ()
 Returns the GroupEventId for this object. More...
 
int GetObjectEventId ()
 Returns the ObjectEventId for this object. More...
 
std::string GetDescription ()
 Returns the textual description of this object. More...
 
virtual void ReverseOperations ()
 
virtual void ReverseAndExecute ()
 

Static Public Member Functions

static int GetCurrGroupEventId ()
 For combining operations in groups. More...
 
static int GetCurrObjectEventId ()
 For combining operations in Objects. More...
 
static void IncCurrObjectEventId ()
 Increases the current ObjectEventId For example if a button click generates operations the ObjectEventId has to be incremented to be able to undo. More...
 
static void IncCurrGroupEventId ()
 Increases the current GroupEventId For example if a button click generates operations the GroupEventId has to be incremented to be able to undo. More...
 

Protected Attributes

bool m_Reversed
 true, if operation and undooperation have been swaped/changed More...
 

Detailed Description

Represents an entry of the undo or redo stack.

This basic entry includes a textual description of the item and a pair of IDs. Static member functions handle creation and incrementing of these IDs.

The GroupEventID is intended for logical grouping of several related Operations. Currently this is used only by PointSetDataInteractor. How this is done and when to use GroupEventIDs is still undocumented.

Definition at line 39 of file mitkOperationEvent.h.

Constructor & Destructor Documentation

mitk::UndoStackItem::UndoStackItem ( std::string  description = "")

Definition at line 23 of file mitkOperationEvent.cpp.

References GetCurrGroupEventId(), and GetCurrObjectEventId().

mitk::UndoStackItem::~UndoStackItem ( )
virtual

Definition at line 29 of file mitkOperationEvent.cpp.

Member Function Documentation

int mitk::UndoStackItem::GetCurrGroupEventId ( )
static

For combining operations in groups.

This ID is used in the undo mechanism. For separation of the seperate operations If the GroupEventId of two OperationEvents is equal, then they share one group and will be undone in case of Undo(fine==false)

Definition at line 39 of file mitkOperationEvent.cpp.

Referenced by UndoStackItem().

int mitk::UndoStackItem::GetCurrObjectEventId ( )
static

For combining operations in Objects.

This ID is used in the Undo-Mechanism. For separation of the seperate operations If the ObjectEventId of two OperationEvents is equal, then they share one Object and will be undone in all cases of Undo(true and false). they shal not be seperated, because they were produced to realize one object-change. for example: OE_statechange and OE_addlastpoint

Definition at line 34 of file mitkOperationEvent.cpp.

Referenced by UndoStackItem().

std::string mitk::UndoStackItem::GetDescription ( )

Returns the textual description of this object.

Definition at line 64 of file mitkOperationEvent.cpp.

int mitk::UndoStackItem::GetGroupEventId ( )

Returns the GroupEventId for this object.

Definition at line 59 of file mitkOperationEvent.cpp.

int mitk::UndoStackItem::GetObjectEventId ( )

Returns the ObjectEventId for this object.

Definition at line 54 of file mitkOperationEvent.cpp.

void mitk::UndoStackItem::IncCurrGroupEventId ( )
static

Increases the current GroupEventId For example if a button click generates operations the GroupEventId has to be incremented to be able to undo.

Definition at line 49 of file mitkOperationEvent.cpp.

Referenced by QmitkSlicesInterpolator::AcceptAllInterpolations(), and mitk::SegTool2D::WriteSliceToVolume().

void mitk::UndoStackItem::IncCurrObjectEventId ( )
static
void mitk::UndoStackItem::ReverseAndExecute ( )
virtual

Reimplemented in mitk::OperationEvent.

Definition at line 74 of file mitkOperationEvent.cpp.

void mitk::UndoStackItem::ReverseOperations ( )
virtual

Reimplemented in mitk::OperationEvent.

Definition at line 69 of file mitkOperationEvent.cpp.

Referenced by mitk::OperationEvent::ReverseOperations().

Member Data Documentation

bool mitk::UndoStackItem::m_Reversed
protected

true, if operation and undooperation have been swaped/changed

Definition at line 106 of file mitkOperationEvent.h.


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