]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
define parameters for scalar map presentation
authorCédric Aguerre <cedric.aguerre@edf.fr>
Wed, 22 Jul 2015 09:58:02 +0000 (11:58 +0200)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Wed, 22 Jul 2015 09:58:02 +0000 (11:58 +0200)
idl/MEDPresentationManager.idl
src/MEDOP/cmp/MEDPresentationManager_i.cxx
src/MEDOP/cmp/MEDPresentationManager_i.hxx
src/MEDOP/gui/WorkspaceController.cxx
src/MEDOP/tui/medpresentation/medpresentation.py

index 4a426f43641e20e4ca0be328fcbf79f0598fdad9..e316b2ec3e6bcc2d91ee61be67601edb46f237a9 100644 (file)
 module MEDOP
 {
 
+  enum MEDPresentationViewMode {
+    VIEW_MODE_OVERLAP,
+    VIEW_MODE_REPLACE,
+    VIEW_MODE_NEW_LAYOUT,
+    VIEW_MODE_SPLIT_VIEW
+  };
+
+  struct ScalarMapParameters {
+    long fieldHandlerId;
+    MEDPresentationViewMode viewMode;
+  };
+
   interface MEDPresentationManager : SALOME::GenericObj
   {
 
-    void MakeScalarMap(in long fieldHandlerId, in string viewMode);
+    void MakeScalarMap(in ScalarMapParameters params);
 
   };
 
index ad94d0c49c4de615dc7aacdf52cff47b731a9157..b37e616ad6617d364b2a78551eb3f237abf8d984 100644 (file)
@@ -18,8 +18,6 @@
 //
 
 #include "MEDPresentationManager_i.hxx"
-#include "SALOME_KernelServices.hxx"
-#include "Basics_Utils.hxx"
 
 MEDPresentationManager_i* MEDPresentationManager_i::_instance = NULL;
 
@@ -41,8 +39,8 @@ MEDPresentationManager_i::~MEDPresentationManager_i()
 #include <iostream>
 
 void
-MEDPresentationManager_i::MakeScalarMap(CORBA::Long fieldHandlerId, const char* viewMode)
+MEDPresentationManager_i::MakeScalarMap(const MEDOP::ScalarMapParameters& params)
 {
-  //throw KERNEL::createSalomeException("Not implemented yet");
+  std::cout << "View mode: " << params.viewMode << std::endl;
   std::cout << "MEDPresentationManager_i::MakeScalarMap: Not implemented yet\n";
 }
index c6d199808aeac322d4d9be5f1e4e76d0b40bca07..b52cf558fa7f2772a516c3535758e35c5125ff86 100644 (file)
@@ -35,7 +35,7 @@ class MEDOP_EXPORT MEDPresentationManager_i: public POA_MEDOP::MEDPresentationMa
 
   static MEDPresentationManager_i* getInstance();
 
-  void MakeScalarMap(CORBA::Long fieldHandlerId, const char*);
+  void MakeScalarMap(const MEDOP::ScalarMapParameters&);
 
  private:
 
index 6b2e5cc3ff17589ab83c52ffd2b187889d8fb085..e5ef41345887ad55fe26f24e0bad7064034aadbe 100644 (file)
@@ -488,9 +488,14 @@ void WorkspaceController::processDatasourceEvent(const DatasourceEvent * event)
   else if ( event->eventtype == DatasourceEvent::EVENT_VIEW_OBJECT_SCALAR_MAP ) {
     QStringList commands;
     commands += QString("from medpresentation import MakeScalarMap");
-    QString viewMode = "view mode"; // :TODO: change this (get value from dedicated dialog)
+    commands += QString("import MEDOP");
+
+#define stringify( name ) # name
+    QString viewMode = stringify(MEDOP::VIEW_MODE_NEW_LAYOUT); // :TODO: change this (get value from dedicated dialog)
+    viewMode.replace("::", ".");
+
     MEDOP::FieldHandler* fieldHandler = dataObject->getFieldHandler();
-    commands += QString("MakeScalarMap(get(%1), '%2')").arg(fieldHandler->id).arg(viewMode);
+    commands += QString("MakeScalarMap(get(%1), %2)").arg(fieldHandler->id).arg(viewMode);
     _consoleDriver->exec(commands);
   }
   else {
index dfc977ef573d58238eade9884f2acbd794079089..7e51ad0a0603315fe0da647bef8cf39791f3a1b2 100644 (file)
@@ -28,12 +28,15 @@ def LoadDataSource(filename):
   notifyGui_addsource(filename)
 #
 
-def MakeScalarMap(proxy, viewMode):
+def MakeScalarMap(proxy, viewMode=MEDOP.VIEW_MODE_REPLACE):
   # Create the presentation instance in CORBA engine
   # The engine in turn creates the ParaView pipeline elements
 
   print "In MakeScalarMap (Python)"
-  __manager.MakeScalarMap(proxy.id, viewMode)
 
+  print "viewMode:", viewMode, " [", type(viewMode), "]"
+
+  params = MEDOP.ScalarMapParameters(proxy.id, viewMode);
+  __manager.MakeScalarMap(params)
 
 #