+ // List of objects that will be updated automatically
+ QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > > aListToUpdate;
+ SMESH::SMESH_IDSource_var aMeshObj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aMeshSObj );
+ // put Mesh into list
+ aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aMeshObj, aMeshSObj) );
+ SMESH::submesh_array_var aSubMeshes = myMesh->GetSubMeshes();
+ // put SubMeshes into list
+ for ( int i = 0; i < aSubMeshes->length(); i++ ) {
+ SMESH::SMESH_subMesh_var sm = aSubMeshes[i];
+ if ( CORBA::is_nil( sm ) ) continue;
+ _PTR(SObject) smSObj = SMESH::ObjectToSObject( sm );
+ if ( !smSObj ) continue;
+ SMESH::SMESH_IDSource_var aSubMeshObj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( smSObj );
+ aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aSubMeshObj, smSObj) );
+ }
+ // put Groups into list
+ SMESH::ListOfGroups_var aGroups = myMesh->GetGroups();
+ for ( size_t i = 0; i < aGroups->length(); ++i ) {
+ SMESH::SMESH_GroupBase_var aGrp = aGroups[i];
+ if ( CORBA::is_nil( aGrp ) ) continue;
+ SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
+ SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
+ SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
+ if ( !aStdGroup->_is_nil() ) continue; // don't update the standalone groups
+ _PTR(SObject) aGroupSO = SMESH::FindSObject( aGrp );
+ if ( !aGroupSO ) continue;
+ SMESH::SMESH_IDSource_var aGroupObj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aGroupSO );
+ aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aGroupObj, aGroupSO) );
+ }
+
+ // update mesh, sub-mesh and groups, if it's possible
+ QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > >::iterator anIter;
+ for( anIter = aListToUpdate.begin(); anIter != aListToUpdate.end(); anIter++ ) {
+ SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( (*anIter).second ));
+ if ( getSMESHGUI()->automaticUpdate( (*anIter).first, &entities, &limitExceeded, &hidden, &nbElements ) )
+ {
+ try {