MeshLib Documentation
Loading...
Searching...
No Matches
MRCombinedHistoryAction.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshFwd.h"
3#include "MRHistoryAction.h"
4#include <memory>
5
6namespace MR
7{
8
12{
13public:
15 MRMESH_API CombinedHistoryAction( const std::string& name, const std::vector<std::shared_ptr<HistoryAction>>& actions );
16
17 virtual std::string name() const override
18 {
19 return name_;
20 }
21
22 MRMESH_API virtual void action( HistoryAction::Type type ) override;
23
24 const HistoryActionsVector& getStack() const { return actions_; }
25
28 MRMESH_API bool filter( HistoryStackFilter filteringCondition );
29
30 bool empty() const { return actions_.empty(); };
31
32 [[nodiscard]] MRMESH_API virtual size_t heapBytes() const override;
33
34private:
35 HistoryActionsVector actions_;
36 std::string name_;
37};
38
39}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
#define MRMESH_CLASS
Definition MRMesh/MRMeshFwd.h:50
Definition MRCombinedHistoryAction.h:12
bool empty() const
Definition MRCombinedHistoryAction.h:30
MRMESH_API bool filter(HistoryStackFilter filteringCondition)
const HistoryActionsVector & getStack() const
Definition MRCombinedHistoryAction.h:24
virtual std::string name() const override
Definition MRCombinedHistoryAction.h:17
virtual MRMESH_API void action(HistoryAction::Type type) override
This function is called on history action (undo, redo, etc.)
virtual MRMESH_API size_t heapBytes() const override
returns the amount of memory this object occupies on heap
MRMESH_API CombinedHistoryAction(const std::string &name, const std::vector< std::shared_ptr< HistoryAction > > &actions)
Will call action() for each actions in given order (undo in reverse, redo in forward)
Definition MRHistoryAction.h:12
Type
Definition MRHistoryAction.h:19
Definition MRCameraOrientationPlugin.h:8
std::function< bool(const std::shared_ptr< HistoryAction > &)> HistoryStackFilter
Definition MRHistoryAction.h:30
std::vector< std::shared_ptr< HistoryAction > > HistoryActionsVector
Definition MRHistoryAction.h:31