Salome HOME
Move MEDCALC tests into SSL mode
[modules/med.git] / src / MEDCalc / cmp / MEDFactoryClient.cxx
index d417e593636567831fa7e7c05aefce272fdc7e63..4a5f2ad857acf64c9cf12ab1001ed5a6219d27b1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -19,8 +19,9 @@
 
 // Author : Guillaume Boulant (EDF)
 
+#include <SALOME_KernelServices.hxx>
+
 #include "MEDFactoryClient.hxx"
-#include "SALOME_KernelServices.hxx"
 
 namespace MEDFactoryClient {
 
@@ -30,9 +31,9 @@ namespace MEDFactoryClient {
   MEDCALC::MEDFactory_ptr getFactory() {
     static MEDCALC::MEDFactory_ptr engine;
     if(CORBA::is_nil(engine)){
-      Engines::EngineComponent_var component =
-  KERNEL::getLifeCycleCORBA()->FindOrLoad_Component( "FactoryServer","MEDFactory" );
-      engine = MEDCALC::MEDFactory::_narrow(component);
+         Engines::EngineComponent_var component = 
+                 KERNEL::getLifeCycleCORBA()->FindOrLoad_Component( "FactoryServer","MEDFactory" );
+         engine = MEDCALC::MEDFactory::_narrow(component);
     }
     return engine;
   }
@@ -58,4 +59,27 @@ namespace MEDFactoryClient {
     }
     return calculator;
   }
+
+  /*!
+   * This returns a singleton (static) instance of the MED presentation manager.
+   */
+  MEDCALC::MEDPresentationManager_ptr getPresentationManager() {
+    static MEDCALC::MEDPresentationManager_ptr presentationManager;
+    if(CORBA::is_nil(presentationManager)){
+      presentationManager = getFactory()->getPresentationManager();
+    }
+    return presentationManager;
+  }
+
+  /*!
+   * This returns a singleton (static) instance of the MED commands history.
+   */
+  MEDCALC::MEDCommandsHistoryManager_ptr getCommandsHistoryManager() {
+    static MEDCALC::MEDCommandsHistoryManager_ptr commandsHistoryManager;
+    if(CORBA::is_nil(commandsHistoryManager)){
+      commandsHistoryManager = getFactory()->getCommandsHistoryManager();
+    }
+    return commandsHistoryManager;
+  }
+
 }