From 0df72c611ef6c433a1a6973b2eafffbf1b267e57 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 9 Sep 2020 16:57:14 +0200 Subject: [PATCH] copy constructor and copy assignment of CMeshO --- src/common/ml_mesh_type.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/common/ml_mesh_type.h b/src/common/ml_mesh_type.h index 9c1b39610..6b139ccaa 100644 --- a/src/common/ml_mesh_type.h +++ b/src/common/ml_mesh_type.h @@ -150,6 +150,30 @@ public : bb.Add(Tr,bbox); return bb; } + + CMeshO() : + vcg::tri::TriMesh< vcg::vertex::vector_ocf, vcg::face::vector_ocf >(), + sfn(0), svn(0), pvn(0), pfn(0) + { + } + + CMeshO(CMeshO& oth) : CMeshO() { + vcg::tri::Append::Mesh(*this, oth); + } + + //TODO need to change this + CMeshO(CMeshO&& oth) : CMeshO() { + //I could take everything from oth and place it in + //this mesh + vcg::tri::Append::Mesh(*this, oth); + } + + //TODO should change also this and use the copy&swap idiom + CMeshO& operator=(CMeshO& oth) { + Clear(); + vcg::tri::Append::Mesh(*this, oth); + return *this; + } }; #endif