From 32e75dfd7d1549d2aa9be620933285fce6d3e491 Mon Sep 17 00:00:00 2001 From: mzn Date: Fri, 24 Nov 2006 12:24:36 +0000 Subject: [PATCH] Fix for bug PAL13948(Impossible to load VISU component in batch mode). --- src/ENGINE/VISU_Engine_i.cc | 22 +++++++++++++--------- src/ENGINE/VISU_Engine_i.hh | 4 +++- 2 files changed, 16 insertions(+), 10 deletions(-) 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, -- 2.39.2