22 name_{ std::move(
name ) }
26 if (
auto m = obj->pointCloud() )
27 clonePointCloud_ = std::make_shared<PointCloud>( *m );
31 virtual std::string
name()
const override {
return name_; }
38 objPoints_->swapPointCloud( clonePointCloud_ );
47 [[nodiscard]]
virtual size_t heapBytes()
const override
48 {
return name_.capacity() +
MR::heapBytes( clonePointCloud_ ); }
51 std::shared_ptr<ObjectPoints> objPoints_;
52 std::shared_ptr<PointCloud> clonePointCloud_;
67 name_{ std::move(
name ) }
71 if (
auto m = obj->pointCloud() )
72 clonePoints_ = m->points;
76 virtual std::string
name()
const override
86 if (
auto m = objPoints_->varPointCloud() )
88 std::swap( m->points, clonePoints_ );
99 [[nodiscard]]
virtual size_t heapBytes()
const override
101 return name_.capacity() + clonePoints_.heapBytes();
105 std::shared_ptr<ObjectPoints> objPoints_;
106 VertCoords clonePoints_;
Definition MRChangePointCloudAction.h:15
ChangePointCloudAction(std::string name, const std::shared_ptr< ObjectPoints > &obj)
use this constructor to remember object's point cloud before making any changes in it
Definition MRChangePointCloudAction.h:20
virtual std::string name() const override
Definition MRChangePointCloudAction.h:31
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangePointCloudAction.h:33
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangePointCloudAction.h:47
static void setObjectDirty(const std::shared_ptr< ObjectPoints > &obj)
Definition MRChangePointCloudAction.h:41
Definition MRChangePointCloudAction.h:60
static void setObjectDirty(const std::shared_ptr< ObjectPoints > &obj)
Definition MRChangePointCloudAction.h:93
ChangePointCloudPointsAction(std::string name, const std::shared_ptr< ObjectPoints > &obj)
use this constructor to remember object's point cloud before making any changes in it
Definition MRChangePointCloudAction.h:65
virtual std::string name() const override
Definition MRChangePointCloudAction.h:76
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangePointCloudAction.h:99
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangePointCloudAction.h:81
Definition MRHistoryAction.h:12
Type
Definition MRHistoryAction.h:19
Definition MRObjectPoints.h:11
size_t heapBytes(const std::vector< T > &vec)
returns the amount of memory given vector occupies on heap
Definition MRHeapBytes.h:15
@ DIRTY_POSITION
Definition MRVisualObject.h:90
@ DIRTY_ALL
Definition MRVisualObject.h:109
Definition MRCameraOrientationPlugin.h:8