From: mzn Date: Fri, 24 Nov 2006 12:24:36 +0000 (+0000) Subject: Fix for bug PAL13948(Impossible to load VISU component in batch mode). X-Git-Tag: mergefrom_ScalarMap_ON_GROUP_3_2_0_30Nov06~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=32e75dfd7d1549d2aa9be620933285fce6d3e491;p=modules%2Fvisu.git Fix for bug PAL13948(Impossible to load VISU component in batch mode). --- diff --git a/src/ENGINE/VISU_Engine_i.cc b/src/ENGINE/VISU_Engine_i.cc index 0563dad2..beed4013 100644 --- a/src/ENGINE/VISU_Engine_i.cc +++ b/src/ENGINE/VISU_Engine_i.cc @@ -20,7 +20,6 @@ #include "VISU_Engine_i.hh" #include "utilities.h" -#include CORBA_SERVER_HEADER(SALOME_Session) #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog) #include "SALOME_NamingService.hxx" @@ -41,15 +40,23 @@ extern "C" { VISUEngine_factory(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName, const char *interfaceName) { - if(MYDEBUG) MESSAGE("VisuEngine_factory : "<getId() ; } } namespace VISU{ //=========================================================================== - VISU_Gen_i::VISU_Gen_i(CORBA::ORB_ptr orb, + VISU_Gen_i::VISU_Gen_i(SALOME::Session_ptr session, + CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName, @@ -58,11 +65,8 @@ namespace VISU{ { _thisObj = this ; _id = _poa->activate_object(_thisObj); - SALOME_NamingService aNamingService(orb); - CORBA::Object_ptr anObject = aNamingService.Resolve("/Kernel/Session"); - SALOME::Session_var aSession = SALOME::Session::_narrow(anObject); - //aSession->GetInterface(); - Engines::Component_var aComponent = aSession->GetComponent("libVISUEngineImpl.so"); + + Engines::Component_var aComponent = session->GetComponent("libVISUEngineImpl.so"); myVisuGen = VISU::VISU_Gen::_narrow(aComponent); } diff --git a/src/ENGINE/VISU_Engine_i.hh b/src/ENGINE/VISU_Engine_i.hh index 3f605b43..f4be8865 100644 --- a/src/ENGINE/VISU_Engine_i.hh +++ b/src/ENGINE/VISU_Engine_i.hh @@ -24,6 +24,7 @@ #include "SALOMEconfig.h" #include CORBA_SERVER_HEADER(VISU_Gen) #include CORBA_SERVER_HEADER(MED) +#include CORBA_SERVER_HEADER(SALOME_Session) #include CORBA_SERVER_HEADER(SALOMEDS) #include CORBA_SERVER_HEADER(SALOMEDS_Attributes) @@ -37,7 +38,8 @@ namespace VISU{ VISU_Gen_i(); VISU_Gen_i(const VISU::VISU_Gen_i &); public: - VISU_Gen_i(CORBA::ORB_ptr orb, + VISU_Gen_i(SALOME::Session_ptr session, + CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName,