#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;
+
PresentationController::PresentationController(MEDModule* salomeModule)
{
STDLOG("Creating a PresentationController");
{
STDLOG("Creating PresentationController actions");
+ // View Mode
+ int viewModeToolbarId = _salomeModule->createTool("View Mode", "ViewModeToolbar");
+ 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, viewModeToolbarId);
+
+ // Presentations
int presentationToolbarId = _salomeModule->createTool("Presentations", "PresentationToolbar");
int presentationMenuId = _salomeModule->createMenu(tr("MENU_PRESENTATIONS"), -1, 1);
- // Presentations
- QString label = tr("LAB_PRESENTATION_SCALAR_MAP");
- QString tooltip = tr("TIP_PRESENTATION_SCALAR_MAP");
+ label = tr("LAB_PRESENTATION_SCALAR_MAP");
+ 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);
MEDCALC::MEDPresentationViewMode
PresentationController::getSelectedViewMode()
{
- return _widgetPresentationParameters->getViewMode();
+ 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;
+ }
+ // Should not happen
+ STDLOG("Strange!! No matching view mode found - returning VIEW_MODE_REPLACE.");
+ return MEDCALC::VIEW_MODE_REPLACE;
}
MEDCALC::MEDPresentationColorMap
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;
- }
- // Should not happen
- STDLOG("Strange!! No matching view mode found - returning VIEW_MODE_REPLACE.");
- return MEDCALC::VIEW_MODE_REPLACE;
-}
-
std::string
WidgetPresentationParameters::getField()
{
WidgetPresentationParameters(QWidget* parent = 0);
virtual ~WidgetPresentationParameters() {}
- MEDCALC::MEDPresentationViewMode getViewMode();
std::string getField();
std::string getScalarBarRange();
double getScalarBarTimestep();
<x>0</x>
<y>0</y>
<width>404</width>
- <height>230</height>
+ <height>200</height>
</rect>
</property>
<property name="minimumSize">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
- <item row="1" column="0">
+ <item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>LAB_FIELD</string>
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="0" column="1">
<widget class="QComboBox" name="comboBoxField">
<item>
<property name="text">
</item>
</widget>
</item>
- <item row="5" column="0">
+ <item row="4" column="0">
<widget class="QLabel" name="labelTimeStep">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="5" column="1">
+ <item row="4" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxTimeStep">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="6" column="0">
+ <item row="5" column="0">
<widget class="QLabel" name="labelMinVal">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="6" column="1">
+ <item row="5" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxMinVal">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="7" column="0">
+ <item row="6" column="0">
<widget class="QLabel" name="labelMaxVal">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="7" column="1">
+ <item row="6" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxMaxVal">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="8" column="0">
+ <item row="7" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>LAB_COLOR_MAP</string>
</property>
</widget>
</item>
- <item row="8" column="1">
+ <item row="7" column="1">
<widget class="QComboBox" name="comboBoxColorMap">
<item>
<property name="text">
</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">
+ <item row="3" column="1">
<widget class="QComboBox" name="comboBoxScalarBarRange">
<property name="enabled">
<bool>true</bool>
</item>
</widget>
</item>
- <item row="2" column="0">
+ <item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>LAB_SCALARBAR</string>
</property>
</widget>
</item>
- <item row="4" column="0">
+ <item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="enabled">
<bool>true</bool>