20#include <mlUndoContext.h>
63 void openGroup(
const std::string& description =
"Contour Operation");
120 int _currentGroupDepth;
126 ml::UndoContextPtr _undoContext;
129 ml::UndoContextPtr _defaultUndoContext;
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
BaseEvent is the base class for all events emitted from EventSourceBase.
Base class for a CSOCommand for the undo/redo mechanism.
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
Manager class for maintaining the undo and the redo stacks.
bool isInRedoMode() const
Returns whether the manager is in redo-mode.
void disableUndoRedo()
Disables this undo/redo manager; if it is disabled, the incoming commands are deleted and not added.
bool canRedo() const
Returns whether there are possible redoes.
void openGroup(const std::string &description="Contour Operation")
Opens a group of commands that are undone/redone as one.
UNDO_MODE
The undo (and redo) modes.
int numUndos() const
Returns the number of stored undo steps.
CSOUndoRedoManager(CSOList *csoList)
Constructor.
void popUndoCommand()
Removes the last added undo command without executing it.
void clearAll()
Clears the undo and redo stack.
void enableUndoRedo()
Enables this undo/redo manager.
void closeGroup()
Closes a group of commands that are undone/redone as one.
bool isEnabled()
Returns whether this undo/redo manager is currently enabled.
void closeAllGroups()
Closes all undo/redo groups.
void undo()
Performs an undo of the last modification (if undo stack is not empty).
int maxNumUndos() const
Returns the maximum number of possible undos. If a -1 is returned, the undo stack has no limitation.
void redo()
Performs a redo (if the undo stack is not empty).
int getCurrentUndoGroupDepth()
Returns the current undo group depth.
bool isInUndoMode() const
Returns whether the manager is in undo-mode.
void setUndoContext(ml::UndoContextPtr undoContext)
Set a new undo context.
void setMaxNumUndos(MLint newMaxNumUndos)
void setMaxNumUndos(int newMaxNumUndos)
Sets the maximum number of possible undos. If a -1 is passed, the undo stack has no limitation.
~CSOUndoRedoManager()
Destructor.
int numRedos() const
Returns the number of stored redo steps.
bool canUndo() const
Returns whether there are possible undoes.
void addCommand(CSOCommand *command)
Adds a command (modification).
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...