]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Fix from Christian CAREMOLI for distributed containers. V4_1_1rc2
authorjfa <jfa@opencascade.com>
Thu, 21 Feb 2008 07:48:27 +0000 (07:48 +0000)
committerjfa <jfa@opencascade.com>
Thu, 21 Feb 2008 07:48:27 +0000 (07:48 +0000)
src/GEOM_I_Superv/GEOM_Superv_i.cc

index 731c0f77c4465bb1f0457497815010322ad0b406..387c3b0d4b867c4058c2fa9a797faa39f91152da 100644 (file)
@@ -96,17 +96,15 @@ void GEOM_Superv_i::setGeomEngine()
 {
   if ( !CORBA::is_nil(myGeomEngine) ) 
     return;
-  // get GEOM_Gen engine
-  ///*
-  SALOME_LifeCycleCORBA* lcc = new SALOME_LifeCycleCORBA( name_service );
-  Engines::Component_var comp = lcc->FindOrLoad_Component( "FactoryServer", "GEOM" );
-  //*/
 
-  /*
+  // get GEOM_Gen engine
   Engines::Container_var cont=GetContainerRef();
-  cont->load_component_Library("GEOM");
-  Engines::Component_var comp=cont->create_component_instance("GEOM",0);
-  */
+  CORBA::String_var container_name=cont->name();
+  std::string shortName=container_name.in();
+  shortName=shortName.substr(12); // substract "/Containers/"
+  SALOME_LifeCycleCORBA* lcc = new SALOME_LifeCycleCORBA( name_service );
+  Engines::Component_var comp = lcc->FindOrLoad_Component( shortName.c_str(), "GEOM" );
+  delete lcc;
 
   myGeomEngine = GEOM::GEOM_Gen::_narrow(comp);
 }