From 911740bb49d7cdc4ce077b51f0c60674e99d8e11 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 5 Apr 2013 14:20:10 +0000 Subject: [PATCH] Fix problems with compilation --- src/VISUGUI/VisuGUI.cxx | 2 ++ src/VISUGUI/VisuGUI_Tools.cxx | 3 ++- src/VISUGUI/VisuGUI_Tools.h | 4 ++++ src/VISU_I/Makefile.am | 1 - src/VISU_I/VISU_Gen_i.cc | 40 +++++++++++++++++++---------------- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 3733fe36..b81bc47b 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -163,8 +163,10 @@ #include "VISU_TableDlg.h" #include "VisuGUI_FileInfoDlg.h" +#ifdef WITH_MEDGEN #include "SALOMEconfig.h" #include CORBA_SERVER_HEADER(MED_Gen) +#endif // WITH_MEDGEN #include "utilities.h" diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 7070d715..43991c9b 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -239,6 +239,7 @@ namespace VISU return aGen; } +#ifdef WITH_MEDGEN //------------------------------------------------------------ SALOME_MED::MED_Gen_var GetMEDEngine() @@ -253,7 +254,7 @@ namespace VISU throw std::runtime_error(QObject::tr("ERR_CANT_FIND_MED_COMPONENT").toLatin1().data()); return aGen; } - +#endif // WITH_MEDGEN //---------------------------------------------------------------------------- // Selection diff --git a/src/VISUGUI/VisuGUI_Tools.h b/src/VISUGUI/VisuGUI_Tools.h index 23306c1a..028c4c74 100644 --- a/src/VISUGUI/VisuGUI_Tools.h +++ b/src/VISUGUI/VisuGUI_Tools.h @@ -35,8 +35,10 @@ #include "SALOMEDSClient_Study.hxx" +#ifdef WITH_MEDGEN #include "SALOMEconfig.h" #include CORBA_SERVER_HEADER(MED_Gen) +#endif // WITH_MEDGEN class QWidget; class QDialog; @@ -91,7 +93,9 @@ namespace VISU //---------------------------------------------------------------------------- VISU_Gen_i* GetVisuGen(const CAM_Module* theModule); +#ifdef WITH_MEDGEN SALOME_MED::MED_Gen_var GetMEDEngine(); +#endif // WITH_MEDGEN // Selection LightApp_SelectionMgr* GetSelectionMgr(const SalomeApp_Module* theModule); diff --git a/src/VISU_I/Makefile.am b/src/VISU_I/Makefile.am index 1dfae84c..951cbd4c 100644 --- a/src/VISU_I/Makefile.am +++ b/src/VISU_I/Makefile.am @@ -215,5 +215,4 @@ VISU_I_LDADD=\ -lMEDWrapper \ -lMEDWrapperBase \ -lMEDWrapper_V2_2 \ - -lmedmem \ @CORBA_LIBS@ diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 6bee3e8c..6f17be13 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -71,7 +71,9 @@ #include #include CORBA_SERVER_HEADER(SALOME_Session) #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog) +#ifdef WITH_MEDGEN #include CORBA_SERVER_HEADER(MED_Gen) +#endif // WITH_MEDGEN // QT Includes #include @@ -780,25 +782,27 @@ namespace VISU ProcessVoidEvent(new TEvent(aStudyName)); +#ifdef WITH_MEDGEN // Load MED component if necessary - if(!myStudyDocument->FindComponent("MED")->_is_nil()) - { - SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService()); - Engines::EngineComponent_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(); - try { - aStudyBuilder->LoadWith( myStudyDocument->FindComponent( "MED" ), aMedEngine ); - } - catch( const SALOME::SALOME_Exception& ) { - // Oops, something went wrong while loading - // See also SalomeApp_Study::openDataModel() - } - } - } + if (!myStudyDocument->FindComponent("MED")->_is_nil()) + { + SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService()); + Engines::EngineComponent_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(); + try { + aStudyBuilder->LoadWith( myStudyDocument->FindComponent( "MED" ), aMedEngine ); + } + catch( const SALOME::SALOME_Exception& ) { + // Oops, something went wrong while loading + // See also SalomeApp_Study::openDataModel() + } + } + } +#endif // WITH_MEDGEN } else { INFOS("CORBA::is_nil(theStudy)"); } -- 2.30.2