MeshLib Documentation
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
7
namespace
MR
8
{
9
12
class
MRMESH_CLASS
ChangeSceneAction
:
public
HistoryAction
13
{
14
public
:
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
29
private
:
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
}
MRHistoryAction.h
MRMESH_API
#define MRMESH_API
Definition
MRMesh/MRMeshFwd.h:46
MRMESH_CLASS
#define MRMESH_CLASS
Definition
MRMesh/MRMeshFwd.h:50
MRObject.h
MR::ChangeSceneAction
Definition
MRChangeSceneAction.h:13
MR::ChangeSceneAction::ChangeSceneAction
MRMESH_API ChangeSceneAction(const std::string &name, const std::shared_ptr< Object > &obj, Type type)
Constructed before removal or addition.
MR::ChangeSceneAction::action
virtual MRMESH_API void action(HistoryAction::Type actionType) override
This function is called on history action (undo, redo, etc.)
MR::ChangeSceneAction::name
virtual std::string name() const override
Definition
MRChangeSceneAction.h:23
MR::ChangeSceneAction::Type
Type
Definition
MRChangeSceneAction.h:16
MR::ChangeSceneAction::heapBytes
virtual MRMESH_API size_t heapBytes() const override
returns the amount of memory this object occupies on heap
MR::HistoryAction
Definition
MRHistoryAction.h:12
MR::HistoryAction::Type
Type
Definition
MRHistoryAction.h:19
MR::Object
named object in the data model
Definition
MRObject.h:60
MR
Definition
MRCameraOrientationPlugin.h:8
MeshLib
source
MRMesh
MRChangeSceneAction.h
Generated by
1.11.0