diff --git a/src/common/meshmodel.cpp b/src/common/meshmodel.cpp index ecd8f44e4..a6e9bf332 100644 --- a/src/common/meshmodel.cpp +++ b/src/common/meshmodel.cpp @@ -370,6 +370,21 @@ MeshModel::MeshModel(MeshDocument *_parent, QString fullFileName, QString labelN if(!labelName.isEmpty()) this->_label=labelName; } +MeshModel::MeshModel(MeshModel* cp) +{ + if (cp == NULL) + return; + parent = cp->parent; + if (parent != NULL) + _id = parent->newMeshId(); + cm.Tr = cp->cm.Tr; + cm.sfn = cp->cm.sfn; + cm.svn = cp->cm.svn; + visible = cp->visible; + updateDataMask(cp->currentDataMask); + vcg::tri::Append::MeshCopy(cm, cp->cm); +} + QString MeshModel::relativePathName() const { QDir documentDir (documentPathName()); diff --git a/src/common/meshmodel.h b/src/common/meshmodel.h index 3a93abb5b..0e74a269b 100644 --- a/src/common/meshmodel.h +++ b/src/common/meshmodel.h @@ -123,8 +123,9 @@ public: }; MeshModel(MeshDocument *parent, QString fullFileName, QString labelName); - - MeshDocument *parent; + MeshModel(MeshModel* cp); + + MeshDocument *parent; CMeshO cm;