X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i_1.cxx;h=1b1ccc4ea17c27c13d7974682a5a9b1edca3a87a;hp=a73f93c3c0417fcd49ad3dd738dc02fb01b7f0aa;hb=5552aec787c289730a35843d295811cfdadaacd3;hpb=78a29bb10360e6b832b47399d665ec86fb3db7e3 diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index a73f93c3c..1b1ccc4ea 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -308,10 +308,12 @@ static SALOMEDS::SObject_ptr publish(CORBA::Object_ptr theIOR, if ( !sameIOR ) { iorAttr->SetValue( objStr.in() ); - // UnRegister() !!! --> No: random problems when meshing in parallel (yacs foreach) in distributed python scripts -// SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR ); -// if ( !genObj->_is_nil() ) -// genObj->UnRegister(); + // UnRegister() !!! --> random problems when meshing in parallel (yacs foreach) in + // distributed python scripts, because simultaneously created meshes are + // published into the same SO; as a result the mesh published first dies + SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR ); + if ( !genObj->_is_nil() ) + genObj->UnRegister(); } } @@ -598,7 +600,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SMESH::SMESH_Mesh_ptr theMesh, else aTag++; - aMeshSO = publish ( theMesh, father, aTag, "ICON_SMESH_TREE_MESH_WARN" ); + aMeshSO = publish( theMesh, father, aTag, "ICON_SMESH_TREE_MESH_WARN" ); if ( aMeshSO->_is_nil() ) return aMeshSO._retn(); } @@ -891,8 +893,10 @@ void SMESH_Gen_i::UpdateIcons( SMESH::SMESH_Mesh_ptr theMesh ) SetPixMap( so, "ICON_SMESH_TREE_MESH_WARN" ); else if ( mesh_i->IsComputedOK() ) SetPixMap( so, "ICON_SMESH_TREE_MESH" ); - else + else if ( mesh_i->HasShapeToMesh() ) SetPixMap( so, "ICON_SMESH_TREE_MESH_PARTIAL" ); + else + SetPixMap( so, "ICON_SMESH_TREE_MESH_IMPORTED" ); // set icons of sub-objects SALOMEDS::Study_var study = getStudyServant(); @@ -1399,3 +1403,14 @@ int StudyContext::getOldId( const int newId ) } return 0; } + +//======================================================================= +//function : Clear +//purpose : clear data +//======================================================================= + +void StudyContext::Clear() +{ + mapIdToIOR.Clear(); + mapIdToId.Clear(); +}