24 name_{ std::move(
name ) }
28 if (
auto m = obj->meshPtr() )
29 cloneMesh_ = std::make_shared<Mesh>( *m );
34 ChangeMeshAction( std::string
name,
const std::shared_ptr<ObjectMesh>& obj, std::shared_ptr<Mesh> newMesh ) :
36 name_{ std::move(
name ) }
39 cloneMesh_ = objMesh_->updateMesh( std::move( newMesh ) );
42 virtual std::string
name()
const override
52 cloneMesh_ = objMesh_->updateMesh( cloneMesh_ );
61 [[nodiscard]]
virtual size_t heapBytes()
const override
67 std::shared_ptr<ObjectMesh> objMesh_;
68 std::shared_ptr<Mesh> cloneMesh_;
82 name_{ std::move(
name ) }
86 uvCoords_ = obj->getUVCoords();
93 name_{ std::move(
name ) }
97 uvCoords_ = std::move( newUvCoords );
98 obj->updateUVCoords( uvCoords_ );
102 virtual std::string
name()
const override
112 objMesh_->updateUVCoords( uvCoords_ );
123 return name_.capacity() + uvCoords_.heapBytes();
127 VertUVCoords uvCoords_;
128 std::shared_ptr<ObjectMeshHolder> objMesh_;
142 name_{ std::move(
name ) }
145 textures_ = obj->getTextures();
151 name_{ std::move(
name ) }
155 textures_ = std::move( newTextures );
156 obj->updateTextures( textures_ );
160 virtual std::string
name()
const override
169 obj_->updateTextures( textures_ );
184 std::shared_ptr<ObjectMeshHolder> obj_;
198 name_{ std::move(
name ) }
202 if (
auto m = objMesh_->meshPtr() )
203 clonePoints_ = m->points;
209 name_{ std::move(
name ) }
211 clonePoints_ = std::move( newCoords );
215 virtual std::string
name()
const override
225 if (
auto m = objMesh_->varMesh() )
227 std::swap( m->points, clonePoints_ );
240 return name_.capacity() + clonePoints_.heapBytes();
243 const std::shared_ptr<ObjectMesh> &
obj()
const {
return objMesh_; }
247 std::shared_ptr<ObjectMesh> objMesh_;
248 VertCoords clonePoints_;
262 name_{ std::move(
name ) }
266 if (
auto m = objMesh_->meshPtr() )
267 cloneTopology_ = m->topology;
273 name_{ std::move(
name ) }
275 cloneTopology_ = std::move( newTopology );
279 virtual std::string
name()
const override
289 if (
auto m = objMesh_->varMesh() )
291 std::swap( m->topology, cloneTopology_ );
304 return name_.capacity() + cloneTopology_.heapBytes();
308 std::shared_ptr<ObjectMesh> objMesh_;
323 name_{ std::move(
name ) }
327 texturePerFace_ = obj->getTexturePerFace();
334 name_{ std::move(
name ) }
338 texturePerFace_ = std::move( newTexturePerFace );
339 obj->updateTexturePerFace( texturePerFace_ );
343 virtual std::string
name()
const override
353 objMesh_->updateTexturePerFace( texturePerFace_ );
364 return name_.capacity() + texturePerFace_.heapBytes();
369 std::shared_ptr<ObjectMeshHolder> objMesh_;
virtual std::string name() const override
Definition MRChangeMeshAction.h:42
ChangeMeshAction(std::string name, const std::shared_ptr< ObjectMesh > &obj, std::shared_ptr< Mesh > newMesh)
use this constructor to remember object's mesh and immediately set new mesh
Definition MRChangeMeshAction.h:34
ChangeMeshAction(std::string name, const std::shared_ptr< ObjectMesh > &obj)
use this constructor to remember object's mesh before making any changes in it
Definition MRChangeMeshAction.h:22
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangeMeshAction.h:47
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangeMeshAction.h:61
static void setObjectDirty(const std::shared_ptr< ObjectMesh > &obj)
Definition MRChangeMeshAction.h:55
ObjectMesh Obj
Definition MRChangeMeshAction.h:19
static void setObjectDirty(const std::shared_ptr< ObjectMesh > &obj)
Definition MRChangeMeshAction.h:232
ChangeMeshPointsAction(std::string name, const std::shared_ptr< ObjectMesh > &obj)
use this constructor to remember object's mesh points before making any changes in it
Definition MRChangeMeshAction.h:196
ObjectMesh Obj
Definition MRChangeMeshAction.h:193
ChangeMeshPointsAction(std::string name, const std::shared_ptr< ObjectMesh > &obj, VertCoords &&newCoords)
use this constructor to remember object's mesh points and immediate set new value
Definition MRChangeMeshAction.h:207
virtual std::string name() const override
Definition MRChangeMeshAction.h:215
const std::shared_ptr< ObjectMesh > & obj() const
Definition MRChangeMeshAction.h:243
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangeMeshAction.h:220
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangeMeshAction.h:238
const VertCoords & clonePoints() const
Definition MRChangeMeshAction.h:244
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangeMeshAction.h:362
virtual std::string name() const override
Definition MRChangeMeshAction.h:343
ObjectMeshHolder Obj
Definition MRChangeMeshAction.h:318
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangeMeshAction.h:348
ChangeMeshTexturePerFaceAction(std::string name, const std::shared_ptr< ObjectMeshHolder > &obj)
use this constructor to remember object's texturePerFace data before making any changes in them
Definition MRChangeMeshAction.h:321
ChangeMeshTexturePerFaceAction(std::string name, const std::shared_ptr< ObjectMeshHolder > &obj, Vector< TextureId, FaceId > &&newTexturePerFace)
use this constructor to remember object's texturePerFace data and immediate set new value
Definition MRChangeMeshAction.h:332
static void setObjectDirty(const std::shared_ptr< ObjectMeshHolder > &obj)
Definition MRChangeMeshAction.h:356
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangeMeshAction.h:284
static void setObjectDirty(const std::shared_ptr< ObjectMesh > &obj)
Definition MRChangeMeshAction.h:296
virtual std::string name() const override
Definition MRChangeMeshAction.h:279
ChangeMeshTopologyAction(std::string name, const std::shared_ptr< ObjectMesh > &obj, MeshTopology &&newTopology)
use this constructor to remember object's mesh topology and immediate set new value
Definition MRChangeMeshAction.h:271
ChangeMeshTopologyAction(std::string name, const std::shared_ptr< ObjectMesh > &obj)
use this constructor to remember object's mesh points before making any changes in it
Definition MRChangeMeshAction.h:260
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangeMeshAction.h:302
ObjectMesh Obj
Definition MRChangeMeshAction.h:257
ChangeMeshUVCoordsAction(std::string name, const std::shared_ptr< ObjectMeshHolder > &obj, VertUVCoords &&newUvCoords)
use this constructor to remember object's uv-coordinates and immediate set new value
Definition MRChangeMeshAction.h:91
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangeMeshAction.h:107
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangeMeshAction.h:121
ObjectMeshHolder Obj
Definition MRChangeMeshAction.h:77
virtual std::string name() const override
Definition MRChangeMeshAction.h:102
static void setObjectDirty(const std::shared_ptr< ObjectMeshHolder > &obj)
Definition MRChangeMeshAction.h:115
ChangeMeshUVCoordsAction(std::string name, const std::shared_ptr< ObjectMeshHolder > &obj)
use this constructor to remember object's uv-coordinates before making any changes in them
Definition MRChangeMeshAction.h:80
static void setObjectDirty(const std::shared_ptr< ObjectMeshHolder > &obj)
Definition MRChangeMeshAction.h:172
ObjectMeshHolder Obj
Definition MRChangeMeshAction.h:137
ChangeTextureAction(std::string name, const std::shared_ptr< ObjectMeshHolder > &obj, Vector< MeshTexture, TextureId > &&newTextures)
use this constructor to remember object's textures and immediate set new value
Definition MRChangeMeshAction.h:149
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangeMeshAction.h:165
ChangeTextureAction(std::string name, const std::shared_ptr< ObjectMeshHolder > &obj)
use this constructor to remember object's textures before making any changes in them
Definition MRChangeMeshAction.h:140
virtual std::string name() const override
Definition MRChangeMeshAction.h:160
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangeMeshAction.h:178
Definition MRMeshTopology.h:30
Definition MRObjectMeshHolder.h:37
Definition MRObjectMesh.h:14
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
size_t heapBytes(const BitSet &bs)
returns the amount of memory given BitSet occupies on heap
Definition MRBitSet.h:377
Type
Definition MRHistoryAction.h:27
HistoryAction()=default
explicitly define ctors to avoid warning C5267: definition of implicit copy constructor is deprecated...
@ Redo
Definition MRHistoryAction.h:29
@ DIRTY_POSITION
Definition MRVisualObject.h:77
@ DIRTY_TEXTURE
Definition MRVisualObject.h:83
@ DIRTY_TEXTURE_PER_FACE
Definition MRVisualObject.h:89
@ DIRTY_FACE
Definition MRVisualObject.h:85
@ DIRTY_ALL
Definition MRVisualObject.h:94
@ DIRTY_UV
Definition MRVisualObject.h:78
only for bindings generation
Definition MRCameraOrientationPlugin.h:8