Salome HOME
Minor bug fix on WidgetPresentationParameters
authorabn <adrien.bruneton@cea.fr>
Tue, 5 Apr 2016 14:26:44 +0000 (16:26 +0200)
committerabn <adrien.bruneton@cea.fr>
Tue, 5 Apr 2016 14:26:44 +0000 (16:26 +0200)
src/MEDCalc/gui/WorkspaceController.cxx
src/MEDCalc/gui/dialogs/CMakeLists.txt
src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx
src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx

index e98cbe532fb7a56ab2ed3dae3f9063e47abd5d27..cfb1b506e6610479cca1f89a5c1cb5d6b9e809f4 100644 (file)
@@ -527,6 +527,7 @@ WorkspaceController::_getViewMode()
   case MEDCALC::VIEW_MODE_NEW_LAYOUT: return "MEDCALC.VIEW_MODE_NEW_LAYOUT";
   case MEDCALC::VIEW_MODE_SPLIT_VIEW: return "MEDCALC.VIEW_MODE_SPLIT_VIEW";
   }
+  return QString();
 }
 
 QString
@@ -537,6 +538,7 @@ WorkspaceController::_getColorMap()
   case MEDCALC::COLOR_MAP_BLUE_TO_RED_RAINBOW: return "MEDCALC.COLOR_MAP_BLUE_TO_RED_RAINBOW";
   case MEDCALC::COLOR_MAP_COOL_TO_WARM: return "MEDCALC.COLOR_MAP_COOL_TO_WARM";
   }
+  return QString();
 }
 
 /**
index 6fda54173c12586a6e6ff39bffa4e3077d55ba67..9964eea5b6716f84e492c309fd1a9117baaf5e27 100644 (file)
@@ -31,6 +31,7 @@ SET(MEDCALCGUI_dialogs_FILES
   DlgChangeUnderlyingMesh.hxx
   DlgInterpolateField.hxx
   DlgImageToMed.hxx
+  WidgetPresentationParameters.hxx
 )
 QT_WRAP_MOC(MEDCALCGUI_dialogs_HEADERS_MOC ${MEDCALCGUI_dialogs_FILES})
 
index dc246e42787870aa45ee81fd1cf5664014fe03cf..d314cfa355342193fd4587d2736196d590d283ef 100644 (file)
@@ -18,6 +18,7 @@
 //
 
 #include "WidgetPresentationParameters.hxx"
+#include <Basics_Utils.hxx>
 
 WidgetPresentationParameters::WidgetPresentationParameters(QWidget* parent)
   : QWidget(parent)
@@ -40,6 +41,9 @@ WidgetPresentationParameters::getViewMode() {
   else if (viewMode == tr("LAB_VIEW_MODE_SPLIT_VIEW")) {
     return MEDCALC::VIEW_MODE_SPLIT_VIEW;
   }
+  // Should not happen
+  STDLOG("Strange!! No matching view mode found - returning VIEW_MODE_REPLACE.");
+  return MEDCALC::VIEW_MODE_REPLACE;
 }
 
 std::string
@@ -82,4 +86,7 @@ WidgetPresentationParameters::getColorMap()
   else if (colorMap == tr("LAB_COOL_TO_WARM")) {
     return MEDCALC::COLOR_MAP_COOL_TO_WARM;
   }
+  // Should not happen
+  STDLOG("Strange!! No matching color map found - returning blue to red.");
+  return MEDCALC::COLOR_MAP_BLUE_TO_RED_RAINBOW;
 }
index febdd137744200d61e11df0580dd326b7b712b8c..0f88157598db1635c24623018b6d757f97df5fb3 100644 (file)
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(MEDPresentationManager)
 
+#include <QObject>
+
 class WidgetPresentationParameters : public QWidget
 {
+  Q_OBJECT
 public:
   WidgetPresentationParameters(QWidget* parent = 0);
+  virtual ~WidgetPresentationParameters() {}
 
   MEDCALC::MEDPresentationViewMode getViewMode();
   std::string getField();