22 name_{ std::move(
name ) }
26 if (
auto pc = obj->pointCloud() )
27 backupNormals_ = pc->normals;
34 backupNormals_{ std::move( newNormals ) },
35 name_{ std::move(
name ) }
40 virtual std::string
name()
const override
47 if ( !objPoints_ || !objPoints_->varPointCloud() )
50 std::swap( objPoints_->varPointCloud()->normals, backupNormals_ );
60 [[nodiscard]]
virtual size_t heapBytes()
const override
62 return name_.capacity() + backupNormals_.heapBytes();
66 std::shared_ptr<ObjectPoints> objPoints_;
67 VertNormals backupNormals_;
Definition MRChangePointCloudNormalsAction.h:15
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangePointCloudNormalsAction.h:60
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangePointCloudNormalsAction.h:45
ChangePointCloudNormalsAction(std::string name, const std::shared_ptr< ObjectPoints > &obj, VertNormals &&newNormals)
use this constructor to remember point cloud's normals and immediate set new value
Definition MRChangePointCloudNormalsAction.h:32
static void setObjectDirty(const std::shared_ptr< ObjectPoints > &obj)
Definition MRChangePointCloudNormalsAction.h:54
ChangePointCloudNormalsAction(std::string name, const std::shared_ptr< ObjectPoints > &obj)
use this constructor to remember point cloud's normals before making any changes in them
Definition MRChangePointCloudNormalsAction.h:20
virtual std::string name() const override
Definition MRChangePointCloudNormalsAction.h:40
Definition MRHistoryAction.h:12
Type
Definition MRHistoryAction.h:19
Definition MRObjectPoints.h:11
@ DIRTY_RENDER_NORMALS
Definition MRVisualObject.h:95