25 name_{ std::move(
name ) }
29 if (
auto m = obj->pointCloudPtr() )
30 clonePointCloud_ = std::make_shared<PointCloud>( *m );
37 name_{ std::move(
name ) }
41 clonePointCloud_ = std::move( newPointCloud );
42 objPoints_->swapPointCloud( clonePointCloud_ );
46 virtual std::string
name()
const override {
return name_; }
53 objPoints_->swapPointCloud( clonePointCloud_ );
62 [[nodiscard]]
virtual size_t heapBytes()
const override
63 {
return name_.capacity() +
MR::heapBytes( clonePointCloud_ ); }
66 std::shared_ptr<ObjectPoints> objPoints_;
67 std::shared_ptr<PointCloud> clonePointCloud_;
82 name_{ std::move(
name ) }
86 if (
auto m = obj->pointCloudPtr() )
87 clonePoints_ = m->points;
94 clonePoints_{ std::move( newPoints ) },
95 name_{ std::move(
name ) }
100 virtual std::string
name()
const override
110 if (
auto m = objPoints_->varPointCloud() )
112 std::swap( m->points, clonePoints_ );
125 return name_.capacity() + clonePoints_.heapBytes();
129 std::shared_ptr<ObjectPoints> objPoints_;
130 VertCoords clonePoints_;
146 name_{ std::move(
name ) }
150 if (
auto m = obj->pointCloudPtr() )
151 if ( m->points.size() > pointId_ )
152 safeCoords_ = m->points[pointId_];
160 safeCoords_{ newCoords },
161 name_{ std::move(
name ) }
166 virtual std::string
name()
const override
176 if (
auto m = objPoints_->varPointCloud() )
178 if ( m->points.size() > pointId_ )
180 std::swap( safeCoords_, m->points[pointId_] );
194 return name_.capacity();
198 std::shared_ptr<ObjectPoints> objPoints_;
200 Vector3f safeCoords_;
Definition MRObjectPoints.h:14
size_t heapBytes(const BitSet &bs)
returns the amount of memory given BitSet occupies on heap
Definition MRBitSet.h:377
static void setObjectDirty(const std::shared_ptr< ObjectPoints > &obj)
Definition MRChangePointCloudAction.h:117
virtual std::string name() const override
Definition MRChangePointCloudAction.h:166
ChangeOnePointInCloudAction(std::string name, const std::shared_ptr< ObjectPoints > &obj, VertId pointId)
use this constructor to remember point's coordinates before making any changes in it
Definition MRChangePointCloudAction.h:143
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:23
virtual std::string name() const override
Definition MRChangePointCloudAction.h:46
ObjectPoints Obj
Definition MRChangePointCloudAction.h:140
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangePointCloudAction.h:48
static void setObjectDirty(const std::shared_ptr< ObjectPoints > &obj)
Definition MRChangePointCloudAction.h:186
ChangeOnePointInCloudAction(std::string name, const std::shared_ptr< ObjectPoints > &obj, VertId pointId, const Vector3f &newCoords)
use this constructor to remember point's coordinates and immediate set new coordinates
Definition MRChangePointCloudAction.h:157
ChangePointCloudPointsAction(std::string name, const std::shared_ptr< ObjectPoints > &obj)
use this constructor to remember object's points field before making any changes in it
Definition MRChangePointCloudAction.h:80
ObjectPoints Obj
Definition MRChangePointCloudAction.h:20
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangePointCloudAction.h:192
ChangePointCloudPointsAction(std::string name, const std::shared_ptr< ObjectPoints > &obj, VertCoords &&newPoints)
use this constructor to remember object's points field and immediate set new value
Definition MRChangePointCloudAction.h:92
ChangePointCloudAction(std::string name, const std::shared_ptr< ObjectPoints > &obj, std::shared_ptr< PointCloud > newPointCloud)
use this constructor to remember object's point cloud and immediately set new point cloud
Definition MRChangePointCloudAction.h:35
ObjectPoints Obj
Definition MRChangePointCloudAction.h:77
virtual std::string name() const override
Definition MRChangePointCloudAction.h:100
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangePointCloudAction.h:123
Type
Definition MRHistoryAction.h:27
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangePointCloudAction.h:105
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangePointCloudAction.h:171
HistoryAction()=default
explicitly define ctors to avoid warning C5267: definition of implicit copy constructor is deprecated...
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangePointCloudAction.h:62
static void setObjectDirty(const std::shared_ptr< ObjectPoints > &obj)
Definition MRChangePointCloudAction.h:56
@ Redo
Definition MRHistoryAction.h:29
@ DIRTY_POSITION
Definition MRVisualObject.h:77
@ DIRTY_ALL
Definition MRVisualObject.h:94
only for bindings generation
Definition MRCameraOrientationPlugin.h:8