Back to index

salome-med  6.5.0
Med_Gen_i.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  MED MED : implemetation of MED idl descriptions
00024 //  File   : Med_Gen_i.cxx
00025 //  Author : Paul RASCLE, EDF
00026 //  Module : MED
00027 
00028 #include "Med_Gen_i.hxx"
00029 
00030 #include "MEDMEM_Mesh.hxx"
00031 #include "MEDMEM_Med_i.hxx"
00032 #include "MEDMEM_FieldTemplate_i.hxx"
00033 #include "MEDMEM_Support_i.hxx"
00034 
00035 #include "MEDMEM_Mesh_i.hxx"
00036 #include "MEDMEM_Field.hxx"
00037 
00038 #include "MEDMEM_MedFileBrowser.hxx"
00039 #include "MEDMEM_MedMeshDriver.hxx"
00040 #include "MEDMEM_MedFieldDriver.hxx"
00041 #include "MEDMEM_define.hxx"
00042 #include "MEDMEM_DriversDef.hxx"
00043 #include "MEDMEM_Grid.hxx"
00044 
00045 
00046 #include "Utils_SINGLETON.hxx"
00047 #include "OpUtil.hxx"
00048 #include "Utils_CorbaException.hxx"
00049 #include "utilities.h"
00050 
00051 #include "SALOMEDS_Tool.hxx"
00052 
00053 #include <string>
00054 #include <deque>
00055 #include <map>
00056 
00057 #include <HDFascii.hxx>
00058 
00059 using namespace MEDMEM;
00060 
00061 // Initialisation des variables statiques
00062 //string Med_Gen_i::_myFileName="";
00063 //string Med_Gen_i::_saveFileName="";
00064  Med_Gen_i* Med_Gen_i::_MEDGen = NULL;
00065 
00066 //=============================================================================
00070 //=============================================================================
00071 //Med_Gen_i::Med_Gen_i()
00072 //{
00073 //  MESSAGE("Med_Gen_i::Med_Gen_i");
00074 //}
00075 
00076 //=============================================================================
00080 //=============================================================================
00081 Med_Gen_i::Med_Gen_i(CORBA::ORB_ptr orb,
00082                      PortableServer::POA_ptr poa,
00083                      PortableServer::ObjectId * contId,
00084                      const char *instanceName,
00085                      const char *interfaceName)
00086   : Engines_Component_i(orb, poa, contId, instanceName, interfaceName),
00087     Med_Gen_Driver_i(orb)
00088 {
00089   MESSAGE("activate object");
00090   _thisObj = this ;
00091   _id = _poa->activate_object(_thisObj);
00092 
00093   _duringLoad=false;
00094   // get an NamingService interface
00095   //_NS = SINGLETON_<SALOME_NamingService>::Instance() ;
00096   //ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
00097   //_NS->init_orb( _orb ) ;
00098 
00099   //_myMedI = 0;
00100   _MEDGen = this;
00101 }
00102 
00103 //=============================================================================
00107 //=============================================================================
00108 Med_Gen_i::~Med_Gen_i()
00109 {
00110   MESSAGE("Med_Gen_i::~Med_Gen_i");
00111 }
00112 
00113 //=============================================================================
00119 //=============================================================================
00120 PortableServer::ServantBase_var Med_Gen_i::GetServant( CORBA::Object_ptr theObject )
00121 {
00122   if( CORBA::is_nil( theObject ) || !_MEDGen || CORBA::is_nil( _MEDGen->_poa ) )
00123     return NULL;
00124   try {
00125     PortableServer::Servant aServant = _MEDGen->_poa->reference_to_servant( theObject );
00126     return aServant;
00127   }
00128   catch (...) {
00129     INFOS( "GetServant - Unknown exception was caught!!!" );
00130     return NULL;
00131   }
00132 }
00133 
00134 //=============================================================================
00138 //=============================================================================
00139 SALOMEDS::Study_var Med_Gen_i::studyName2Study(const char* studyName)
00140   throw(SALOME::SALOME_Exception)
00141 {
00142   string myStudyName(studyName);
00143 
00144   if (myStudyName.size() == 0)
00145     THROW_SALOME_CORBA_EXCEPTION("No Study Name given", \
00146                                  SALOME::BAD_PARAM);
00147 
00148   // Get StudyManager Reference, current study,
00149 
00150   CORBA::Object_var obj = _NS->Resolve("/myStudyManager");
00151   SALOMEDS::StudyManager_var myStudyManager =
00152     SALOMEDS::StudyManager::_narrow(obj);
00153   if(CORBA::is_nil(myStudyManager))
00154     THROW_SALOME_CORBA_EXCEPTION("No StudyManager Found in NameService", \
00155                                  SALOME::BAD_PARAM);
00156 
00157   SALOMEDS::Study_var myStudy =
00158     myStudyManager->GetStudyByName(myStudyName.c_str());
00159   if (CORBA::is_nil(myStudy))
00160     THROW_SALOME_CORBA_EXCEPTION("Wrong Study Name", \
00161                                  SALOME::BAD_PARAM);
00162 
00163   return SALOMEDS::Study::_duplicate(myStudy) ;
00164 }
00165 
00166 //=============================================================================
00170 //=============================================================================
00171 void Med_Gen_i::addInStudy(SALOMEDS::Study_var myStudy)
00172   throw(SALOME::SALOME_Exception)
00173 {
00174   SALOMEDS::StudyBuilder_var  myBuilder = myStudy->NewBuilder();
00175   // Create SComponent labelled 'Med' if it doesn't already exit
00176   SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED");
00177   if ( CORBA::is_nil(medfather) )
00178     {
00179       myBuilder->NewCommand();
00180       // mpv: component label must be created in spite of "Locked" study flag state
00181       bool aLocked = myStudy->GetProperties()->IsLocked();
00182       if (aLocked) myStudy->GetProperties()->SetLocked(false);
00183 
00184       MESSAGE("Add Component Med");
00185       medfather = myBuilder->NewComponent("MED");
00186       SALOMEDS::GenericAttribute_var anAttr = myBuilder->FindOrCreateAttribute(medfather, "AttributeName");
00187       SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
00188       //NRI      aName->SetValue("Med");
00189 
00190       CORBA::Object_var objVarN = _NS->Resolve("/Kernel/ModulCatalog");
00191       SALOME_ModuleCatalog::ModuleCatalog_var Catalogue  = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN);
00192       SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "MED" );
00193       if ( !Comp->_is_nil() ) {
00194         aName->SetValue( Comp->componentusername() );
00195       }
00196 
00197       //            Utilisation de this  deconseillee par Paul ??
00198       //            myBuilder->DefineComponentInstance(medfather,POA_Engines::MED_Gen::_this());
00199       CORBA::Object_var myO = _poa->id_to_reference(*_id); // this ior...
00200       myBuilder->DefineComponentInstance(medfather,myO);
00201 
00202       if (aLocked) myStudy->GetProperties()->SetLocked(true);
00203       myBuilder->CommitCommand();
00204     }
00205 }
00206 
00207 //=============================================================================
00211 //=============================================================================
00212 SALOME_MED::MED_ptr Med_Gen_i::readStructFile (const char* fileName,
00213                                                const char* studyName)
00214   throw(SALOME::SALOME_Exception)
00215 {
00216         beginService("Med_Gen_i::readStructFile");
00217 
00218         SCRUTE(fileName);
00219         SALOMEDS::Study_var myStudy = studyName2Study(studyName) ;
00220         //if (!_duringLoad) addInStudy(myStudy) ;
00221 
00222         SALOME_MED::MED_ptr myMedIOR ;
00223         try
00224         {
00225           // we create a new MED_i and add in study
00226           //SALOMEDS::SComponent_var theComponent = myStudy->FindComponent("MED");
00227           //MED_i * myMedI = 0;
00228           //if (CORBA::is_nil(theComponent))
00229           //  myMedI = new MED_i();
00230           //else
00231           //  myMedI = Med_Gen_Driver_i::GetMED(theComponent);
00232           MED_i * myMedI = new MED_i();
00233           myMedIOR = myMedI->_this() ;
00234 //        if (!_duringLoad) myMedI->addInStudy(myStudy,myMedIOR) ;
00235 //        if (!_duringLoad) myMedI->addInStudy(myStudy,myMedIOR,fileName) ;
00236           // create ::MED object, read all and add in study !
00237           myMedI->init(myStudy,MED_DRIVER,fileName) ;
00238         }
00239         catch (const SALOMEDS::StudyBuilder::LockProtection & ) {}
00240         catch(...)
00241         {
00242                 MESSAGE("Erreur a la lecture du fichier");
00243                 THROW_SALOME_CORBA_EXCEPTION("Unable to open File "\
00244                                                 ,SALOME::BAD_PARAM);
00245         }
00246 
00247         endService("Med_Gen_i::readStructFile");
00248         return myMedIOR;
00249 }
00250 
00251 //=============================================================================
00256 //=============================================================================
00257 void Med_Gen_i::readStructFileWithFieldType (const char* fileName,
00258                                              const char* studyName)
00259   throw (SALOME::SALOME_Exception)
00260 {
00261         beginService("Med_Gen_i::readStructFileWithFieldType");
00262         SCRUTE(fileName);
00263         SALOMEDS::Study_var myStudy = studyName2Study(studyName) ;
00264         if (!_duringLoad) addInStudy(myStudy) ;
00265 
00266         try
00267         {
00268           // we create a new MED_i and add in study
00269           SALOMEDS::SComponent_var theComponent = myStudy->FindComponent("MED");
00270           //MED_i * myMedI = 0;
00271           //if (CORBA::is_nil(theComponent))
00272           //  myMedI = new MED_i();
00273           //else
00274           //  myMedI = Med_Gen_Driver_i::GetMED(theComponent);
00275           MED_i * myMedI = new MED_i();
00276           SALOME_MED::MED_ptr myMedIOR = myMedI->_this();
00277           if (!_duringLoad) myMedI->addInStudy(myStudy,myMedIOR,theComponent,fileName);
00278           // create ::MED object, read all and add in study !
00279           myMedI->initWithFieldType(myStudy,MED_DRIVER,fileName);
00280         }
00281         catch (const SALOMEDS::StudyBuilder::LockProtection & ) {}
00282         catch(...)
00283         {
00284                 MESSAGE("Erreur a la lecture du fichier");
00285                 THROW_SALOME_CORBA_EXCEPTION("Unable to open File "\
00286                                                 ,SALOME::BAD_PARAM);
00287         }
00288 
00289         endService("Med_Gen_i::readStructFileWithFieldType");
00290 }
00291 
00292 //=============================================================================
00296 //=============================================================================
00297 SALOME_MED::GMESH_ptr Med_Gen_i::readMeshInFile(const char* fileName,
00298                                                 const char* studyName,
00299                                                 const char* meshName)
00300 throw (SALOME::SALOME_Exception)
00301 {
00302         beginService("Med_Gen_i::readMeshInFile");
00303         SCRUTE(fileName);
00304         SALOMEDS::Study_var myStudy = studyName2Study(studyName) ;
00305 
00306 //      if (!_duringLoad) addInStudy(myStudy) ;
00307 
00308 // Creation du maillage
00309 
00310         GMESH * myMesh;
00311 
00312         // skl for IPAL14240
00313         // check mesh or grid:
00314         try {
00315           if ( MEDFILEBROWSER( fileName ).isStructuredMesh( meshName ) )
00316             myMesh = new GRID();
00317           else
00318             myMesh = new MESH() ;
00319         }
00320         catch (const std::exception & ex) {
00321           MESSAGE("Exception Interceptee : ");
00322           SCRUTE(ex.what());
00323           myMesh = new MESH() ;
00324         };
00325 
00326         myMesh->setName(meshName);
00327         MED_MESH_RDONLY_DRIVER myMeshDriver(fileName,myMesh);
00328         try
00329         {
00330                 myMeshDriver.setMeshName(meshName);
00331                 myMeshDriver.open();
00332         }
00333 #if defined(_DEBUG_) || defined(_DEBUG)
00334         catch (const std::exception & ex)
00335 #else
00336         catch (const std::exception &)
00337 #endif
00338         {
00339                 MESSAGE("Exception Interceptee : ");
00340                 SCRUTE(ex.what());
00341                 THROW_SALOME_CORBA_EXCEPTION("Unable to find this mesh in this file",SALOME::BAD_PARAM);
00342         };
00343         try
00344         {
00345                 myMeshDriver.read();
00346                 MESSAGE("apres read");
00347                 myMeshDriver.close();
00348         }
00349 #if defined(_DEBUG_) || defined(_DEBUG)
00350         catch (const std::exception & ex)
00351 #else
00352         catch (const std::exception &)
00353 #endif
00354         {
00355                 MESSAGE("Exception Interceptee : ");
00356                 SCRUTE(ex.what());
00357                 THROW_SALOME_CORBA_EXCEPTION("Unable to read this mesh in this file",SALOME::BAD_PARAM);
00358         };
00359 
00360         GMESH_i * meshi = new GMESH_i(myMesh);
00361         //SALOME_MED::MESH_var mesh = SALOME_MED::MESH::_narrow(meshi->_this());
00362         SALOME_MED::GMESH_ptr mesh = meshi->_this();
00363         try
00364         {
00365           // add the mesh object in study
00366 //        if (!_duringLoad) meshi->addInStudy(myStudy,mesh);
00367         }
00368         catch (const SALOMEDS::StudyBuilder::LockProtection & ) {}
00369 
00370         endService("Med_Gen_i::readMeshInFile");
00371         return mesh;
00372 }
00373 
00374 //=============================================================================
00378 //=============================================================================
00379 SALOME_MED::FIELD_ptr Med_Gen_i::readFieldInFile(const char* fileName,
00380                                                  const char* studyName,
00381                                                  const char* fieldName,
00382                                                  CORBA::Long iter,
00383                                                  CORBA::Long ordre)
00384 throw (SALOME::SALOME_Exception)
00385 {
00386   beginService("Med_Gen_i::readFieldInFile");
00387   SCRUTE(fileName);
00388   string myStudyName(studyName);
00389 
00390   if (myStudyName.size() == 0)
00391     THROW_SALOME_CORBA_EXCEPTION("No Study Name given", \
00392                                  SALOME::BAD_PARAM);
00393 
00394   // Get StudyManager Reference, current study,
00395 
00396   CORBA::Object_var obj = _NS->Resolve("/myStudyManager");
00397   SALOMEDS::StudyManager_var myStudyManager =
00398     SALOMEDS::StudyManager::_narrow(obj);
00399   ASSERT(! CORBA::is_nil(myStudyManager));
00400   SALOMEDS::Study_var myStudy =
00401     myStudyManager->GetStudyByName(myStudyName.c_str());
00402   if (CORBA::is_nil(myStudy))
00403     THROW_SALOME_CORBA_EXCEPTION("Wrong Study Name",    \
00404                                  SALOME::BAD_PARAM);
00405 
00406   SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder();
00407   SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED");
00408   if (CORBA::is_nil(medfather))
00409   {
00410     myBuilder->NewCommand();
00411     // mpv: component label must be created in spite of "Locked" study flag state
00412     bool aLocked = myStudy->GetProperties()->IsLocked();
00413     if (aLocked) myStudy->GetProperties()->SetLocked(false);
00414 
00415     medfather = myBuilder->NewComponent("MED");
00416     SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(
00417                                                                          myBuilder->FindOrCreateAttribute(medfather, "AttributeName"));
00418     //NRI           aName->SetValue("Med");
00419 
00420     CORBA::Object_var objVarN = _NS->Resolve("/Kernel/ModulCatalog");
00421     SALOME_ModuleCatalog::ModuleCatalog_var Catalogue  = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN);
00422     SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "MED" );
00423     if ( !Comp->_is_nil() ) {
00424       aName->SetValue( Comp->componentusername() );
00425     }
00426 
00427     CORBA::Object_var myO = _poa->id_to_reference(*_id); // this ior...
00428     myBuilder->DefineComponentInstance(medfather,myO);
00429 
00430     if (aLocked) myStudy->GetProperties()->SetLocked(true);
00431     myBuilder->CommitCommand();
00432 
00433   }
00434   else
00435     MESSAGE("MED dejà dans l étude");
00436 
00437   MESSAGE("Lecture du fichier ")
00438     SCRUTE(fileName);
00439 
00440   // Creation du champ
00441 
00442   FIELD_ * myField;
00443   MEDFILEBROWSER mymed;
00444   try
00445   {
00446     mymed.readFileStruct(fileName) ;
00447   }
00448   catch (const std::exception & ex)
00449   {
00450     MESSAGE("Exception Interceptee : ");
00451     SCRUTE(ex.what());
00452     THROW_SALOME_CORBA_EXCEPTION("Unable to find this file ",SALOME::BAD_PARAM);
00453   }
00454 
00455   try
00456   {
00457     vector<string> fieldsNames = mymed.getFieldNames() ;
00458     int numberOfFields = fieldsNames.size();
00459     int i;
00460     for (i=0; i<numberOfFields; i++)
00461     {
00462       if (fieldsNames[i]== fieldName) break;
00463     }
00464     if (i == numberOfFields)
00465     {
00466       THROW_SALOME_CORBA_EXCEPTION("Unable to find this field ",SALOME::BAD_PARAM);
00467     }
00468     MESSAGE("trouve");
00469 
00470     switch( mymed.getFieldType( fieldName ))
00471     {
00472     case MED_REEL64: myField = new FIELD<double>; break;
00473     case MED_INT32:  
00474     case MED_INT64:  myField = new FIELD<int>; break;
00475     default:
00476       THROW_SALOME_CORBA_EXCEPTION("Invalid field type",SALOME::BAD_PARAM);
00477     }
00478     myField->setIterationNumber( iter );
00479     myField->setOrderNumber( ordre );
00480     myField->addDriver( MED_DRIVER, fileName, fieldName, MED_EN::RDONLY);
00481 
00482   }
00483 #if defined(_DEBUG_) || defined(_DEBUG)
00484   catch (const std::exception & ex)
00485 #else
00486   catch (const std::exception &)
00487 #endif
00488   {
00489     MESSAGE("Exception Interceptee : ");
00490     SCRUTE(ex.what());
00491     THROW_SALOME_CORBA_EXCEPTION("Unable to find this field in this file",SALOME::BAD_PARAM);
00492   };
00493 
00494   GMESH* myMesh=0;
00495   try {
00496     string MeshName = mymed.getMeshName( fieldName );
00497     myMesh = mymed.isStructuredMesh( MeshName ) ? (GMESH*) new GRID : (GMESH*) new MESH;
00498     myMesh->addDriver(MED_DRIVER, fileName, MeshName, MED_EN::RDONLY );
00499     myMesh->read();
00500     SCRUTE(myMesh->getName());
00501   }
00502 #if defined(_DEBUG_) || defined(_DEBUG)
00503   catch (const std::exception & ex)
00504 #else
00505   catch (const std::exception &)
00506 #endif
00507   {
00508     MESSAGE("Exception Interceptee : ");
00509     SCRUTE(ex.what());
00510     THROW_SALOME_CORBA_EXCEPTION("Unable to find associated mesh",SALOME::BAD_PARAM);
00511   };
00512 
00513   med_type_champ type = myField->getValueType() ;
00514   switch (type)
00515   {
00516   case MED_EN::MED_INT32:
00517     {
00518       try
00519       {
00520         ((FIELD<int>*)myField)->read() ;
00521         myField->getSupport()->setMesh( myMesh );
00522         FIELDTEMPLATE_I<int,FullInterlace> * myFieldIntI = new FIELDTEMPLATE_I<int,FullInterlace>((FIELD<int,FullInterlace>*)myField);
00523         SALOME_MED::FIELD_ptr myFieldIOR = myFieldIntI->_this();
00524         //                      if (!_duringLoad) myFieldIntI->addInStudy(myStudy,myFieldIOR) ;
00525         endService("Med_Gen_i::readFieldInFile");
00526         return myFieldIOR;
00527       }
00528       catch (const SALOMEDS::StudyBuilder::LockProtection &) {}
00529 #if defined(_DEBUG_) || defined(_DEBUG)
00530       catch (const std::exception & ex)
00531 #else
00532         catch (const std::exception &)
00533 #endif
00534         {
00535           MESSAGE("Exception Interceptee : ");
00536           SCRUTE(ex.what());
00537           THROW_SALOME_CORBA_EXCEPTION("Unable to read int field",SALOME::BAD_PARAM);
00538         };
00539       break;
00540     }
00541   case MED_EN::MED_REEL64:
00542     {
00543       try
00544       {
00545         ((FIELD<double>*)myField)->read() ;
00546         myField->getSupport()->setMesh( myMesh );
00547         FIELDTEMPLATE_I<double,FullInterlace> * myFieldDoubleI = new FIELDTEMPLATE_I<double,FullInterlace>((FIELD<double,FullInterlace>*)myField);
00548         SALOME_MED::FIELD_ptr myFieldIOR = myFieldDoubleI->_this() ;
00549         //                      if (!_duringLoad) myFieldDoubleI->addInStudy(myStudy,myFieldIOR) ;
00550         endService("Med_Gen_i::readFieldInFile");
00551         return myFieldIOR;
00552       }
00553       catch (const SALOMEDS::StudyBuilder::LockProtection &) {}
00554 
00555 #if defined(_DEBUG_) || defined(_DEBUG)
00556       catch (const std::exception & ex)
00557 #else
00558         catch (const std::exception &)
00559 #endif
00560         {
00561           MESSAGE("Exception Interceptee : ");
00562           SCRUTE(ex.what());
00563           THROW_SALOME_CORBA_EXCEPTION("Unable to read double field",SALOME::BAD_PARAM);
00564         };
00565       break;
00566     }
00567   default:
00568     THROW_SALOME_CORBA_EXCEPTION("Not recognized type of field !",SALOME::BAD_PARAM);
00569   }
00570 
00571   return SALOME_MED::FIELD::_nil();
00572 }
00573 
00574 
00575 //=============================================================================
00579 //=============================================================================
00580 Engines::EngineComponent_ptr Med_Gen_i::GetComponentInstance()
00581 {
00582   return MED_Gen::_this();
00583 }
00584 
00585 char* Med_Gen_i::ComponentDataType()
00586 {
00587   MESSAGE("Med_Gen_i::ComponentDataType");
00588   return CORBA::string_dup("MED") ; /* What is this type ? */
00589 }
00590 
00591 
00592 
00593 //=============================================================================
00597 //=============================================================================
00598 
00599 extern "C" MED_EXPORT 
00600   PortableServer::ObjectId * MEDEngine_factory(
00601                                CORBA::ORB_ptr orb,
00602                                PortableServer::POA_ptr poa,
00603                                PortableServer::ObjectId * contId,
00604                                const char *instanceName,
00605                                const char *interfaceName)
00606 {
00607   MESSAGE("PortableServer::ObjectId * MedEngine_factory()");
00608   SCRUTE(interfaceName);
00609   Med_Gen_i * myMed_Gen
00610     = new Med_Gen_i(orb, poa, contId, instanceName, interfaceName);
00611   return myMed_Gen->getId() ;
00612 }