21 childrenOrder_ = obj_->children();
24 virtual std::string
name()
const override {
return name_; }
31 std::vector<std::shared_ptr<Object>> oldOrder = obj_->children();
32 for (
auto& child : oldOrder )
34 child->detachFromParent();
36 for (
const auto& child : childrenOrder_ )
38 if ( child->parent() )
39 child->detachFromParent();
40 obj_->addChild( child );
42 childrenOrder_ = std::move( oldOrder );
45 [[nodiscard]]
virtual size_t heapBytes()
const override
52 std::vector<std::shared_ptr<Object>> childrenOrder_;
53 std::shared_ptr<Object> obj_;
Definition MRChangeSceneObjectsOrder.h:13
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangeSceneObjectsOrder.h:26
ChangeSceneObjectsOrder(const std::string &name, const std::shared_ptr< Object > &obj)
Constructed before change order.
Definition MRChangeSceneObjectsOrder.h:16
virtual std::string name() const override
Definition MRChangeSceneObjectsOrder.h:24
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangeSceneObjectsOrder.h:45
Definition MRHistoryAction.h:12
Type
Definition MRHistoryAction.h:19
size_t heapBytes(const std::vector< T > &vec)
returns the amount of memory given vector occupies on heap
Definition MRHeapBytes.h:15
Definition MRCameraOrientationPlugin.h:8