From: Paul RASCLE Date: Mon, 19 Feb 2018 15:29:01 +0000 (+0100) Subject: Merge branch 'master' of https://codev-tuleap.cea.fr/plugins/git/salome/smesh X-Git-Tag: V8_5_0a2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=5c49d3d8ef7848e3eca007eb38d6513668413b0c;hp=89b15cd78e6f46c57f3134d21af59a1d43a5121b Merge branch 'master' of https://codev-tuleap.cea.fr/plugins/git/salome/smesh --- diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index e8cd0a3df..a32d4db78 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -178,7 +178,23 @@ PortableServer::ServantBase_var SMESH_Gen_i::GetServant( CORBA::Object_ptr theOb PortableServer::Servant aServant = GetPOA()->reference_to_servant( theObject ); return aServant; } - catch (...) { + catch (PortableServer::POA::ObjectNotActive &ex) + { + INFOS("GetServant: ObjectNotActive"); + return NULL; + } + catch (PortableServer::POA::WrongAdapter &ex) + { + INFOS("GetServant: WrongAdapter: OK when several servants used to build several mesh in parallel..."); + return NULL; + } + catch (PortableServer::POA::WrongPolicy &ex) + { + INFOS("GetServant: WrongPolicy"); + return NULL; + } + catch (...) + { INFOS( "GetServant - Unknown exception was caught!!!" ); return NULL; } @@ -629,9 +645,11 @@ void SMESH_Gen_i::setCurrentStudy( SALOMEDS::Study_ptr theStudy, bool theStudyIsBeingClosed) { int curStudyId = GetCurrentStudyID(); + MESSAGE("curStudyId " << curStudyId); myCurrentStudy = SALOMEDS::Study::_duplicate( theStudy ); // create study context, if it doesn't exist and set current study int studyId = GetCurrentStudyID(); + MESSAGE("studyId " << studyId); if ( myStudyContextMap.find( studyId ) == myStudyContextMap.end() ) myStudyContextMap[ studyId ] = new StudyContext; @@ -645,6 +663,7 @@ void SMESH_Gen_i::setCurrentStudy( SALOMEDS::Study_ptr theStudy, // Let meshes update their data depending on GEOM groups that could change if ( curStudyId != studyId ) { + MESSAGE("curStudyId " << curStudyId << " studyId " << studyId); CORBA::String_var compDataType = ComponentDataType(); SALOMEDS::SComponent_wrap me = myCurrentStudy->FindComponent( compDataType.in() ); if ( !me->_is_nil() ) { diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index bb3703de1..6444617c7 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -298,10 +298,10 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr theStudy, if ( !sameIOR ) { iorAttr->SetValue( objStr.in() ); - // UnRegister() !!! - SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR ); - if ( !genObj->_is_nil() ) - genObj->UnRegister(); + // 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(); } } diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index f2641f7c8..bd9966d40 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -1183,11 +1183,12 @@ omniORB.registerObjref(SMESH._objref_SMESH_Gen._NP_RepositoryId, smeshBuilder) # from salome.smesh import smeshBuilder # smesh = smeshBuilder.New(salome.myStudy) # \endcode -# @param study SALOME study, generally obtained by salome.myStudy. -# @param instance CORBA proxy of SMESH Engine. If None, the default Engine is used. +# @param study SALOME study, generally obtained by salome.myStudy. +# @param instance CORBA proxy of SMESH Engine. If None, the default Engine is used. +# @param instanceGeom CORBA proxy of GEOM Engine. If None, the default Engine is used. # @return smeshBuilder instance -def New( study, instance=None): +def New( study, instance=None, instanceGeom=None): """ Create a new smeshBuilder instance.The smeshBuilder class provides the Python interface to create or load meshes. @@ -1199,8 +1200,9 @@ def New( study, instance=None): smesh = smeshBuilder.New(salome.myStudy) Parameters: - study SALOME study, generally obtained by salome.myStudy. - instance CORBA proxy of SMESH Engine. If None, the default Engine is used. + study SALOME study, generally obtained by salome.myStudy. + instance CORBA proxy of SMESH Engine. If None, the default Engine is used. + instanceGeom CORBA proxy of GEOM Engine. If None, the default Engine is used. Returns: smeshBuilder instance """ @@ -1212,7 +1214,7 @@ def New( study, instance=None): doLcc = True smeshInst = smeshBuilder() assert isinstance(smeshInst,smeshBuilder), "Smesh engine class is %s but should be smeshBuilder.smeshBuilder. Import salome.smesh.smeshBuilder before creating the instance."%smeshInst.__class__ - smeshInst.init_smesh(study) + smeshInst.init_smesh(study, instanceGeom) return smeshInst