From: mzn Date: Mon, 23 Oct 2006 12:38:58 +0000 (+0000) Subject: Load MED component if the study contains MED component data. X-Git-Tag: V3_2_3pre1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=09d0e359d18b44659c3cef28a3a0ed250e52ae2d;p=modules%2Fvisu.git Load MED component if the study contains MED component data. --- diff --git a/src/VISU_I/Makefile.in b/src/VISU_I/Makefile.in index 41b9c67e..a786b8da 100644 --- a/src/VISU_I/Makefile.in +++ b/src/VISU_I/Makefile.in @@ -61,6 +61,7 @@ LIB_MOC = \ VISU_TimeAnimation.h LIB_SERVER_IDL = \ + MED_Gen.idl \ MED.idl \ VISU_Gen.idl \ SALOME_Component.idl \ diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 0070b912..8dcc584c 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -68,6 +68,7 @@ #include #include CORBA_SERVER_HEADER(SALOME_Session) #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog) +#include CORBA_SERVER_HEADER(MED_Gen) // QT Includes #include @@ -609,6 +610,20 @@ namespace VISU myStudyDocument = SALOMEDS::Study::_duplicate(theStudy); ProcessVoidEvent(new TEvent(aStudyName)); + + // Load MED component if necessary + if(!myStudyDocument->FindComponent("MED")->_is_nil()) + { + SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService()); + Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","MED"); + SALOME_MED::MED_Gen_var aMedEngine = SALOME_MED::MED_Gen::_narrow(aComponent); + + if(!CORBA::is_nil(aMedEngine)) + { + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder(); + aStudyBuilder->LoadWith( myStudyDocument->FindComponent( "MED" ), aMedEngine ); + } + } } else { INFOS("CORBA::is_nil(theStudy)"); }