13 #ifndef mitkLimitedLinearUndo_h
14 #define mitkLimitedLinearUndo_h
24 #pragma GCC visibility push(default)
26 #include <itkEventObject.h>
28 #pragma GCC visibility pop
48 itkFactorylessNewMacro(Self);
77 virtual bool Undo(
int oeid);
92 virtual bool Redo(
int oeid);
159 std::size_t m_UndoLimit;
164 #pragma GCC visibility push(default)
180 #pragma GCC visibility pop
A linear undo model with one undo and one redo stack.
void SetUndoLimit(std::size_t limit) override
Sets a limit on the size of the undo history.
~LimitedLinearUndo() override
Destructor. Deletes all undo and redo entries.
bool UndoListEmpty() override
Returns true if the UndoList is empty.
std::deque< UndoStackItem * > UndoContainer
unsigned int RemoveInvalidOperations() override
Removes invalid operations from the undo/redo stack.
LimitedLinearUndo()
Constructor.
bool RedoListEmpty() override
Returns true if the RedoList is empty.
std::size_t GetUndoLimit() const override
Gets the limit on the size of the undo history.
OperationEvent * GetLastOfType(OperationActor *destination, OperationType opType) override
Returns the last OperationEvent in the Undo-list matching the given destination and operation type.
void Clear() override
Clears both the UndoList and RedoList.
mitkClassMacro(LimitedLinearUndo, UndoModel)
void ClearList(UndoContainer *list)
Convenience method to free the memory of elements in the list and clear it.
bool Undo(bool) override
Undoes the last changes.
bool Redo(bool) override
Redoes changes (parameter currently unused).
bool Redo() override
Redoes the last undone changes.
bool SetOperationEvent(UndoStackItem *stackItem) override
Store an operation event on the undo stack.
virtual bool Undo(int oeid)
Undoes all changes until ObjectEventID oeid.
int GetLastGroupEventIdInList() override
Returns the GroupEventId of the top element in the OperationHistory.
bool Undo() override
Undoes the last changes.
std::deque< UndoStackItem * >::reverse_iterator UndoContainerRevIter
int GetLastObjectEventIdInList() override
Returns the ObjectEventId of the top element in the OperationHistory.
virtual bool Redo(int oeid)
Redoes all changes until ObjectEventID oeid.
void ClearRedoList() override
Clears the RedoList.
abstract class, that can be used by Undo to undo an operation.
Pairs a do-operation with its inverse undo-operation.
Abstract superclass for all undo models.
Represents an entry on the undo or redo stack.
Find image slices visible on a given plane.
int OperationType
Type alias for operation type identifiers.
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)