]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Bugs in CopyMesh()
authoreap <eap@opencascade.com>
Wed, 26 Feb 2014 08:55:21 +0000 (12:55 +0400)
committereap <eap@opencascade.com>
Wed, 26 Feb 2014 08:55:21 +0000 (12:55 +0400)
1) Assure the mesh is loaded before copying
2) Fix wrong copying polyhedra

src/SMESH_I/SMESH_Gen_i.cxx

index 5ec51b54a8bfa88622a6d0247ae1f61303ec5f8c..1737c04a6e34853e7863a83b4b86b2d5617a8fa9 100644 (file)
@@ -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<SMESH_Mesh_i*>( 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<const SMDS_VtkVolume*>(elem)->GetQuantities(),
-                                     ID);
+        if ( toKeepIDs )
+          newElem = editor.GetMeshDS()->
+            AddPolyhedralVolumeWithID( nodes,
+                                       static_cast<const SMDS_VtkVolume*>(elem)->GetQuantities(),
+                                       ID);
+        else
+          newElem = editor.GetMeshDS()->
+            AddPolyhedralVolume( nodes,
+                                 static_cast<const SMDS_VtkVolume*>(elem)->GetQuantities());
         break;
       case SMDSEntity_Ball:
         newElem = editor.AddElement( nodes, SMDSAbs_Ball, false, ID,