X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i.cxx;h=09ea4c2fe85042e88438fff295d779bd485527a8;hp=dafa206c1743d1723de83aece3220ed68edc7630;hb=b8a546c91fd42b08cea4f8e92631ab51362a51a6;hpb=6d32f944a0a115b6419184c50b57bf7c4eef5786 diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index dafa206c1..09ea4c2fe 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -462,9 +462,10 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp // report any error, if occurred #ifndef WIN32 const char* anError = dlerror(); - throw(SALOME_Exception(anError)); + throw(SALOME_Exception( anError )); #else - throw(SALOME_Exception(LOCALIZED( "Can't load server meshers plugin library" ))); + throw(SALOME_Exception ( SMESH_Comment("Can't load meshers plugin library " ) + << aPlatformLibName)); #endif } @@ -474,7 +475,8 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp (GetHypothesisCreator)GetProc( libHandle, "GetHypothesisCreator" ); if (!procHandle) { - throw(SALOME_Exception(LOCALIZED("bad hypothesis plugin library"))); + throw(SALOME_Exception(SMESH_Comment("bad hypothesis plugin library") + << aPlatformLibName )); UnLoadLib(libHandle); } @@ -483,7 +485,8 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp aCreator = procHandle(theHypName); if (!aCreator) { - throw(SALOME_Exception(LOCALIZED("no such a hypothesis in this plugin"))); + throw(SALOME_Exception( SMESH_Comment( theHypName ) << " is missing from " + << aPlatformLibName)); } // map hypothesis creator to a hypothesis name myHypCreatorMap[string(theHypName)] = aCreator; @@ -1993,14 +1996,16 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh, void SMESH_Gen_i::CancelCompute( SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr theShapeObject ) { - SMESH_Mesh_i* meshServant = dynamic_cast( GetServant( theMesh ).in() ); - ::SMESH_Mesh& myLocMesh = meshServant->GetImpl(); - TopoDS_Shape myLocShape; - if(theMesh->HasShapeToMesh()) - myLocShape = GeomObjectToShape( theShapeObject ); - else - myLocShape = SMESH_Mesh::PseudoShape(); - myGen.CancelCompute( myLocMesh, myLocShape); + if ( SMESH_Mesh_i* meshServant = dynamic_cast( GetServant( theMesh ).in() )) + { + ::SMESH_Mesh& myLocMesh = meshServant->GetImpl(); + TopoDS_Shape myLocShape; + if(theMesh->HasShapeToMesh()) + myLocShape = GeomObjectToShape( theShapeObject ); + else + myLocShape = SMESH_Mesh::PseudoShape(); + myGen.CancelCompute( myLocMesh, myLocShape); + } } //============================================================================= @@ -2507,6 +2512,22 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray, TGroupsMap groupsMap; TListOfNewGroups listOfNewGroups; + if ( !CORBA::is_nil( theMeshToAppendTo )) + { + // fill groupsMap with existing groups + SMESH::ListOfGroups_var groups = theMeshToAppendTo->GetGroups(); + for ( CORBA::ULong i = 0; i < groups->length(); ++i ) + { + SMESH::SMESH_Group_var group = SMESH::SMESH_Group::_narrow( groups[ i ]); + if ( !group->_is_nil() ) + { + CORBA::String_var name = group->GetName(); + SMESH::ElementType type = group->GetType(); + groupsMap[ TNameAndType( name.in(), type ) ].push_back( group ); + } + } + } + ::SMESH_MeshEditor newEditor( &locMesh ); ::SMESH_MeshEditor::ElemFeatures elemType; @@ -3435,7 +3456,7 @@ namespace // utils for CopyMeshWithGeom() * \param [out] invalidEntries - return study entries of objects whose * counterparts are not found in the newGeometry, followed by entries * of mesh sub-objects that are invalid because they depend on a not found - * preceeding sub-shape + * preceding sub-shape * \return CORBA::Boolean - is a success */ //================================================================================ @@ -5200,6 +5221,10 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, try { // protect persistence mechanism against exceptions myHyp = this->createHypothesis( hypname.c_str(), libname.c_str() ); } + catch( SALOME::SALOME_Exception& ex ) + { + INFOS( "Exception during hypothesis creation: " << ex.details.text ); + } catch (...) { INFOS( "Exception during hypothesis creation" ); }