From 5fabc58d7e765d9c2fe9eea8b73eea1bb352ce0b Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 3 Nov 2009 13:24:18 +0000 Subject: [PATCH] 0020571: EDF 1160 SMESH : SMESH_MEDMesh_i::getName() always return toto --- src/SMESH_I/SMESH_MEDMesh_i.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/SMESH_I/SMESH_MEDMesh_i.cxx b/src/SMESH_I/SMESH_MEDMesh_i.cxx index ec26217b9..f73bf1102 100644 --- a/src/SMESH_I/SMESH_MEDMesh_i.cxx +++ b/src/SMESH_I/SMESH_MEDMesh_i.cxx @@ -24,6 +24,7 @@ // Module : SMESH // #include "SMESH_MEDMesh_i.hxx" +#include "SMESH_Gen_i.hxx" #include "SMESH_Mesh_i.hxx" #include "SMESHDS_Mesh.hxx" @@ -115,9 +116,14 @@ char *SMESH_MEDMesh_i::getName() throw(SALOME::SALOME_Exception) try { - // A COMPLETER PAR LE NOM DU MAILLAGE - //return CORBA::string_dup(_mesh_i->getName().c_str()); - return CORBA::string_dup("toto"); + SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen(); + SALOMEDS::Study_var study = gen->GetCurrentStudy(); + SALOMEDS::SObject_var meshSO = gen->ObjectToSObject( study, _mesh_i->_this()); + if ( meshSO->_is_nil() ) + return CORBA::string_dup("toto"); + + CORBA::String_var name = meshSO->GetName(); + return CORBA::string_dup( name.in() ); } catch(...) { @@ -125,6 +131,7 @@ char *SMESH_MEDMesh_i::getName() throw(SALOME::SALOME_Exception) THROW_SALOME_CORBA_EXCEPTION("Unable to acces Mesh C++ Object", SALOME::INTERNAL_ERROR); } + return 0; } //============================================================================= -- 2.39.2