29        objMesh_{ std::move( obj ) },
 
   30        name_{ std::move( 
name ) }
 
   33        if ( objMesh_ && objMesh_->mesh() )
 
   34            meshDiff_ = 
MeshDiff( *objMesh_->mesh(), oldMesh );
 
 
   39        objMesh_{ std::move( obj ) },
 
   40        name_{ std::move( 
name ) }
 
   42        assert( objMesh_ && newMesh );
 
   45            auto oldMesh = objMesh_->updateMesh( std::move( newMesh ) );
 
   46            if ( oldMesh && objMesh_->mesh() )
 
   47                meshDiff_ = 
MeshDiff( *objMesh_->mesh(), *oldMesh );
 
 
   51    virtual std::string 
name()
 const override 
 
   61        auto m = objMesh_->varMesh();
 
 
   70    [[nodiscard]] 
virtual size_t heapBytes()
 const override 
   72        return name_.capacity() + meshDiff_.
heapBytes();
 
 
   76    std::shared_ptr<ObjectMesh> objMesh_;
 
 
   89        objMesh_{ std::move( obj ) },
 
   90        name_{ std::move( 
name ) }
 
   96        if ( 
auto m = objMesh_->varMesh() )
 
 
  102        objMesh_{ std::move( obj ) },
 
  103        name_{ std::move( 
name ) }
 
  109        if ( 
auto m = objMesh_->varMesh() )
 
  112            m->points = std::move( newPoints );
 
 
  117    virtual std::string 
name()
 const override 
 
  127        auto m = objMesh_->varMesh();
 
 
  138        return name_.capacity() + pointsDiff_.
heapBytes();
 
 
  142    std::shared_ptr<ObjectMesh> objMesh_;
 
 
  155        objMesh_{ std::move( obj ) },
 
  156        name_{ std::move( 
name ) }
 
  162        if ( 
auto m = objMesh_->varMesh() )
 
 
  168        objMesh_{ std::move( obj ) },
 
  169        name_{ std::move( 
name ) }
 
  175        if ( 
auto m = objMesh_->varMesh() )
 
  178            m->topology = std::move( newTopology );
 
 
  183    virtual std::string 
name()
 const override 
 
  193        auto m = objMesh_->varMesh();
 
 
  204        return name_.capacity() + topologyDiff_.
heapBytes();
 
 
  208    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:24
 
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRPartialChangeMeshAction.h:70
 
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRPartialChangeMeshAction.h:56
 
PartialChangeMeshAction(std::string name, std::shared_ptr< ObjectMesh > obj, CmpOld, const Mesh &oldMesh)
Definition MRPartialChangeMeshAction.h:28
 
virtual std::string name() const override
Definition MRPartialChangeMeshAction.h:51
 
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:38
 
Undo action for efficiently storage of partial change in mesh points (e.g. a modification of small re...
Definition MRPartialChangeMeshAction.h:84
 
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRPartialChangeMeshAction.h:136
 
virtual std::string name() const override
Definition MRPartialChangeMeshAction.h:117
 
PartialChangeMeshPointsAction(std::string name, std::shared_ptr< ObjectMesh > obj, CmpOld, const VertCoords &oldPoints)
Definition MRPartialChangeMeshAction.h:88
 
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRPartialChangeMeshAction.h:122
 
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:101
 
Undo action for efficiently storage of partial change in mesh topology (e.g. a modification of small ...
Definition MRPartialChangeMeshAction.h:150
 
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:167
 
PartialChangeMeshTopologyAction(std::string name, std::shared_ptr< ObjectMesh > obj, CmpOld, const MeshTopology &oldTopology)
Definition MRPartialChangeMeshAction.h:154
 
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRPartialChangeMeshAction.h:202
 
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRPartialChangeMeshAction.h:188
 
virtual std::string name() const override
Definition MRPartialChangeMeshAction.h:183
 
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:20
 
constexpr CmpOld cmpOld
Definition MRPartialChangeMeshAction.h:16
 
@ 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:15
 
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:19