Salome HOME
[MEDCalc] Add dock widget for presentation parameters
authorCédric Aguerre <cedric.aguerre@edf.fr>
Tue, 23 Feb 2016 14:14:03 +0000 (15:14 +0100)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Tue, 23 Feb 2016 14:14:03 +0000 (15:14 +0100)
src/MEDCalc/gui/CMakeLists.txt
src/MEDCalc/gui/DatasourceController.cxx
src/MEDCalc/gui/MED_msg_en.ts
src/MEDCalc/gui/MED_msg_fr.ts
src/MEDCalc/gui/PresentationController.cxx
src/MEDCalc/gui/PresentationController.hxx
src/MEDCalc/gui/WorkspaceController.cxx
src/MEDCalc/gui/dialogs/CMakeLists.txt
src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx [new file with mode: 0644]
src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx [new file with mode: 0644]
src/MEDCalc/gui/dialogs/WidgetPresentationParameters.ui [new file with mode: 0644]

index 72e839cf49cb3e70b8bb409141f4116b19ef203e..62cb36a167e0ea8fe6ed6d3805f30bd081c3334e 100644 (file)
@@ -24,18 +24,14 @@ INCLUDE(UseQtExt)
 ADD_SUBDIRECTORY(dialogs)
 
 
-SET(MEDCALCGUI_SOURCES
-  XmedConsoleDriver.cxx
-  WorkspaceController.cxx
-  XmedDataModel.cxx
-  MEDEventListener_i.cxx
-  MEDModule.cxx
-  DatasourceController.cxx
-  PresentationController.cxx
-  factory.cxx
-)
+FILE(GLOB MEDCALCGUI_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx")
 
-SET(MEDCALCGUI_HEADERS MEDModule.hxx MEDEventListener_i.hxx WorkspaceController.hxx DatasourceController.hxx PresentationController.hxx)
+SET(MEDCALCGUI_HEADERS
+  MEDModule.hxx
+  MEDEventListener_i.hxx
+  WorkspaceController.hxx
+  DatasourceController.hxx
+  PresentationController.hxx)
 QT_WRAP_MOC(MEDCALCGUI_HEADERS_MOC ${MEDCALCGUI_HEADERS})
 
 
index f7a96890bc8eca6c8b804a516451c028bf24c36c..5a14447196786ab0daacc2fe2fd20815eb6d6b0a 100644 (file)
@@ -67,7 +67,6 @@ DatasourceController::DatasourceController(MEDModule* salomeModule)
   _dlgInterpolateField = new DlgInterpolateField(_studyEditor);
   connect(_dlgInterpolateField,SIGNAL(inputValidated()),
           this, SLOT(OnInterpolateFieldInputValidated()));
-
 }
 
 DatasourceController::~DatasourceController() {
index 092e8caa5f36b11d75273257882a1a3ad63f0b9a..251b402abcbb8abf615f83a0d1601c4243076881 100644 (file)
@@ -4,36 +4,8 @@
   <context>
     <name>PresentationController</name>
     <message>
-      <source>LAB_VIEW_MODE_REPLACE</source>
-      <translation>Replace</translation>
-    </message>
-    <message>
-      <source>TIP_VIEW_MODE_REPLACE</source>
-      <translation>Replace</translation>
-    </message>
-    <message>
-      <source>LAB_VIEW_MODE_OVERLAP</source>
-      <translation>Overlap</translation>
-    </message>
-    <message>
-      <source>TIP_VIEW_MODE_OVERLAP</source>
-      <translation>Overlap</translation>
-    </message>
-    <message>
-      <source>LAB_VIEW_MODE_NEW_LAYOUT</source>
-      <translation>New layout</translation>
-    </message>
-    <message>
-      <source>TIP_VIEW_MODE_NEW_LAYOUT</source>
-      <translation>New layout</translation>
-    </message>
-    <message>
-      <source>LAB_VIEW_MODE_SPLIT_VIEW</source>
-      <translation>Split</translation>
-    </message>
-    <message>
-      <source>TIP_VIEW_MODE_SPLIT_VIEW</source>
-      <translation>Split</translation>
+      <source>TITLE_PRESENTATION_PARAMETERS</source>
+      <translation>Presentation parameters</translation>
     </message>
     <message>
       <source>LAB_PRESENTATION_SCALAR_MAP</source>
       <translation>This field is already defined in the workspace</translation>
     </message>
   </context>
+  <context>
+    <name>WidgetPresentationParameters</name>
+    <message>
+      <source>LAB_FIELD</source>
+      <translation>Field:</translation>
+    </message>
+    <message>
+      <source>LAB_EUCLIDEAN_NORM</source>
+      <translation>Euclidean norm</translation>
+    </message>
+    <message>
+      <source>LAB_SCALARBAR</source>
+      <translation>Scalar bar:</translation>
+    </message>
+    <message>
+      <source>LAB_RANGE</source>
+      <translation>Range:</translation>
+    </message>
+    <message>
+      <source>LAB_ALL_TIMESTEPS</source>
+      <translation>All timesteps</translation>
+    </message>
+    <message>
+      <source>LAB_ONE_TIMESTEP</source>
+      <translation>Selected timestep</translation>
+    </message>
+    <message>
+      <source>LAB_USER_RANGE</source>
+      <translation>User-specified</translation>
+    </message>
+    <message>
+      <source>LAB_TIMESTEP</source>
+      <translation>Timestep:</translation>
+    </message>
+    <message>
+      <source>LAB_MIN_VALUE</source>
+      <translation>Min value:</translation>
+    </message>
+    <message>
+      <source>LAB_MAX_VALUE</source>
+      <translation>Max value:</translation>
+    </message>
+    <message>
+      <source>LAB_COLOR_MAP</source>
+      <translation>Color map:</translation>
+    </message>
+    <message>
+      <source>LAB_BLUE_TO_RED</source>
+      <translation>Blue to red rainbow</translation>
+    </message>
+    <message>
+      <source>LAB_COOL_TO_WARM</source>
+      <translation>Cool to warm</translation>
+    </message>
+  </context>
   <context>
     <name>DlgAlias</name>
     <message>
       <source>FILE_FILTER_ALL</source>
       <translation>All files (*.*)</translation>
     </message>
+    <message>
+      <source>LAB_VIEW_MODE</source>
+      <translation>View mode:</translation>
+    </message>
+    <message>
+      <source>LAB_VIEW_MODE_REPLACE</source>
+      <translation>Replace</translation>
+    </message>
+    <message>
+      <source>LAB_VIEW_MODE_OVERLAP</source>
+      <translation>Overlap</translation>
+    </message>
+    <message>
+      <source>LAB_VIEW_MODE_NEW_LAYOUT</source>
+      <translation>New layout</translation>
+    </message>
+    <message>
+      <source>LAB_VIEW_MODE_SPLIT_VIEW</source>
+      <translation>Split</translation>
+    </message>
   </context>
 </TS>
index c892ca55d958a4ceb38f9e7cf911bc521fbf231f..d339c08b96b34df07b19a31628e8a37533eab070 100644 (file)
@@ -4,36 +4,8 @@
   <context>
     <name>PresentationController</name>
     <message>
-      <source>LAB_VIEW_MODE_REPLACE</source>
-      <translation>Remplacer</translation>
-    </message>
-    <message>
-      <source>TIP_VIEW_MODE_REPLACE</source>
-      <translation>Remplacer</translation>
-    </message>
-    <message>
-      <source>LAB_VIEW_MODE_OVERLAP</source>
-      <translation>Superposer</translation>
-    </message>
-    <message>
-      <source>TIP_VIEW_MODE_OVERLAP</source>
-      <translation>Superposer</translation>
-    </message>
-    <message>
-      <source>LAB_VIEW_MODE_NEW_LAYOUT</source>
-      <translation>Nouvel onglet</translation>
-    </message>
-    <message>
-      <source>TIP_VIEW_MODE_NEW_LAYOUT</source>
-      <translation>Nouvel onglet</translation>
-    </message>
-    <message>
-      <source>LAB_VIEW_MODE_SPLIT_VIEW</source>
-      <translation>Scinder</translation>
-    </message>
-    <message>
-      <source>TIP_VIEW_MODE_SPLIT_VIEW</source>
-      <translation>Scinder</translation>
+      <source>TITLE_PRESENTATION_PARAMETERS</source>
+      <translation>Paramètres de presentation</translation>
     </message>
     <message>
       <source>LAB_PRESENTATION_SCALAR_MAP</source>
   </context>
   <context>
     <name>DatasourceController</name>
-    <message>
-      <source>MEDPresentationScalarMap</source>
-      <translation>Carte scalaire</translation>
-    </message>
     <message>
       <location filename="MEDCALC/gui/DatasourceController.cxx" line="45"/>
       <source>LAB_ADD_DATA_SOURCE</source>
       <translation>Ce champ est déjà défini dans l'espace de travail</translation>
     </message>
   </context>
+  <context>
+    <name>WidgetPresentationParameters</name>
+    <message>
+      <source>LAB_FIELD</source>
+      <translation>Champ :</translation>
+    </message>
+    <message>
+      <source>LAB_EUCLIDEAN_NORM</source>
+      <translation>Norme euclidienne</translation>
+    </message>
+    <message>
+      <source>LAB_SCALARBAR</source>
+      <translation>Echelle de valeurs :</translation>
+    </message>
+    <message>
+      <source>LAB_RANGE</source>
+      <translation>Intervalle :</translation>
+    </message>
+    <message>
+      <source>LAB_ALL_TIMESTEPS</source>
+      <translation>Tous les pas de temps</translation>
+    </message>
+    <message>
+      <source>LAB_ONE_TIMESTEP</source>
+      <translation>Pas de temps sélectionné</translation>
+    </message>
+    <message>
+      <source>LAB_USER_RANGE</source>
+      <translation>Personnalisé :</translation>
+    </message>
+    <message>
+      <source>LAB_TIMESTEP</source>
+      <translation>Pas de temps :</translation>
+    </message>
+    <message>
+      <source>LAB_MIN_VALUE</source>
+      <translation>Valeur min :</translation>
+    </message>
+    <message>
+      <source>LAB_MAX_VALUE</source>
+      <translation>Valeur max :</translation>
+    </message>
+    <message>
+      <source>LAB_COLOR_MAP</source>
+      <translation>Table de couleurs :</translation>
+    </message>
+    <message>
+      <source>LAB_BLUE_TO_RED</source>
+      <translation>Arc-en-ciel blue vers rouge</translation>
+    </message>
+    <message>
+      <source>LAB_COOL_TO_WARM</source>
+      <translation>Froid vers chaud</translation>
+    </message>
+  </context>
   <context>
     <name>DlgAlias</name>
     <message>
       <source>FILE_FILTER_ALL</source>
       <translation>Tous les fichiers (*.*)</translation>
     </message>
+    <message>
+      <source>LAB_VIEW_MODE</source>
+      <translation>Mode de rendu :</translation>
+    </message>
+    <message>
+      <source>LAB_VIEW_MODE_REPLACE</source>
+      <translation>Remplacer</translation>
+    </message>
+    <message>
+      <source>LAB_VIEW_MODE_OVERLAP</source>
+      <translation>Superposer</translation>
+    </message>
+    <message>
+      <source>LAB_VIEW_MODE_NEW_LAYOUT</source>
+      <translation>Nouvel onglet</translation>
+    </message>
+    <message>
+      <source>LAB_VIEW_MODE_SPLIT_VIEW</source>
+      <translation>Scinder</translation>
+    </message>
   </context>
 </TS>
index bb432b56ba0c3ddfd0f1b27f6b2f82c44355cb0c..bd2b83058a3f70aed3e794b612cf050852534493 100644 (file)
@@ -22,6 +22,7 @@
 #include "MEDModule.hxx"
 #include "Basics_Utils.hxx"
 #include "QtxActionGroup.h"
+#include "QtxActionToolMgr.h"
 #include "MEDFactoryClient.hxx"
 
 #include <SalomeApp_Application.h>
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 #include <QMessageBox>
-
-static const int OPTIONS_VIEW_MODE_ID = 943;
-static const int OPTIONS_VIEW_MODE_REPLACE_ID = 944;
-static const int OPTIONS_VIEW_MODE_OVERLAP_ID = 945;
-static const int OPTIONS_VIEW_MODE_NEW_LAYOUT_ID = 946;
-static const int OPTIONS_VIEW_MODE_SPLIT_VIEW_ID = 947;
+#include <QDockWidget>
 
 PresentationController::PresentationController(MEDModule* salomeModule)
 {
   STDLOG("Creating a PresentationController");
   _salomeModule = salomeModule;
   _studyEditor = _salomeModule->getStudyEditor();
+
+  _widgetPresentationParameters = new WidgetPresentationParameters();
+
+  QMainWindow* parent = salomeModule->getApp()->desktop();
+  QDockWidget *dockWidget = new QDockWidget(parent);
+  dockWidget->setVisible(false);
+  dockWidget->setWindowTitle(tr("TITLE_PRESENTATION_PARAMETERS"));
+  dockWidget->setObjectName(tr("TITLE_PRESENTATION_PARAMETERS"));
+  dockWidget->setFeatures(QDockWidget::AllDockWidgetFeatures);
+  dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+  dockWidget->setWidget(_widgetPresentationParameters);
+  parent->addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
+  dockWidget->show();
 }
 
 PresentationController::~PresentationController()
@@ -75,49 +84,17 @@ void
 PresentationController::createActions()
 {
   STDLOG("Creating PresentationController actions");
-  int toolbarId = _salomeModule->createTool("View Mode", "PresentationToolbar");
 
+  int presentationToolbarId = _salomeModule->createTool("View Mode", "PresentationToolbar");
   int presentationMenuId = _salomeModule->createMenu(tr("MENU_PRESENTATIONS"), -1, 1);
 
-  // View Mode
-  QtxActionGroup* ag = _salomeModule->createActionGroup(OPTIONS_VIEW_MODE_ID, true);
-  ag->setText("View mode");
-  ag->setUsesDropDown(true);
-
-  QString label   = tr("LAB_VIEW_MODE_REPLACE");
-  QString tooltip = tr("TIP_VIEW_MODE_REPLACE");
-  QAction* a = _salomeModule->createAction(OPTIONS_VIEW_MODE_REPLACE_ID,label,QIcon(),label,tooltip,0);
-  a->setCheckable(true);
-  a->setChecked(true);
-  ag->add(a);
-
-  label   = tr("LAB_VIEW_MODE_OVERLAP");
-  tooltip = tr("TIP_VIEW_MODE_OVERLAP");
-  a = _salomeModule->createAction(OPTIONS_VIEW_MODE_OVERLAP_ID,label,QIcon(),label,tooltip,0);
-  a->setCheckable(true);
-  ag->add(a);
-
-  label   = tr("LAB_VIEW_MODE_NEW_LAYOUT");
-  tooltip = tr("TIP_VIEW_MODE_NEW_LAYOUT");
-  a = _salomeModule->createAction(OPTIONS_VIEW_MODE_NEW_LAYOUT_ID,label,QIcon(),label,tooltip,0);
-  a->setCheckable(true);
-  ag->add(a);
-
-  label   = tr("LAB_VIEW_MODE_SPLIT_VIEW");
-  tooltip = tr("TIP_VIEW_MODE_SPLIT_VIEW");
-  a = _salomeModule->createAction(OPTIONS_VIEW_MODE_SPLIT_VIEW_ID,label,QIcon(),label,tooltip,0);
-  a->setCheckable(true);
-  ag->add(a);
-
-  _salomeModule->createTool(OPTIONS_VIEW_MODE_ID, toolbarId);
-
   // Presentations
-  label   = tr("LAB_PRESENTATION_SCALAR_MAP");
-  tooltip = tr("TIP_PRESENTATION_SCALAR_MAP");
+  QString label   = tr("LAB_PRESENTATION_SCALAR_MAP");
+  QString tooltip = tr("TIP_PRESENTATION_SCALAR_MAP");
   QString icon = tr(_getIconName("ICO_PRESENTATION_SCALAR_MAP").c_str());
   int actionId;
   actionId = _salomeModule->createStandardAction(label,this, SLOT(OnVisualizeScalarMap()),icon,tooltip);
-  _salomeModule->createTool(actionId, toolbarId);
+  _salomeModule->createTool(actionId, presentationToolbarId);
   _salomeModule->action(actionId)->setIconVisibleInMenu(true);
   _salomeModule->createMenu(actionId, presentationMenuId);
 
@@ -125,7 +102,7 @@ PresentationController::createActions()
   tooltip = tr("TIP_PRESENTATION_CONTOUR");
   icon    = tr(_getIconName("ICO_PRESENTATION_CONTOUR").c_str());
   actionId = _salomeModule->createStandardAction(label,this, SLOT(OnVisualizeContour()),icon,tooltip);
-  _salomeModule->createTool(actionId, toolbarId);
+  _salomeModule->createTool(actionId, presentationToolbarId);
   _salomeModule->action(actionId)->setIconVisibleInMenu(true);
   _salomeModule->createMenu(actionId, presentationMenuId);
 
@@ -133,7 +110,7 @@ PresentationController::createActions()
   tooltip = tr("TIP_PRESENTATION_VECTOR_FIELD");
   icon    = tr(_getIconName("ICO_PRESENTATION_VECTOR_FIELD").c_str());
   actionId = _salomeModule->createStandardAction(label,this, SLOT(OnVisualizeVectorField()),icon,tooltip);
-  _salomeModule->createTool(actionId, toolbarId);
+  _salomeModule->createTool(actionId, presentationToolbarId);
   _salomeModule->action(actionId)->setIconVisibleInMenu(true);
   _salomeModule->createMenu(actionId, presentationMenuId);
 
@@ -141,7 +118,7 @@ PresentationController::createActions()
   tooltip = tr("TIP_PRESENTATION_SLICES");
   icon    = tr(_getIconName("ICO_PRESENTATION_SLICES").c_str());
   actionId = _salomeModule->createStandardAction(label,this, SLOT(OnVisualizeSlices()),icon,tooltip);
-  _salomeModule->createTool(actionId, toolbarId);
+  _salomeModule->createTool(actionId, presentationToolbarId);
   _salomeModule->action(actionId)->setIconVisibleInMenu(true);
   _salomeModule->createMenu(actionId, presentationMenuId);
 
@@ -149,7 +126,7 @@ PresentationController::createActions()
   tooltip = tr("TIP_PRESENTATION_DEFLECTION_SHAPE");
   icon    = tr(_getIconName("ICO_PRESENTATION_DEFLECTION_SHAPE").c_str());
   actionId = _salomeModule->createStandardAction(label,this, SLOT(OnVisualizeDeflectionShape()),icon,tooltip);
-  _salomeModule->createTool(actionId, toolbarId);
+  _salomeModule->createTool(actionId, presentationToolbarId);
   _salomeModule->action(actionId)->setIconVisibleInMenu(true);
   _salomeModule->createMenu(actionId, presentationMenuId);
 
@@ -157,7 +134,7 @@ PresentationController::createActions()
   tooltip = tr("TIP_PRESENTATION_POINT_SPRITE");
   icon    = tr(_getIconName("ICO_PRESENTATION_POINT_SPRITE").c_str());
   actionId = _salomeModule->createStandardAction(label,this, SLOT(OnVisualizePointSprite()),icon,tooltip);
-  _salomeModule->createTool(actionId, toolbarId);
+  _salomeModule->createTool(actionId, presentationToolbarId);
   _salomeModule->action(actionId)->setIconVisibleInMenu(true);
   _salomeModule->createMenu(actionId, presentationMenuId);
 }
@@ -165,18 +142,7 @@ PresentationController::createActions()
 MEDCALC::MEDPresentationViewMode
 PresentationController::getSelectedViewMode()
 {
-  if (_salomeModule->action(OPTIONS_VIEW_MODE_REPLACE_ID)->isChecked()) {
-    return MEDCALC::VIEW_MODE_REPLACE;
-  }
-  else if (_salomeModule->action(OPTIONS_VIEW_MODE_OVERLAP_ID)->isChecked()) {
-    return MEDCALC::VIEW_MODE_OVERLAP;
-  }
-  else if (_salomeModule->action(OPTIONS_VIEW_MODE_NEW_LAYOUT_ID)->isChecked()) {
-    return MEDCALC::VIEW_MODE_NEW_LAYOUT;
-  }
-  else if (_salomeModule->action(OPTIONS_VIEW_MODE_SPLIT_VIEW_ID)->isChecked()) {
-    return MEDCALC::VIEW_MODE_SPLIT_VIEW;
-  }
+  return _widgetPresentationParameters->getViewMode();
 }
 
 void
@@ -212,7 +178,7 @@ PresentationController::visualize(PresentationEvent::EventType eventType)
     XmedDataObject* dataObject = new XmedDataObject();
     dataObject->setFieldHandler(*fieldHandler);
     event->objectdata = dataObject;
-    emit presentationSignal(event);
+    emit presentationSignal(event); // --> WorkspaceController::processPresentationEvent
   }
 }
 
index d58b926d8cd2638f3d6f9df903c34cf15935d14c..c4a1dacc7be6c4686e1749456d6b5e837849f73c 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "XmedDataModel.hxx"
 #include <SALOME_AppStudyEditor.hxx>
+#include "WidgetPresentationParameters.hxx"
 
 typedef struct {
   enum EventType {
@@ -78,7 +79,7 @@ private:
 private:
   MEDModule* _salomeModule;
   SALOME_AppStudyEditor* _studyEditor; // borrowed to MEDModule
-
+  WidgetPresentationParameters* _widgetPresentationParameters;
 };
 
 #endif /* PRESENTATION_CONTROLLER_HXX */
index 3137c82d2a84ecfd3a11c2e6f3dec1da05c07868..5458ecb727f5f8bd8360ae13ca0771ad5f630bea 100644 (file)
@@ -40,7 +40,6 @@
  * and containing a tree view for rendering a hierarchical data
  * model. This datamodel contains the objects used in the workspace.
  */
-//WorkspaceController::WorkspaceController(StandardApp_Module* salomeModule)
 WorkspaceController::WorkspaceController(MEDModule* salomeModule)
   : TreeGuiManager(salomeModule->getApp(), "Workspace")
 {
@@ -100,7 +99,7 @@ WorkspaceController::WorkspaceController(MEDModule* salomeModule)
 }
 
 WorkspaceController::~WorkspaceController() {
-  std::cout << "WorkspaceController::~WorkspaceController()\n";
+  STDLOG("WorkspaceController::~WorkspaceController()");
   MEDEventListener_i::release();
 }
 
@@ -118,14 +117,12 @@ void WorkspaceController::createActions() {
   QString tooltip = tr("TIP_SAVE_WORKSPACE");
   QString icon    = tr("ICO_WORKSPACE_SAVE");
   int actionId = _salomeModule->createStandardAction(label,this,SLOT(OnSaveWorkspace()),icon,tooltip);
-  //_salomeModule->addActionInToolbar(actionId);
   _salomeModule->createTool(actionId, toolbarId);
 
   label   = tr("LAB_CLEAN_WORKSPACE");
   tooltip = tr("TIP_CLEAN_WORKSPACE");
   icon    = tr("ICO_WORKSPACE_CLEAN");
   actionId = _salomeModule->createStandardAction(label,this,SLOT(OnCleanWorkspace()),icon,tooltip);
-//_salomeModule->addActionInToolbar(actionId);
   _salomeModule->createTool(actionId, toolbarId);
 }
 
@@ -551,8 +548,12 @@ void WorkspaceController::processPresentationEvent(const PresentationEvent* even
 
   XmedDataObject* dataObject = event->objectdata;
 
+  // --> Send commands to SALOME Python console
   if ( event->eventtype == PresentationEvent::EVENT_VIEW_OBJECT_SCALAR_MAP ) {
     QString viewMode = _getViewMode();
+    //QString displayedInfo = ; // from PresentationController combobox
+    //QString scalarBarRange = ; // from PresentationController spinbox
+    //QString colorMap = ; // from PresentationController combobox
     MEDCALC::FieldHandler* fieldHandler = dataObject->getFieldHandler();
     QStringList commands;
     commands += QString("medcalc.MakeScalarMap(accessField(%1), %2)").arg(fieldHandler->id).arg(viewMode);
index 732d72d0f2f978d30b466bb257fde94b6fafd85d..0367a6c5c729cb6abfcbb919a0cc64d13e071339 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2015  CEA/DEN, EDF R&D
+# Copyright (C) 2012-2016  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
@@ -21,14 +21,7 @@ ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 
 INCLUDE(UseQtExt)
 
-SET(MEDCALCGUI_dialogs_FORMS
-  GenericDialog.ui
-  DlgAlias.ui
-  DlgUseInWorkspace.ui
-  DlgChangeUnderlyingMesh.ui
-  DlgInterpolateField.ui
-  DlgImageToMed.ui
-)
+FILE(GLOB MEDCALCGUI_dialogs_FORMS "${CMAKE_CURRENT_SOURCE_DIR}/*.ui")
 QT_WRAP_UIC(MEDCALCGUI_dialogs_FORMS_HEADERS ${MEDCALCGUI_dialogs_FORMS})
 
 SET(MEDCALCGUI_dialogs_FILES
@@ -47,6 +40,7 @@ INCLUDE_DIRECTORIES(
   ${CMAKE_CURRENT_BINARY_DIR}
   ${GUI_INCLUDE_DIRS}
   ${CMAKE_CURRENT_SOURCE_DIR}/..
+  ${PROJECT_BINARY_DIR}/idl
 )
 
 SET(MEDCALCGUI_dialogs_SOURCES
@@ -56,6 +50,7 @@ SET(MEDCALCGUI_dialogs_SOURCES
   DlgChangeUnderlyingMesh.cxx
   DlgInterpolateField.cxx
   DlgImageToMed.cxx
+  WidgetPresentationParameters.cxx
 )
 
 ADD_LIBRARY(MEDCALCGUI_dialogs SHARED ${MEDCALCGUI_dialogs_SOURCES} ${MEDCALCGUI_dialogs_HEADERS_MOC} ${MEDCALCGUI_dialogs_FORMS_HEADERS})
diff --git a/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx b/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx
new file mode 100644 (file)
index 0000000..08823ca
--- /dev/null
@@ -0,0 +1,60 @@
+#include "WidgetPresentationParameters.hxx"
+
+WidgetPresentationParameters::WidgetPresentationParameters(QWidget* parent)
+  : QWidget(parent)
+{
+  ui.setupUi(this); // To be done first
+}
+
+MEDCALC::MEDPresentationViewMode
+WidgetPresentationParameters::getViewMode() {
+  QString viewMode = this->ui.comboBoxViewMode->currentText();
+  if (viewMode == tr("LAB_VIEW_MODE_REPLACE")) {
+    return MEDCALC::VIEW_MODE_REPLACE;
+  }
+  else if (viewMode == tr("LAB_VIEW_MODE_OVERLAP")) {
+    return MEDCALC::VIEW_MODE_OVERLAP;
+  }
+  else if (viewMode == tr("LAB_VIEW_MODE_NEW_LAYOUT")) {
+    return MEDCALC::VIEW_MODE_NEW_LAYOUT;
+  }
+  else if (viewMode == tr("LAB_VIEW_MODE_SPLIT_VIEW")) {
+    return MEDCALC::VIEW_MODE_SPLIT_VIEW;
+  }
+}
+
+std::string
+WidgetPresentationParameters::getField()
+{
+  return this->ui.comboBoxField->currentText().toStdString();
+}
+
+std::string
+WidgetPresentationParameters::getScalarBarRange()
+{
+  return this->ui.comboBoxScalarBarRange->currentText().toStdString();
+}
+
+double
+WidgetPresentationParameters::getScalarBarTimestep()
+{
+  return this->ui.doubleSpinBoxTimeStep->value();
+}
+
+double
+WidgetPresentationParameters::getScalarBarMinVal()
+{
+  return this->ui.doubleSpinBoxMinVal->value();
+}
+
+double
+WidgetPresentationParameters::getScalarBarMaxVal()
+{
+  return this->ui.doubleSpinBoxMaxVal->value();
+}
+
+std::string
+WidgetPresentationParameters::getColorMap()
+{
+  return this->ui.comboBoxColorMap->currentText().toStdString();
+}
diff --git a/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx b/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx
new file mode 100644 (file)
index 0000000..a8a9714
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef WIDGET_PRESENTATION_PARAMETERS_HXX
+#define WIDGET_PRESENTATION_PARAMETERS_HXX
+
+#include "MEDCALCGUIdialogs.hxx"
+
+#include <QtGui>
+#include "ui_WidgetPresentationParameters.h"
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(MEDPresentationManager)
+
+class WidgetPresentationParameters : public QWidget
+{
+public:
+  WidgetPresentationParameters(QWidget* parent = 0);
+
+  MEDCALC::MEDPresentationViewMode getViewMode();
+  std::string getField();
+  std::string getScalarBarRange();
+  double getScalarBarTimestep();
+  double getScalarBarMinVal();
+  double getScalarBarMaxVal();
+  std::string getColorMap();
+
+ private:
+  Ui_WidgetPresentationParameters ui; // instance of the class defined in ui_WidgetPresentationParameters.h
+};
+
+
+#endif
diff --git a/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.ui b/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.ui
new file mode 100644 (file)
index 0000000..0088263
--- /dev/null
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>WidgetPresentationParameters</class>
+ <widget class="QWidget" name="WidgetPresentationParameters">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>404</width>
+    <height>230</height>
+   </rect>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>300</width>
+    <height>200</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="1" column="0">
+    <widget class="QLabel" name="label">
+     <property name="text">
+      <string>LAB_FIELD</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="QComboBox" name="comboBoxField">
+     <item>
+      <property name="text">
+       <string>LAB_EUCLIDEAN_NORM</string>
+      </property>
+     </item>
+    </widget>
+   </item>
+   <item row="5" column="0">
+    <widget class="QLabel" name="labelTimeStep">
+     <property name="enabled">
+      <bool>false</bool>
+     </property>
+     <property name="text">
+      <string>LAB_TIMESTEP</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="1">
+    <widget class="QDoubleSpinBox" name="doubleSpinBoxTimeStep">
+     <property name="enabled">
+      <bool>false</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="0">
+    <widget class="QLabel" name="labelMinVal">
+     <property name="enabled">
+      <bool>false</bool>
+     </property>
+     <property name="text">
+      <string>LAB_MIN_VALUE</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="1">
+    <widget class="QDoubleSpinBox" name="doubleSpinBoxMinVal">
+     <property name="enabled">
+      <bool>false</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="7" column="0">
+    <widget class="QLabel" name="labelMaxVal">
+     <property name="enabled">
+      <bool>false</bool>
+     </property>
+     <property name="text">
+      <string>LAB_MAX_VALUE</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+    </widget>
+   </item>
+   <item row="7" column="1">
+    <widget class="QDoubleSpinBox" name="doubleSpinBoxMaxVal">
+     <property name="enabled">
+      <bool>false</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="8" column="0">
+    <widget class="QLabel" name="label_3">
+     <property name="text">
+      <string>LAB_COLOR_MAP</string>
+     </property>
+    </widget>
+   </item>
+   <item row="8" column="1">
+    <widget class="QComboBox" name="comboBoxColorMap">
+     <item>
+      <property name="text">
+       <string>LAB_BLUE_TO_RED</string>
+      </property>
+     </item>
+     <item>
+      <property name="text">
+       <string>LAB_COOL_TO_WARM</string>
+      </property>
+     </item>
+    </widget>
+   </item>
+   <item row="0" column="0">
+    <widget class="QLabel" name="label_4">
+     <property name="text">
+      <string>LAB_VIEW_MODE</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QComboBox" name="comboBoxViewMode">
+     <item>
+      <property name="text">
+       <string>LAB_VIEW_MODE_REPLACE</string>
+      </property>
+     </item>
+     <item>
+      <property name="text">
+       <string>LAB_VIEW_MODE_OVERLAP</string>
+      </property>
+     </item>
+     <item>
+      <property name="text">
+       <string>LAB_VIEW_MODE_NEW_LAYOUT</string>
+      </property>
+     </item>
+     <item>
+      <property name="text">
+       <string>LAB_VIEW_MODE_SPLIT_VIEW</string>
+      </property>
+     </item>
+    </widget>
+   </item>
+   <item row="4" column="1">
+    <widget class="QComboBox" name="comboBoxScalarBarRange">
+     <property name="enabled">
+      <bool>true</bool>
+     </property>
+     <item>
+      <property name="text">
+       <string>LAB_ALL_TIMESTEPS</string>
+      </property>
+     </item>
+     <item>
+      <property name="text">
+       <string>LAB_ONE_TIMESTEP</string>
+      </property>
+     </item>
+     <item>
+      <property name="text">
+       <string>LAB_USER_RANGE</string>
+      </property>
+     </item>
+    </widget>
+   </item>
+   <item row="2" column="0">
+    <widget class="QLabel" name="label_2">
+     <property name="text">
+      <string>LAB_SCALARBAR</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="0">
+    <widget class="QLabel" name="label_5">
+     <property name="enabled">
+      <bool>true</bool>
+     </property>
+     <property name="text">
+      <string>LAB_RANGE</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>