13 #ifndef mitkOperationEvent_h
14 #define mitkOperationEvent_h
135 static int m_CurrObjectEventId;
137 static int m_CurrGroupEventId;
143 std::string m_Description;
182 std::string description =
"");
Convenience class that helps to manage the lifetime of itk event observers.
abstract class, that can be used by Undo to undo an operation.
Pairs a do-operation with its inverse undo-operation.
void ReverseAndExecute() override
Reverse the operations and execute the (now current) do-operation.
OperationActor * GetDestination()
Get the destination actor for the operations.
~OperationEvent() override
Destructor.
Operation * GetOperation()
Get the current do-operation.
bool IsValid() const override
Check whether this event is still valid.
void ReverseOperations() override
Swap the do-operation and undo-operation.
OperationEvent(OperationActor *destination, Operation *operation, Operation *undoOperation, std::string description="")
Construct an OperationEvent.
Base class for all operations in the undo/redo framework.
Abstract superclass for all undo models.
Represents an entry on the undo or redo stack.
virtual void ReverseOperations()
Swap the do/undo operations (toggle reversed state).
static void IncCurrObjectEventId()
Increment the global ObjectEventId counter.
std::string GetDescription()
Get the textual description of this undo entry.
virtual bool IsValid() const =0
Check whether this entry is still valid.
UndoStackItem(std::string description="")
Construct an UndoStackItem with an optional description.
static int GetCurrObjectEventId()
Get the current global ObjectEventId.
static int GetCurrGroupEventId()
Get the current global GroupEventId.
int GetGroupEventId()
Get this item's GroupEventId.
bool m_Reversed
true, if operation and undooperation have been swapped/changed
virtual ~UndoStackItem()
Virtual destructor.
int GetObjectEventId()
Get this item's ObjectEventId.
static void IncCurrGroupEventId()
Increment the global GroupEventId counter.
virtual void ReverseAndExecute()
Reverse the operations and execute them.
Find image slices visible on a given plane.