From: eap Date: Mon, 13 Aug 2012 09:05:13 +0000 (+0000) Subject: 0021799: EDF 2344 SMESH: Existing groups are not taken into account when adding new... X-Git-Tag: V6_6_0a1~208 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=809c265960d697707e53973a7c6af1de311c4467;p=modules%2Fsmesh.git 0021799: EDF 2344 SMESH: Existing groups are not taken into account when adding new elements into groups fix a regression in buildElemPrs() --- diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index b6c1c265c..30bef0579 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -353,9 +353,13 @@ void SMESH_VisualObjDef::buildElemPrs() map nbEnts; map anEnts; + vtkIdType aNbCells = 0; + for ( int i = 0; i < nbTypes; i++ ) + { nbEnts[ aTypes[ i ] ] = GetEntities( aTypes[ i ], anEnts[ aTypes[ i ] ] ); - + aNbCells += nbEnts[ aTypes [ i ]]; + } // PAL16631: without swap, bad_alloc is not thrown but hung up and crash instead, // so check remaining memory size for safety SMDS_Mesh::CheckMemory(); // PAL16631 @@ -363,12 +367,8 @@ void SMESH_VisualObjDef::buildElemPrs() vtkIdType aCellsSize = 2 * nbEnts[ SMDSAbs_0DElement ] + 3 * nbEnts[ SMDSAbs_Edge ]; aCellsSize += 2 * nbEnts[ SMDSAbs_Ball ]; - vtkIdType aNbCells = 0; - for ( int i = 1; i <= 2; i++ ) // iterate through faces and volumes { - aNbCells += nbEnts[ aTypes[ i ]]; - if ( nbEnts[ aTypes[ i ] ] ) { const TEntityList& aList = anEnts[ aTypes[ i ] ];