MeshLib C++ Docs
Loading...
Searching...
No Matches
MRHistoryAction.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshFwd.h"
3#include <functional>
4#include <string>
5
6namespace MR
7{
10
11
15{
16public:
17 virtual ~HistoryAction() = default;
18
19 virtual std::string name() const = 0;
20
21 enum class Type
22 {
23 Undo,
24 Redo
25 };
27 virtual void action( Type actionType ) = 0;
28
30 [[nodiscard]] virtual size_t heapBytes() const = 0;
31};
32
33using HistoryStackFilter = std::function<bool( const std::shared_ptr<HistoryAction>& )>;
34using HistoryActionsVector = std::vector<std::shared_ptr<HistoryAction>>;
35
42MRMESH_API std::pair<bool, int> filterHistoryActionsVector( HistoryActionsVector& historyVector,
43 HistoryStackFilter filteringCondition, size_t firstRedoIndex = 0, bool deepFiltering = true );
44
45}
Definition MRHistoryAction.h:15
std::function< bool(const std::shared_ptr< HistoryAction > &)> HistoryStackFilter
Definition MRHistoryAction.h:33
std::vector< std::shared_ptr< HistoryAction > > HistoryActionsVector
Definition MRHistoryAction.h:34
virtual ~HistoryAction()=default
virtual std::string name() const =0
MRMESH_API std::pair< bool, int > filterHistoryActionsVector(HistoryActionsVector &historyVector, HistoryStackFilter filteringCondition, size_t firstRedoIndex=0, bool deepFiltering=true)
Remove actions from history actions vector that match the condition.
Type
Definition MRHistoryAction.h:22
virtual size_t heapBytes() const =0
returns the amount of memory this object occupies on heap
virtual void action(Type actionType)=0
This function is called on history action (undo, redo, etc.)
only for bindings generation
Definition MRCameraOrientationPlugin.h:8