18 s->appendAction( std::move( action ) );
22template<
class HistoryActionType,
typename... Args>
25 static_assert( std::is_base_of_v<HistoryAction, HistoryActionType> );
28 AppendHistory( std::make_shared<HistoryActionType>( std::forward<Args>( args )... ) );
33template<
class HistoryActionType>
37 static_assert( std::is_base_of_v<HistoryAction, HistoryActionType> );
38 using Obj =
typename HistoryActionType::Obj;
40 template<
typename... Args>
41 Historian( std::string name, std::shared_ptr<Obj> obj, Args&&... args ) : obj_( std::move( obj ) )
44 action_ = std::make_shared<HistoryActionType>( std::move( name ), obj_, std::forward<Args>( args )... );
62 HistoryActionType::setObjectDirty( obj_ );
65 std::shared_ptr<Obj> obj_;
66 std::shared_ptr<HistoryActionType> action_;
67 bool canceled_{
false };
85 const std::shared_ptr<CombinedHistoryAction>&
combinedAction()
const {
return combinedAction_; }
89 std::shared_ptr<CombinedHistoryAction> combinedAction_;
93#define SCOPED_HISTORY(name) MR::ScopeHistory __startScopedHistoryMode(name)
Definition MRAppendHistory.h:35
This class stores history stack for undo/redo.
Definition MRHistoryStore.h:16
static MRVIEWER_API HistoryStore * getViewerInstance()
The purpose of this class is to combine all actions appended to global history store in one big actio...
Definition MRAppendHistory.h:76
MRVIEWER_API ScopeHistory(const std::string &name)
creates new CombinedHistoryAction, and setups global history store to append all new actions there du...
MRVIEWER_API ~ScopeHistory()
created before CombinedHistoryAction if not empty is appended (with all sub-actions) in the global hi...
void AppendHistory(std::shared_ptr< HistoryAction > action)
Appends given history action to viewer's global history store.
Definition MRAppendHistory.h:15
Historian(std::string name, std::shared_ptr< Obj > obj, Args &&... args)
Definition MRAppendHistory.h:41
void cancelAction()
Definition MRAppendHistory.h:47
~Historian()
Definition MRAppendHistory.h:57
std::function< bool(const std::shared_ptr< HistoryAction > &)> HistoryStackFilter
Definition MRHistoryAction.h:33
std::vector< std::shared_ptr< HistoryAction > > HistoryActionsVector
Definition MRHistoryAction.h:34
const std::shared_ptr< CombinedHistoryAction > & combinedAction() const
returns the action being populated
Definition MRAppendHistory.h:85
typename HistoryActionType::Obj Obj
Definition MRAppendHistory.h:38
MRVIEWER_API void FilterHistoryByCondition(HistoryStackFilter filteringCondition, bool deepFiltering=true)
only for bindings generation
Definition MRCameraOrientationPlugin.h:8