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{
8
11class HistoryAction
12{
13public:
14 virtual ~HistoryAction() = default;
15
16 virtual std::string name() const = 0;
17
18 enum class Type
19 {
20 Undo,
21 Redo
22 };
24 virtual void action( Type actionType ) = 0;
25
27 [[nodiscard]] virtual size_t heapBytes() const = 0;
28};
29
30using HistoryStackFilter = std::function<bool( const std::shared_ptr<HistoryAction>& )>;
31using HistoryActionsVector = std::vector<std::shared_ptr<HistoryAction>>;
32
39MRMESH_API std::pair<bool, int> filterHistoryActionsVector( HistoryActionsVector& historyVector,
40 HistoryStackFilter filteringCondition, size_t firstRedoIndex = 0, bool deepFiltering = true );
41
42} //namespace MR
#define MRMESH_API
Definition MRMeshFwd.h:80
unsafe void action(MR.HistoryAction.Type actionType)
Definition MRCameraOrientationPlugin.h:8
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.