30 objMesh_{ std::move( obj ) },
31 name_{ std::move(
name ) }
34 if ( objMesh_ && objMesh_->mesh() )
35 meshDiff_ =
MeshDiff( *objMesh_->mesh(), oldMesh );
40 objMesh_{ std::move( obj ) },
41 name_{ std::move(
name ) }
43 assert( objMesh_ && newMesh );
46 auto oldMesh = objMesh_->updateMesh( std::move( newMesh ) );
47 if ( oldMesh && objMesh_->mesh() )
48 meshDiff_ =
MeshDiff( *objMesh_->mesh(), *oldMesh );
52 virtual std::string
name()
const override
62 auto m = objMesh_->varMesh();
71 [[nodiscard]]
virtual size_t heapBytes()
const override
73 return name_.capacity() + meshDiff_.
heapBytes();
77 std::shared_ptr<ObjectMesh> objMesh_;
90 objMesh_{ std::move( obj ) },
91 name_{ std::move(
name ) }
97 if (
auto m = objMesh_->varMesh() )
103 objMesh_{ std::move( obj ) },
104 name_{ std::move(
name ) }
110 if (
auto m = objMesh_->varMesh() )
113 m->points = std::move( newPoints );
118 virtual std::string
name()
const override
128 auto m = objMesh_->varMesh();
139 return name_.capacity() + pointsDiff_.
heapBytes();
143 std::shared_ptr<ObjectMesh> objMesh_;
156 objMesh_{ std::move( obj ) },
157 name_{ std::move(
name ) }
163 if (
auto m = objMesh_->varMesh() )
169 objMesh_{ std::move( obj ) },
170 name_{ std::move(
name ) }
176 if (
auto m = objMesh_->varMesh() )
179 m->topology = std::move( newTopology );
184 virtual std::string
name()
const override
194 auto m = objMesh_->varMesh();
205 return name_.capacity() + topologyDiff_.
heapBytes();
209 std::shared_ptr<ObjectMesh> objMesh_;
Definition MRHistoryAction.h:12
Type
Definition MRHistoryAction.h:19
Definition MRMeshDiff.h:13
MRMESH_API void applyAndSwap(Mesh &m)
size_t heapBytes() const
returns the amount of memory this object occupies on heap
Definition MRMeshDiff.h:31
Definition MRMeshTopologyDiff.h:13
MRMESH_API size_t heapBytes() const
returns the amount of memory this object occupies on heap
MRMESH_API void applyAndSwap(MeshTopology &t)
Definition MRMesh/MRMeshTopology.h:19
Undo action for efficiently storage of partial change in mesh (e.g. a modification of small region)
Definition MRPartialChangeMeshAction.h:25
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRPartialChangeMeshAction.h:71
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRPartialChangeMeshAction.h:57
PartialChangeMeshAction(std::string name, std::shared_ptr< ObjectMesh > obj, CmpOld, const Mesh &oldMesh)
Definition MRPartialChangeMeshAction.h:29
virtual std::string name() const override
Definition MRPartialChangeMeshAction.h:52
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:39
Undo action for efficiently storage of partial change in mesh points (e.g. a modification of small re...
Definition MRPartialChangeMeshAction.h:85
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRPartialChangeMeshAction.h:137
virtual std::string name() const override
Definition MRPartialChangeMeshAction.h:118
PartialChangeMeshPointsAction(std::string name, std::shared_ptr< ObjectMesh > obj, CmpOld, const VertCoords &oldPoints)
Definition MRPartialChangeMeshAction.h:89
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRPartialChangeMeshAction.h:123
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:102
Undo action for efficiently storage of partial change in mesh topology (e.g. a modification of small ...
Definition MRPartialChangeMeshAction.h:151
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:168
PartialChangeMeshTopologyAction(std::string name, std::shared_ptr< ObjectMesh > obj, CmpOld, const MeshTopology &oldTopology)
Definition MRPartialChangeMeshAction.h:155
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRPartialChangeMeshAction.h:203
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRPartialChangeMeshAction.h:189
virtual std::string name() const override
Definition MRPartialChangeMeshAction.h:184
Definition MRVertCoordsDiff.h:12
MRMESH_API size_t heapBytes() const
returns the amount of memory this object occupies on heap
MRMESH_API void applyAndSwap(VertCoords &m)
constexpr SetNew setNew
Definition MRPartialChangeMeshAction.h:21
constexpr CmpOld cmpOld
Definition MRPartialChangeMeshAction.h:17
@ DIRTY_POSITION
Definition MRVisualObject.h:77
@ DIRTY_FACE
Definition MRVisualObject.h:86
@ DIRTY_ALL
Definition MRVisualObject.h:97
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:16
Definition MRMesh/MRMesh.h:23
argument of this type indicates that the object is in old state, and the following argument is new st...
Definition MRPartialChangeMeshAction.h:20