MeshLib
 
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
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 MRMesh/MRMeshFwd.h:46
#define MRMESH_CLASS
Definition MRMesh/MRMeshFwd.h:50
Definition MRChangeSceneAction.h:13
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.)
virtual std::string name() const override
Definition MRChangeSceneAction.h:23
Type
Definition MRChangeSceneAction.h:16
virtual MRMESH_API size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRHistoryAction.h:12
Type
Definition MRHistoryAction.h:19
named object in the data model
Definition MRObject.h:60
Definition MRCameraOrientationPlugin.h:7