Salome HOME
[MEDCalc] Manage color maps
[modules/med.git] / src / MEDCalc / gui / dialogs / WidgetPresentationParameters.cxx
1 #include "WidgetPresentationParameters.hxx"
2
3 WidgetPresentationParameters::WidgetPresentationParameters(QWidget* parent)
4   : QWidget(parent)
5 {
6   ui.setupUi(this); // To be done first
7 }
8
9 MEDCALC::MEDPresentationViewMode
10 WidgetPresentationParameters::getViewMode() {
11   QString viewMode = this->ui.comboBoxViewMode->currentText();
12   if (viewMode == tr("LAB_VIEW_MODE_REPLACE")) {
13     return MEDCALC::VIEW_MODE_REPLACE;
14   }
15   else if (viewMode == tr("LAB_VIEW_MODE_OVERLAP")) {
16     return MEDCALC::VIEW_MODE_OVERLAP;
17   }
18   else if (viewMode == tr("LAB_VIEW_MODE_NEW_LAYOUT")) {
19     return MEDCALC::VIEW_MODE_NEW_LAYOUT;
20   }
21   else if (viewMode == tr("LAB_VIEW_MODE_SPLIT_VIEW")) {
22     return MEDCALC::VIEW_MODE_SPLIT_VIEW;
23   }
24 }
25
26 std::string
27 WidgetPresentationParameters::getField()
28 {
29   return this->ui.comboBoxField->currentText().toStdString();
30 }
31
32 std::string
33 WidgetPresentationParameters::getScalarBarRange()
34 {
35   return this->ui.comboBoxScalarBarRange->currentText().toStdString();
36 }
37
38 double
39 WidgetPresentationParameters::getScalarBarTimestep()
40 {
41   return this->ui.doubleSpinBoxTimeStep->value();
42 }
43
44 double
45 WidgetPresentationParameters::getScalarBarMinVal()
46 {
47   return this->ui.doubleSpinBoxMinVal->value();
48 }
49
50 double
51 WidgetPresentationParameters::getScalarBarMaxVal()
52 {
53   return this->ui.doubleSpinBoxMaxVal->value();
54 }
55
56 MEDCALC::MEDPresentationColorMap
57 WidgetPresentationParameters::getColorMap()
58 {
59   QString colorMap = this->ui.comboBoxColorMap->currentText();
60   if (colorMap == tr("LAB_BLUE_TO_RED")) {
61     return MEDCALC::COLOR_MAP_BLUE_TO_RED_RAINBOW;
62   }
63   else if (colorMap == tr("LAB_COOL_TO_WARM")) {
64     return MEDCALC::COLOR_MAP_COOL_TO_WARM;
65   }
66 }