|
A Stack to save a history of Actions. More...
#include <MemoryX/gui-plugins/SceneEditor/controller/UndoRedoStack.h>
Public Member Functions | |
bool | canRedo () |
Returns the possibility to redo a Action. More... | |
bool | canUndo () |
Returns the possibility to undo a Action. More... | |
void | clear () |
Removes all actions from the history. More... | |
void | push (const std::shared_ptr< std::vector< OperationPtr > > &operations) |
Adds a Action to the history. More... | |
std::shared_ptr< std::vector< OperationPtr > > | redo () |
Goes one step forward in the history and returns the Operations need to redo. More... | |
std::shared_ptr< std::vector< OperationPtr > > | undo () |
Goes one step back in the history and returns the Operations need to redo. More... | |
UndoRedoStack () | |
A constructor. More... | |
void | updateObjectId (std::string oldId, std::string newId) |
Swaps oldId and newId in all Operations saved in this class. More... | |
A Stack to save a history of Actions.
This Stack provides Functions to move forward and backward in the history.
Definition at line 44 of file UndoRedoStack.h.
UndoRedoStack | ( | ) |
A constructor.
Creates a new Instance of this class.
Definition at line 33 of file UndoRedoStack.cpp.
bool canRedo | ( | ) |
Returns the possibility to redo a Action.
Definition at line 44 of file UndoRedoStack.cpp.
bool canUndo | ( | ) |
Returns the possibility to undo a Action.
Definition at line 39 of file UndoRedoStack.cpp.
void clear | ( | ) |
Removes all actions from the history.
Definition at line 130 of file UndoRedoStack.cpp.
void push | ( | const std::shared_ptr< std::vector< OperationPtr > > & | operations | ) |
Adds a Action to the history.
The redo history will be cleared.
action | The action to add to the history. |
Definition at line 86 of file UndoRedoStack.cpp.
std::shared_ptr< std::vector< controller::OperationPtr > > redo | ( | ) |
Goes one step forward in the history and returns the Operations need to redo.
Definition at line 68 of file UndoRedoStack.cpp.
std::shared_ptr< std::vector< controller::OperationPtr > > undo | ( | ) |
Goes one step back in the history and returns the Operations need to redo.
Definition at line 49 of file UndoRedoStack.cpp.
void updateObjectId | ( | std::string | oldId, |
std::string | newId | ||
) |
Swaps oldId and newId in all Operations saved in this class.
oldId | the first ID |
newId | the second ID |
Definition at line 97 of file UndoRedoStack.cpp.