MeshLib C++ Docs
Loading...
Searching...
No Matches
MRChangeSceneAction.h
Go to the documentation of this file.
1#pragma once
2#include "MRHistoryAction.h"
3#include "MRObject.h"
4#include <memory>
5
6
7namespace MR
8{
9
12class MRMESH_CLASS ChangeSceneAction : public HistoryAction
13{
14public:
15 enum class Type
16 {
17 AddObject,
18 RemoveObject
19 };
21 MRMESH_API ChangeSceneAction( const std::string& name, const std::shared_ptr<Object>& obj, Type type );
22
23 virtual std::string name() const override { return name_; }
24
25 MRMESH_API virtual void action( HistoryAction::Type actionType ) override;
26
27 [[nodiscard]] MRMESH_API virtual size_t heapBytes() const override;
28
29private:
31 void updateParent_();
32
33 Object* parent_{ nullptr };
34 std::shared_ptr<Object> nextObj_;
35 std::shared_ptr<Object> obj_;
36 std::string name_;
37 Type type_;
38};
39
40}
#define MRMESH_API
Definition MRMeshFwd.h:80
#define MRMESH_CLASS
Definition MRMeshFwd.h:87
std::string name(const T &primitive)
Definition MRFeatures.h:309
Definition MRCameraOrientationPlugin.h:8
int heapBytes(FloatGrid grid)