23 cloneObj_ = obj->clone();
27 visObj->setVisualizeProperty(
false, VisualizeMaskType::ClippedByPlane,
ViewportMask::all() );
31 virtual std::string
name()
const override {
return name_; }
35 if ( obj_.expired() || !cloneObj_ )
38 auto obj = obj_.lock();
39 auto children = obj->children();
40 for (
auto& child : children )
42 child->detachFromParent();
43 cloneObj_->addChild( child );
48 visObj->setVisualizeProperty(
false, VisualizeMaskType::ClippedByPlane,
ViewportMask::all() );
50 obj->swap( *cloneObj_ );
55 [[nodiscard]]
virtual size_t heapBytes()
const override
61 std::weak_ptr<Object> obj_;
62 std::shared_ptr<Object> cloneObj_;
Definition MRChangeObjectAction.h:14
ChangeObjectAction(const std::string &name, const std::shared_ptr< Object > &obj)
Constructed from original Object.
Definition MRChangeObjectAction.h:17
virtual std::string name() const override
Definition MRChangeObjectAction.h:31
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangeObjectAction.h:55
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangeObjectAction.h:33
Definition MRHistoryAction.h:12
Type
Definition MRHistoryAction.h:19
static ViewportMask all()
mask meaning all or any viewports
Definition MRViewportId.h:45
Visual Object.
Definition MRVisualObject.h:131
size_t heapBytes(const std::vector< T > &vec)
returns the amount of memory given vector occupies on heap
Definition MRHeapBytes.h:15
@ DIRTY_ALL
Definition MRVisualObject.h:109
Definition MRCameraOrientationPlugin.h:8