From: eap Date: Wed, 26 Feb 2014 08:55:21 +0000 (+0400) Subject: Bugs in CopyMesh() X-Git-Tag: V7_4_0a1~55 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=35564200994ccbaeadd2ea6701da1300b3aaa33f;p=modules%2Fsmesh.git Bugs in CopyMesh() 1) Assure the mesh is loaded before copying 2) Fix wrong copying polyhedra --- diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 5ec51b54a..1737c04a6 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -2654,6 +2654,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, SMESH::array_of_ElementType_var srcElemTypes = meshPart->GetTypes(); if ( SMESH::DownCast( meshPart )) { + srcMesh_i->Load(); srcElemIt = srcMeshDS->elementsIterator(); srcNodeIt = srcMeshDS->nodesIterator(); } @@ -2720,10 +2721,15 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, const SMDS_MeshElement * newElem; switch ( elem->GetEntityType() ) { case SMDSEntity_Polyhedra: - newElem = editor.GetMeshDS()-> - AddPolyhedralVolumeWithID( nodes, - static_cast(elem)->GetQuantities(), - ID); + if ( toKeepIDs ) + newElem = editor.GetMeshDS()-> + AddPolyhedralVolumeWithID( nodes, + static_cast(elem)->GetQuantities(), + ID); + else + newElem = editor.GetMeshDS()-> + AddPolyhedralVolume( nodes, + static_cast(elem)->GetQuantities()); break; case SMDSEntity_Ball: newElem = editor.AddElement( nodes, SMDSAbs_Ball, false, ID,