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{
11
12
15class MRMESH_CLASS ChangeSceneAction : public HistoryAction
16{
17public:
18 enum class Type
19 {
20 AddObject,
21 RemoveObject
22 };
24 MRMESH_API ChangeSceneAction( const std::string& name, const std::shared_ptr<Object>& obj, Type type );
25
26 virtual std::string name() const override { return name_; }
27
28 MRMESH_API virtual void action( HistoryAction::Type actionType ) override;
29
30 [[nodiscard]] MRMESH_API virtual size_t heapBytes() const override;
31
32private:
34 void updateParent_();
35
36 Object* parent_{ nullptr };
37 std::shared_ptr<Object> nextObj_;
38 std::shared_ptr<Object> obj_;
39 std::string name_;
40 Type type_;
41};
42
43}
Definition MRChangeSceneAction.h:16
Definition MRHistoryAction.h:15
named object in the data model
Definition MRObject.h:62
MRMESH_API ChangeSceneAction(const std::string &name, const std::shared_ptr< Object > &obj, Type type)
Constructed before removal or addition.
virtual MRMESH_API void action(HistoryAction::Type actionType) override
This function is called on history action (undo, redo, etc.)
Type
Definition MRHistoryAction.h:22
virtual std::string name() const override
Definition MRChangeSceneAction.h:26
Type
Definition MRChangeSceneAction.h:19
virtual MRMESH_API size_t heapBytes() const override
returns the amount of memory this object occupies on heap
only for bindings generation
Definition MRCameraOrientationPlugin.h:8