From afc69b25b04a2bb6210e92653169d66251369b1e Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Fri, 24 Jul 2015 19:13:43 +0200 Subject: [PATCH] Convenience factory client --- src/MEDCalc/cmp/CMakeLists.txt | 1 + src/MEDCalc/{gui => cmp}/MEDFactoryClient.cxx | 0 src/MEDCalc/{gui => cmp}/MEDFactoryClient.hxx | 8 ++++---- src/MEDCalc/cmp/MEDPresentationManager_i.cxx | 10 ++++++++++ src/MEDCalc/gui/CMakeLists.txt | 1 - 5 files changed, 15 insertions(+), 5 deletions(-) rename src/MEDCalc/{gui => cmp}/MEDFactoryClient.cxx (100%) rename src/MEDCalc/{gui => cmp}/MEDFactoryClient.hxx (87%) diff --git a/src/MEDCalc/cmp/CMakeLists.txt b/src/MEDCalc/cmp/CMakeLists.txt index 5e5c8393e..57ed9e3e3 100644 --- a/src/MEDCalc/cmp/CMakeLists.txt +++ b/src/MEDCalc/cmp/CMakeLists.txt @@ -33,6 +33,7 @@ INCLUDE_DIRECTORIES( ) SET(MEDFactoryEngine_SOURCES + MEDFactoryClient.cxx MEDDataManager_i.cxx MEDCalculator_i.cxx MEDPresentationManager_i.cxx diff --git a/src/MEDCalc/gui/MEDFactoryClient.cxx b/src/MEDCalc/cmp/MEDFactoryClient.cxx similarity index 100% rename from src/MEDCalc/gui/MEDFactoryClient.cxx rename to src/MEDCalc/cmp/MEDFactoryClient.cxx diff --git a/src/MEDCalc/gui/MEDFactoryClient.hxx b/src/MEDCalc/cmp/MEDFactoryClient.hxx similarity index 87% rename from src/MEDCalc/gui/MEDFactoryClient.hxx rename to src/MEDCalc/cmp/MEDFactoryClient.hxx index 62a6de5fb..054f869be 100644 --- a/src/MEDCalc/gui/MEDFactoryClient.hxx +++ b/src/MEDCalc/cmp/MEDFactoryClient.hxx @@ -28,7 +28,7 @@ #include CORBA_CLIENT_HEADER(MEDDataManager) #include CORBA_CLIENT_HEADER(MEDCalculator) -#include "MEDCALCGUI.hxx" +#include "MEDCALC.hxx" // This helper manages static variables binded on main objects of the // XMED context, so that they could be initialized once and shared in @@ -36,9 +36,9 @@ // class while this instance are singleton instances. namespace MEDFactoryClient { - MEDCALCGUI_EXPORT MEDCALC::MEDFactory_ptr getFactory(); - MEDCALCGUI_EXPORT MEDCALC::MEDDataManager_ptr getDataManager(); - MEDCALCGUI_EXPORT MEDCALC::MEDCalculator_ptr getCalculator(); + MEDCALC_EXPORT MEDCALC::MEDFactory_ptr getFactory(); + MEDCALC_EXPORT MEDCALC::MEDDataManager_ptr getDataManager(); + MEDCALC_EXPORT MEDCALC::MEDCalculator_ptr getCalculator(); } #endif // _MEDFACTORY_CLIENT_HXX_ diff --git a/src/MEDCalc/cmp/MEDPresentationManager_i.cxx b/src/MEDCalc/cmp/MEDPresentationManager_i.cxx index 62ea2280d..eb0be04fd 100644 --- a/src/MEDCalc/cmp/MEDPresentationManager_i.cxx +++ b/src/MEDCalc/cmp/MEDPresentationManager_i.cxx @@ -18,6 +18,7 @@ // #include "MEDPresentationManager_i.hxx" +#include "MEDFactoryClient.hxx" MEDPresentationManager_i* MEDPresentationManager_i::_instance = NULL; @@ -50,4 +51,13 @@ void MEDPresentationManager_i::MakeScalarMap(const MEDCALC::ScalarMapParameters& params) { std::cout << "MEDPresentationManager_i::MakeScalarMap: Not implemented yet\n"; + + std::size_t fieldHandlerId = params.fieldHandlerId; + MEDCALC::MEDPresentationViewMode viewMode = params.viewMode; + + std::cout << "\tfieldHandlerId: " << fieldHandlerId << std::endl; + std::cout << "\tviewMode: " << viewMode << std::endl; + + MEDCALC::FieldHandler* fieldHandler = MEDFactoryClient::getDataManager()->getFieldHandler(fieldHandlerId); + } diff --git a/src/MEDCalc/gui/CMakeLists.txt b/src/MEDCalc/gui/CMakeLists.txt index 953911727..4b5cad36d 100644 --- a/src/MEDCalc/gui/CMakeLists.txt +++ b/src/MEDCalc/gui/CMakeLists.txt @@ -26,7 +26,6 @@ ADD_SUBDIRECTORY(dialogs) SET(MEDCALCGUI_SOURCES - MEDFactoryClient.cxx XmedConsoleDriver.cxx WorkspaceController.cxx XmedDataModel.cxx -- 2.39.2