Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
|
Represents a pair of operations: undo and the according redo. More...
#include <mitkOperationEvent.h>
Public Member Functions | |
OperationEvent (OperationActor *destination, Operation *operation, Operation *undoOperation, std::string description="") | |
~OperationEvent () override | |
Operation * | GetOperation () |
OperationActor * | GetDestination () |
void | ReverseOperations () override |
void | ReverseAndExecute () override |
virtual bool | IsValid () |
Public Member Functions inherited from mitk::UndoStackItem | |
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... | |
Protected Member Functions | |
void | OnObjectDeleted () |
Additional Inherited Members | |
Static Public Member Functions inherited from mitk::UndoStackItem | |
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 inherited from mitk::UndoStackItem | |
bool | m_Reversed |
true, if operation and undooperation have been swapped/changed More... | |
Represents a pair of operations: undo and the according redo.
Additionally to the base class UndoStackItem, which only provides a description of an item, OperationEvent does the actual accounting of the undo/redo stack. This class holds two Operation objects (operation and its inverse operation) and the corresponding OperationActor. The operations may be swapped by the undo models, when an OperationEvent is moved from their undo to their redo stack or vice versa.
Note, that memory management of operation and undooperation is done by this class. Memory of both objects is freed in the destructor. For this, the method IsValid() is needed which holds information of the state of m_Destination. In case the object referenced by m_Destination is already deleted, isValid() returns false. In more detail if the destination happens to be an itk::Object (often the case), OperationEvent is informed as
Definition at line 139 of file mitkOperationEvent.h.
mitk::OperationEvent::OperationEvent | ( | OperationActor * | destination, |
Operation * | operation, | ||
Operation * | undoOperation, | ||
std::string | description = "" |
||
) |
|
override |
OperationActor* mitk::OperationEvent::GetDestination | ( | ) |
Operation* mitk::OperationEvent::GetOperation | ( | ) |
|
virtual |
|
protected |
|
overridevirtual |
Reimplemented from mitk::UndoStackItem.
|
overridevirtual |
Reimplemented from mitk::UndoStackItem.