31 objMesh_{ std::move( obj ) },
32 name_{ std::move(
name ) }
35 if ( objMesh_ && objMesh_->meshPtr() )
36 meshDiff_ =
MeshDiff( *objMesh_->meshPtr(), oldMesh );
41 objMesh_{ std::move( obj ) },
42 name_{ std::move(
name ) }
44 assert( objMesh_ && newMesh );
47 auto oldMesh = objMesh_->updateMesh( std::move( newMesh ) );
48 if ( oldMesh && objMesh_->meshPtr() )
49 meshDiff_ =
MeshDiff( *objMesh_->meshPtr(), *oldMesh );
53 virtual std::string
name()
const override
63 auto m = objMesh_->varMesh();
68 meshDiff_.applyAndSwap( *m );
72 [[nodiscard]]
virtual size_t heapBytes()
const override
74 return name_.capacity() + meshDiff_.heapBytes();
78 std::shared_ptr<ObjectMesh> objMesh_;
91 objMesh_{ std::move( obj ) },
92 name_{ std::move(
name ) }
98 if (
auto m = objMesh_->varMesh() )
104 objMesh_{ std::move( obj ) },
105 name_{ std::move(
name ) }
111 if (
auto m = objMesh_->varMesh() )
114 m->points = std::move( newPoints );
119 virtual std::string
name()
const override
129 auto m = objMesh_->varMesh();
134 pointsDiff_.applyAndSwap( m->points );
140 return name_.capacity() + pointsDiff_.heapBytes();
144 std::shared_ptr<ObjectMesh> objMesh_;
157 objMesh_{ std::move( obj ) },
158 name_{ std::move(
name ) }
164 if (
auto m = objMesh_->varMesh() )
170 objMesh_{ std::move( obj ) },
171 name_{ std::move(
name ) }
177 if (
auto m = objMesh_->varMesh() )
180 m->topology = std::move( newTopology );
185 virtual std::string
name()
const override
195 auto m = objMesh_->varMesh();
200 topologyDiff_.applyAndSwap( m->topology );
206 return name_.capacity() + topologyDiff_.heapBytes();
210 std::shared_ptr<ObjectMesh> objMesh_;
Definition MRMeshDiff.h:16
Definition MRMeshTopologyDiff.h:16
Definition MRMeshTopology.h:30
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRPartialChangeMeshAction.h:72
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRPartialChangeMeshAction.h:58
PartialChangeMeshAction(std::string name, std::shared_ptr< ObjectMesh > obj, CmpOld, const Mesh &oldMesh)
Definition MRPartialChangeMeshAction.h:30
virtual std::string name() const override
Definition MRPartialChangeMeshAction.h:53
PartialChangeMeshAction(std::string name, std::shared_ptr< ObjectMesh > obj, SetNew, std::shared_ptr< Mesh > &&newMesh)
use this constructor to set new object's mesh and remember its difference from existed mesh for futur...
Definition MRPartialChangeMeshAction.h:40
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRPartialChangeMeshAction.h:138
virtual std::string name() const override
Definition MRPartialChangeMeshAction.h:119
PartialChangeMeshPointsAction(std::string name, std::shared_ptr< ObjectMesh > obj, CmpOld, const VertCoords &oldPoints)
Definition MRPartialChangeMeshAction.h:90
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRPartialChangeMeshAction.h:124
PartialChangeMeshPointsAction(std::string name, std::shared_ptr< ObjectMesh > obj, SetNew, VertCoords &&newPoints)
use this constructor to set new object's points and remember its difference from existed points for f...
Definition MRPartialChangeMeshAction.h:103
PartialChangeMeshTopologyAction(std::string name, std::shared_ptr< ObjectMesh > obj, SetNew, MeshTopology &&newTopology)
use this constructor to set new object's topology and remember its difference from existed topology f...
Definition MRPartialChangeMeshAction.h:169
PartialChangeMeshTopologyAction(std::string name, std::shared_ptr< ObjectMesh > obj, CmpOld, const MeshTopology &oldTopology)
Definition MRPartialChangeMeshAction.h:156
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRPartialChangeMeshAction.h:204
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRPartialChangeMeshAction.h:190
virtual std::string name() const override
Definition MRPartialChangeMeshAction.h:185
Definition MRVertCoordsDiff.h:15
Type
Definition MRHistoryAction.h:27
HistoryAction()=default
explicitly define ctors to avoid warning C5267: definition of implicit copy constructor is deprecated...
constexpr SetNew setNew
Definition MRPartialChangeMeshAction.h:22
constexpr CmpOld cmpOld
Definition MRPartialChangeMeshAction.h:18
@ DIRTY_POSITION
Definition MRVisualObject.h:77
@ DIRTY_FACE
Definition MRVisualObject.h:85
@ DIRTY_ALL
Definition MRVisualObject.h:94
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
argument of this type indicates that the object is already in new state, and the following argument i...
Definition MRPartialChangeMeshAction.h:17
argument of this type indicates that the object is in old state, and the following argument is new st...
Definition MRPartialChangeMeshAction.h:21