This class stores history stack for undo/redo.
More...
#include <MRHistoryStore.h>
|
| virtual MRVIEWER_API | ~HistoryStore () |
| |
| virtual MRVIEWER_API void | appendAction (std::shared_ptr< HistoryAction > action) |
| |
| HistoryActionsVector * | getScopeBlockPtr () const |
| | Returns current scope ptr.
|
| |
| void | setScopeBlockPtr (HistoryActionsVector *scopedBlock) |
| | Sets pointer to current scope block.
|
| |
| bool | isSceneModified () const |
| | Returns true if the current scene state does not match the saved state.
|
| |
| void | setSavedState () |
| | Consider the current scene state as saved.
|
| |
| MRVIEWER_API void | clear () |
| | Clears this HistoryStore.
|
| |
| void | setMemoryLimit (size_t limit) |
| | Set memory limit for this store, if history stack exceed it - old actions are removed.
|
| |
| size_t | getMemoryLimit () const |
| | Returns current memory limit for this store (by default uint64 max)
|
| |
| MRVIEWER_API size_t | calcUsedMemory () const |
| | Compute amount of memory occupied by all actions in this store.
|
| |
| const HistoryActionsVector & | getHistoryStack () const |
| | Returns full history stack.
|
| |
| size_t | getStackPointer () const |
| | Returns index of first redo action in stack.
|
| |
| MRVIEWER_API void | filterStack (HistoryStackFilter filteringCondition, bool deepFiltering=true) |
| | remove some actions according to condition
|
| |
| virtual MRVIEWER_API bool | undo () |
| |
| virtual MRVIEWER_API bool | redo () |
| |
| bool | undoRedoInProgress () const |
| | true only during Undo or Redo ongoing operation
|
| |
| MRVIEWER_API std::vector< std::string > | getNActions (unsigned n, HistoryAction::Type type) const |
| | Returns names of last N undo actions or first N redo actions.
|
| |
| MRVIEWER_API std::shared_ptr< HistoryAction > | getLastAction (HistoryAction::Type type) const |
| | Returns the last undo or redo action based on requested type or empty pointer if corresponding stack is empty.
|
| |
| MRVIEWER_API std::string | getLastActionName (HistoryAction::Type type) const |
| | Returns the name of last undo or redo action (or empty string if there is no such action)
|
| |
This class stores history stack for undo/redo.
◆ HistoryStoreChangedSignal
◆ ChangeType
Signal is called after this store changed.
| Enumerator |
|---|
| AppendAction | additions in scoped block does not provide signal
|
| PreUndo | |
| PostUndo | |
| PreRedo | |
| PostRedo | |
| Clear | |
| PopAction | called after removing action that exceeds memory limit
|
| Filter | |
◆ ~HistoryStore()
| virtual MRVIEWER_API MR::HistoryStore::~HistoryStore |
( |
| ) |
|
|
virtual |
◆ appendAction()
| virtual MRVIEWER_API void MR::HistoryStore::appendAction |
( |
std::shared_ptr< HistoryAction > | action | ) |
|
|
virtual |
Adds action in history stack (clears available redo actions) adds actions to scope block if scope mode is active (do not affect main stack)
◆ calcUsedMemory()
| MRVIEWER_API size_t MR::HistoryStore::calcUsedMemory |
( |
| ) |
const |
|
nodiscard |
Compute amount of memory occupied by all actions in this store.
◆ clear()
| MRVIEWER_API void MR::HistoryStore::clear |
( |
| ) |
|
◆ filterStack()
| MRVIEWER_API void MR::HistoryStore::filterStack |
( |
HistoryStackFilter | filteringCondition, |
|
|
bool | deepFiltering = true ) |
remove some actions according to condition
◆ getHistoryStack()
| const HistoryActionsVector & MR::HistoryStore::getHistoryStack |
( |
| ) |
const |
|
inlinenodiscard |
Returns full history stack.
◆ getLastAction()
| MRVIEWER_API std::shared_ptr< HistoryAction > MR::HistoryStore::getLastAction |
( |
HistoryAction::Type | type | ) |
const |
|
nodiscard |
Returns the last undo or redo action based on requested type or empty pointer if corresponding stack is empty.
◆ getLastActionName()
| MRVIEWER_API std::string MR::HistoryStore::getLastActionName |
( |
HistoryAction::Type | type | ) |
const |
|
nodiscard |
Returns the name of last undo or redo action (or empty string if there is no such action)
◆ getMemoryLimit()
| size_t MR::HistoryStore::getMemoryLimit |
( |
| ) |
const |
|
inlinenodiscard |
Returns current memory limit for this store (by default uint64 max)
◆ getNActions()
| MRVIEWER_API std::vector< std::string > MR::HistoryStore::getNActions |
( |
unsigned | n, |
|
|
HistoryAction::Type | type ) const |
|
nodiscard |
Returns names of last N undo actions or first N redo actions.
◆ getScopeBlockPtr()
| HistoryActionsVector * MR::HistoryStore::getScopeBlockPtr |
( |
| ) |
const |
|
inlinenodiscard |
Returns current scope ptr.
◆ getStackPointer()
| size_t MR::HistoryStore::getStackPointer |
( |
| ) |
const |
|
inlinenodiscard |
Returns index of first redo action in stack.
◆ getViewerInstance()
| static MRVIEWER_API HistoryStore * MR::HistoryStore::getViewerInstance |
( |
| ) |
|
|
staticnodiscard |
returns the instance (if any) of HistoryStore from the viewer returns nullptr if history store is not available
◆ isSceneModified()
| bool MR::HistoryStore::isSceneModified |
( |
| ) |
const |
|
inlinenodiscard |
Returns true if the current scene state does not match the saved state.
◆ redo()
| virtual MRVIEWER_API bool MR::HistoryStore::redo |
( |
| ) |
|
|
virtual |
◆ setMemoryLimit()
| void MR::HistoryStore::setMemoryLimit |
( |
size_t | limit | ) |
|
|
inline |
Set memory limit for this store, if history stack exceed it - old actions are removed.
◆ setSavedState()
| void MR::HistoryStore::setSavedState |
( |
| ) |
|
|
inline |
Consider the current scene state as saved.
◆ setScopeBlockPtr()
| void MR::HistoryStore::setScopeBlockPtr |
( |
HistoryActionsVector * | scopedBlock | ) |
|
|
inline |
Sets pointer to current scope block.
◆ undo()
| virtual MRVIEWER_API bool MR::HistoryStore::undo |
( |
| ) |
|
|
virtual |
◆ undoRedoInProgress()
| bool MR::HistoryStore::undoRedoInProgress |
( |
| ) |
const |
|
inlinenodiscard |
true only during Undo or Redo ongoing operation
◆ changedSignal
The documentation for this class was generated from the following file: