Salome HOME
0020945: EDF 1465 SMESH: create a new mesh from a selected group or from selected... PHASE_25_BR
authoreap <eap@opencascade.com>
Tue, 30 Nov 2010 16:59:43 +0000 (16:59 +0000)
committereap <eap@opencascade.com>
Tue, 30 Nov 2010 16:59:43 +0000 (16:59 +0000)
   fix python dump and check of group type

src/SMESH_I/SMESH_Gen_i.cxx

index 0a76af80973392311dcbf442e948c50c1d671af3..d69a3d4c8099aca59d61962d67e9fe041c22c280 100644 (file)
@@ -2330,9 +2330,6 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
   int nbNewGroups = 0;
   if ( toCopyGroups )
   {
-    SMESH::ElementType* typesBeg = & srcElemTypes[0];
-    SMESH::ElementType* typesEnd = typesBeg+srcElemTypes->length(); 
-
     SMESH_Mesh::GroupIteratorPtr gIt = srcMesh_i->GetImpl().GetGroups();
     while ( gIt->more() )
     {
@@ -2342,7 +2339,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
       // Check group type. We copy nodal groups containing nodes of copied element
       SMDSAbs_ElementType groupType = groupDS->GetType();
       if ( groupType != SMDSAbs_Node &&
-           std::find( typesBeg, typesEnd, groupType ) == typesEnd )
+           newMeshDS->GetMeshInfo().NbElements( groupType ) == 0 )
         continue; // group type differs from types of meshPart
 
       // Find copied elements in the group
@@ -2399,6 +2396,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
 
   *pyDump << newMesh << " = " << this
           << ".CopyMesh( " << meshPart << ", "
+          << "'" << meshName << "', "
           << toCopyGroups << ", "
           << toKeepIDs << ")";