This class stores history stack for undo/redo.
More...
#include <MRHistoryStore.h>
|
| enum class | ChangeType {
PreAppendAction
, PostAppendAction
, PreUndo
, PostUndo
,
PreRedo
, PostRedo
, Clear
, PopAction
,
Filter
} |
| | Signal is called after this store changed. More...
|
| |
| using | HistoryStoreChangedSignal = boost::signals2::signal<void( HistoryStore& store, ChangeType, std::shared_ptr<HistoryAction> action )> |
| |
This class stores history stack for undo/redo.
◆ HistoryStoreChangedSignal
◆ ChangeType
Signal is called after this store changed.
| Enumerator |
|---|
| PreAppendAction | called before action is appended (allows to decorate raw actions with scopes): action - that is about to be added
|
| PostAppendAction | called after action is appended either to store or to current scope: action - one that was just added
|
| PreUndo | called right before action is undone: action - the that will be undone
|
| PostUndo | called right after action is undone: action - the that have been undone
|
| PreRedo | called right before action is redone: action - the that will be redone
|
| PostRedo | called right after action is redone: action - the that have been redone
|
| Clear | called when this store is cleaned: action - nullptr
|
| PopAction | called after removing action that exceeds memory limit: action - nullptr
|
| Filter | called after this store is filtered: action - nullptr
|
◆ ~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()
Returns full history stack.
◆ getLastAction()
Returns the last undo or redo action based on requested type or empty pointer if corresponding stack is empty.
◆ getLastActionName()
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()
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()
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: