From c770d747ff7c21ee4f8fc3d21f81f679c46f7116 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 9 Dec 2016 21:08:44 +0100 Subject: [PATCH] re-implement FemMesh::copyMeshData based on export&import of unv file --- src/Mod/Fem/App/FemMesh.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index ba1bb74ec..f17e5378a 100644 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -126,8 +126,16 @@ void FemMesh::copyMeshData(const FemMesh& mesh) { _Mtrx = mesh._Mtrx; +#if 1 + // create a temporary file + Base::FileInfo fi(App::Application::getTempFileName().c_str()); + mesh.myMesh->ExportUNV(fi.filePath().c_str()); + this->myMesh->UNVToMesh(fi.filePath().c_str()); + fi.deleteFile(); +#else SMESHDS_Mesh* meshds = this->myMesh->GetMeshDS(); + // Some further information is still not copied: http://forum.freecadweb.org/viewtopic.php?f=18&t=18982#p148114 SMDS_NodeIteratorPtr aNodeIter = mesh.myMesh->GetMeshDS()->nodesIterator(); for (;aNodeIter->more();) { const SMDS_MeshNode* aNode = aNodeIter->next(); @@ -353,6 +361,7 @@ void FemMesh::copyMeshData(const FemMesh& mesh) } } } +#endif } const SMESH_Mesh* FemMesh::getSMesh() const