From a119debbdcf997724c31a9177793d2f9beef6a64 Mon Sep 17 00:00:00 2001 From: abn Date: Thu, 4 Aug 2016 12:24:10 +0200 Subject: [PATCH] [MEDCalc] Multiple slices + other minor imps: + bug fix when updating parameters + nicer mesh icons --- src/MEDCalc/cmp/MEDPresentationSlices.cxx | 107 +++++++++++------- src/MEDCalc/cmp/MEDPresentationSlices.hxx | 8 +- src/MEDCalc/gui/MEDWidgetHelper.cxx | 9 +- src/MEDCalc/gui/MEDWidgetHelper.hxx | 2 +- src/MEDCalc/gui/MEDWidgetHelperComponent.cxx | 15 ++- src/MEDCalc/gui/MEDWidgetHelperComponent.hxx | 2 +- src/MEDCalc/gui/MEDWidgetHelperContour.cxx | 15 +-- src/MEDCalc/gui/MEDWidgetHelperContour.hxx | 2 +- src/MEDCalc/gui/MEDWidgetHelperMeshView.cxx | 15 ++- src/MEDCalc/gui/MEDWidgetHelperMeshView.hxx | 2 +- src/MEDCalc/gui/MEDWidgetHelperSlices.cxx | 19 ++-- src/MEDCalc/gui/MEDWidgetHelperSlices.hxx | 2 +- src/MEDCalc/gui/MED_msg_en.ts | 4 + src/MEDCalc/gui/PresentationController.cxx | 4 +- .../dialogs/WidgetPresentationParameters.cxx | 61 +++++----- .../res/presentations/classic/visu_mesh16.png | Bin 330 -> 433 bytes .../res/presentations/classic/visu_mesh24.png | Bin 525 -> 707 bytes .../res/presentations/modern/mesh16.png | Bin 330 -> 433 bytes .../res/presentations/modern/mesh24.png | Bin 525 -> 707 bytes src/MEDCalc/test/tui/slices.py | 3 +- src/MEDCalc/tui/__init__.py | 2 +- src/MEDCalc/tui/medpresentation.py | 24 ++++ 22 files changed, 183 insertions(+), 113 deletions(-) diff --git a/src/MEDCalc/cmp/MEDPresentationSlices.cxx b/src/MEDCalc/cmp/MEDPresentationSlices.cxx index 16dbf4fad..83945b32d 100644 --- a/src/MEDCalc/cmp/MEDPresentationSlices.cxx +++ b/src/MEDCalc/cmp/MEDPresentationSlices.cxx @@ -39,53 +39,86 @@ MEDPresentationSlices::MEDPresentationSlices(const MEDCALC::SlicesParameters& pa } void -MEDPresentationSlices::setNumberOfSlices() +MEDPresentationSlices::generateSlices() { - std::ostringstream oss1; - // TODO -// oss1 << _objVar << ".SliceType.Normal = " << norm << ";"; + std::ostringstream oss; + int nbSlices = getIntProperty(MEDPresentationSlices::PROP_NB_SLICES); + std::string normal = getNormalVector(); + + oss << "import medcalc; __origins = medcalc.GetSliceOrigins(" << _srcObjVar << ", " << nbSlices << ", " << normal << ");"; + pushAndExecPyLine(oss.str()); oss.str(""); + pushAndExecPyLine("__objLst = [];"); + oss << "for sliceNum in range(" << nbSlices << "):\n"; + oss << " obj = pvs.Slice(Input=" << _srcObjVar << ")\n"; + oss << " obj.SliceType = 'Plane'\n"; + oss << " obj.SliceType.Normal = " << normal << "\n"; + oss << " obj.SliceType.Origin = __origins[sliceNum]\n"; + oss << " __objLst.append(obj)\n\n"; + pushAndExecPyLine(oss.str()); oss.str(""); + + oss << _objVar << " = pvs.GroupDatasets(Input=__objLst);"; + pushAndExecPyLine(oss.str()); oss.str(""); } void -MEDPresentationSlices::selectSliceOrientation() +MEDPresentationSlices::generateAndDisplay() { - std::ostringstream oss1; - std::string norm; + generateSlices(); + showObject(); + + colorBy(_fieldType); + showScalarBar(); + rescaleTransferFunction(); + selectColorMap(); + resetCameraAndRender(); +} + + +void +MEDPresentationSlices::clearPreviousSlices() +{ + std::ostringstream oss; + + pushAndExecPyLine("for sliceNum, _ in enumerate(__objLst):\n pvs.Delete(__objLst[sliceNum]);"); + oss << "pvs.Delete(" << _objVar << ");"; + pushAndExecPyLine(oss.str()); oss.str(""); +} +std::string +MEDPresentationSlices::getNormalVector() const +{ switch(_params.orientation) { case MEDCALC::SLICE_NORMAL_TO_X: - norm = "[1.0, 0.0, 0.0]"; - break; + return "[1.0, 0.0, 0.0]"; case MEDCALC::SLICE_NORMAL_TO_Y: - norm = "[0.0, 1.0, 0.0]"; - break; + return "[0.0, 1.0, 0.0]"; case MEDCALC::SLICE_NORMAL_TO_Z: - norm = "[0.0, 0.0, 1.0]"; - break; + return "[0.0, 0.0, 1.0]"; case MEDCALC::SLICE_NORMAL_TO_XY: - norm = "[1.0, 1.0, 0.0]"; - break; + return "[1.0, 1.0, 0.0]"; case MEDCALC::SLICE_NORMAL_TO_XZ: - norm = "[1.0, 0.0, 1.0]"; - break; + return "[1.0, 0.0, 1.0]"; case MEDCALC::SLICE_NORMAL_TO_YZ: - norm = "[0.0, 1.0, 1.0]"; - break; + return "[0.0, 1.0, 1.0]"; case MEDCALC::SLICE_NORMAL_TO_XYZ: - norm = "[1.0, 1.0, 1.0]"; - break; + return "[1.0, 1.0, 1.0]"; default: const char * mes = "Unexpected getSliceOrientationCommand() error!"; STDLOG(mes); throw KERNEL::createSalomeException(mes); } + return ""; // never happens +} - oss1 << _objVar << ".SliceType.Normal = " << norm << ";"; +void +MEDPresentationSlices::selectSliceOrientation(const std::string & obj) +{ + std::ostringstream oss1; + oss1 << obj << ".SliceType.Normal = " << getNormalVector() << ";"; pushAndExecPyLine(oss1.str()); oss1.str(""); } - void MEDPresentationSlices::internalGeneratePipeline() { @@ -101,21 +134,8 @@ MEDPresentationSlices::internalGeneratePipeline() fillAvailableFieldComponents(); setOrCreateRenderView(); // instanciate __viewXXX - oss << _objVar << " = pvs.Slice(Input=" << _srcObjVar << ");"; - pushAndExecPyLine(oss.str()); oss.str(""); - - showObject(); - - oss << _objVar << ".SliceType = 'Plane';"; - pushAndExecPyLine(oss.str()); oss.str(""); - - // Set slice orientation - selectSliceOrientation(); - colorBy(_fieldType); - showScalarBar(); - rescaleTransferFunction(); - selectColorMap(); - resetCameraAndRender(); + // Now create the initial number of slices + generateAndDisplay(); } void @@ -148,8 +168,8 @@ MEDPresentationSlices::updateNbSlices(const int nbSlices) // Update the pipeline: { MEDPyLockWrapper lock; - setNumberOfSlices(); - pushAndExecPyLine("pvs.Render();"); + clearPreviousSlices(); + generateAndDisplay(); } } @@ -159,13 +179,14 @@ MEDPresentationSlices::updateOrientation(const MEDCALC::SliceOrientationType ori _params.orientation = orientation; // GUI helper: - setIntProperty(MEDPresentationSlices::PROP_SLICE_ORIENTATION, orientation); + setIntProperty(MEDPresentationSlices::PROP_SLICE_ORIENTATION, static_cast(orientation)); // Update the pipeline: { MEDPyLockWrapper lock; - selectSliceOrientation(); - pushAndExecPyLine("pvs.Render();"); + + clearPreviousSlices(); + generateAndDisplay(); } } diff --git a/src/MEDCalc/cmp/MEDPresentationSlices.hxx b/src/MEDCalc/cmp/MEDPresentationSlices.hxx index 81d5ae7e8..19afa196e 100644 --- a/src/MEDCalc/cmp/MEDPresentationSlices.hxx +++ b/src/MEDCalc/cmp/MEDPresentationSlices.hxx @@ -43,8 +43,12 @@ protected: void updateOrientation(const MEDCALC::SliceOrientationType orientation); virtual void internalGeneratePipeline(); - void setNumberOfSlices(); - void selectSliceOrientation(); + void generateSlices(); + void clearPreviousSlices(); + void generateAndDisplay(); + void selectSliceOrientation(const std::string & obj); + + std::string getNormalVector() const; private: MEDCALC::SlicesParameters _params; diff --git a/src/MEDCalc/gui/MEDWidgetHelper.cxx b/src/MEDCalc/gui/MEDWidgetHelper.cxx index 4451ca9ad..8869c847b 100644 --- a/src/MEDCalc/gui/MEDWidgetHelper.cxx +++ b/src/MEDCalc/gui/MEDWidgetHelper.cxx @@ -53,7 +53,7 @@ void MEDWidgetHelper::loadParametersFromEngine() _presManager->getPresentationIntProperty(_presId, MEDPresentation::PROP_SCALAR_BAR_RANGE.c_str())); } -void MEDWidgetHelper::udpateWidget() +void MEDWidgetHelper::updateWidget(bool connect) { // Set presentation name _paramWidget->setPresName(_presName); @@ -67,8 +67,11 @@ void MEDWidgetHelper::udpateWidget() _paramWidget->setColorMap(_colorMap); _paramWidget->setScalarBarRange(_scalarBarRange); - QObject::connect( _paramWidget, SIGNAL(comboScalarBarRangeIndexChanged(int)), this, SLOT(onScalarBarRangeChanged(int)) ); - QObject::connect( _paramWidget, SIGNAL(comboColorMapIndexChanged(int)), this, SLOT(onColorMapChanged(int)) ); + if (connect) + { + QObject::connect( _paramWidget, SIGNAL(comboScalarBarRangeIndexChanged(int)), this, SLOT(onScalarBarRangeChanged(int)) ); + QObject::connect( _paramWidget, SIGNAL(comboColorMapIndexChanged(int)), this, SLOT(onColorMapChanged(int)) ); + } } void MEDWidgetHelper::releaseWidget() diff --git a/src/MEDCalc/gui/MEDWidgetHelper.hxx b/src/MEDCalc/gui/MEDWidgetHelper.hxx index 2fbeaadca..a5f60a561 100644 --- a/src/MEDCalc/gui/MEDWidgetHelper.hxx +++ b/src/MEDCalc/gui/MEDWidgetHelper.hxx @@ -40,7 +40,7 @@ class MEDWidgetHelper : public QObject public: virtual ~MEDWidgetHelper(); - virtual void udpateWidget(); + virtual void updateWidget(bool connect); virtual void releaseWidget(); ///! Returns the string X in the Python command "Update" or "GetParameters" diff --git a/src/MEDCalc/gui/MEDWidgetHelperComponent.cxx b/src/MEDCalc/gui/MEDWidgetHelperComponent.cxx index 947fc3434..01a29e9ed 100644 --- a/src/MEDCalc/gui/MEDWidgetHelperComponent.cxx +++ b/src/MEDCalc/gui/MEDWidgetHelperComponent.cxx @@ -28,16 +28,19 @@ MEDWidgetHelperComponent::MEDWidgetHelperComponent(const PresentationController MEDWidgetHelperComponent::~MEDWidgetHelperComponent() {} -void MEDWidgetHelperComponent::udpateWidget() +void MEDWidgetHelperComponent::updateWidget(bool connect) { - MEDWidgetHelper::udpateWidget(); + MEDWidgetHelper::updateWidget(connect); _paramWidget->setComponents(_allCompos, _selectedCompo); - // Connect combo box changes - QObject::connect( this, SIGNAL(presentationUpdateSignal(const PresentationEvent *)), - _presController, SIGNAL(presentationSignal(const PresentationEvent *)) ); - QObject::connect( _paramWidget, SIGNAL(comboCompoIndexChanged(int)), this, SLOT(onComponentChanged(int)) ); + if (connect) + { + // Connect combo box changes + QObject::connect( this, SIGNAL(presentationUpdateSignal(const PresentationEvent *)), + _presController, SIGNAL(presentationSignal(const PresentationEvent *)) ); + QObject::connect( _paramWidget, SIGNAL(comboCompoIndexChanged(int)), this, SLOT(onComponentChanged(int)) ); + } } void MEDWidgetHelperComponent::releaseWidget() diff --git a/src/MEDCalc/gui/MEDWidgetHelperComponent.hxx b/src/MEDCalc/gui/MEDWidgetHelperComponent.hxx index 58c774f15..fce67204d 100644 --- a/src/MEDCalc/gui/MEDWidgetHelperComponent.hxx +++ b/src/MEDCalc/gui/MEDWidgetHelperComponent.hxx @@ -37,7 +37,7 @@ public: WidgetPresentationParameters * paramW); virtual ~MEDWidgetHelperComponent(); - virtual void udpateWidget(); + virtual void updateWidget(bool connect); virtual void releaseWidget(); virtual std::string getPythonTag() const = 0; diff --git a/src/MEDCalc/gui/MEDWidgetHelperContour.cxx b/src/MEDCalc/gui/MEDWidgetHelperContour.cxx index 40ded91d5..351c558bf 100644 --- a/src/MEDCalc/gui/MEDWidgetHelperContour.cxx +++ b/src/MEDCalc/gui/MEDWidgetHelperContour.cxx @@ -41,20 +41,21 @@ void MEDWidgetHelperContour::loadParametersFromEngine() _nbContours = _presManager->getPresentationIntProperty(_presId, MEDPresentationContour::PROP_NB_CONTOUR.c_str()); } -void MEDWidgetHelperContour::udpateWidget() +void MEDWidgetHelperContour::updateWidget(bool connect) { - MEDWidgetHelper::udpateWidget(); + MEDWidgetHelper::updateWidget(connect); STDLOG("MEDWidgetHelperContour::udpateWidget() nbContour is " << _nbContours); // Contour presentation needs the number of contours -// _paramWidget->setComponents(_allCompos, _selectedCompo); _paramWidget->setNbContour(_nbContours); // Connect combo box changes - QObject::connect( this, SIGNAL(presentationUpdateSignal(const PresentationEvent *)), - _presController, SIGNAL(presentationSignal(const PresentationEvent *)) ); -// QObject::connect( _paramWidget, SIGNAL(comboCompoIndexChanged(int)), this, SLOT(onComponentChanged(int)) ); - QObject::connect( _paramWidget, SIGNAL(spinBoxValueChanged(int)), this, SLOT(onNbContourChanged(int)) ); + if (connect) + { + QObject::connect( this, SIGNAL(presentationUpdateSignal(const PresentationEvent *)), + _presController, SIGNAL(presentationSignal(const PresentationEvent *)) ); + QObject::connect( _paramWidget, SIGNAL(spinBoxValueChanged(int)), this, SLOT(onNbContourChanged(int)) ); + } } void MEDWidgetHelperContour::releaseWidget() diff --git a/src/MEDCalc/gui/MEDWidgetHelperContour.hxx b/src/MEDCalc/gui/MEDWidgetHelperContour.hxx index 0e545fe78..fc3775993 100644 --- a/src/MEDCalc/gui/MEDWidgetHelperContour.hxx +++ b/src/MEDCalc/gui/MEDWidgetHelperContour.hxx @@ -34,7 +34,7 @@ public: WidgetPresentationParameters * paramW); virtual ~MEDWidgetHelperContour(); - virtual void udpateWidget(); + virtual void updateWidget(bool connect); virtual void releaseWidget(); virtual std::string getPythonTag() const { return "Contour"; } diff --git a/src/MEDCalc/gui/MEDWidgetHelperMeshView.cxx b/src/MEDCalc/gui/MEDWidgetHelperMeshView.cxx index 2ea424500..c75d453f0 100644 --- a/src/MEDCalc/gui/MEDWidgetHelperMeshView.cxx +++ b/src/MEDCalc/gui/MEDWidgetHelperMeshView.cxx @@ -42,19 +42,22 @@ void MEDWidgetHelperMeshView::loadParametersFromEngine() _presManager->getPresentationIntProperty(_presId, MEDPresentationMeshView::PROP_MESH_MODE.c_str())); } -void MEDWidgetHelperMeshView::udpateWidget() +void MEDWidgetHelperMeshView::updateWidget(bool connect) { - MEDWidgetHelper::udpateWidget(); + MEDWidgetHelper::updateWidget(connect); // MeshView presentation needs the mesh mode that's all. _paramWidget->setMeshMode(_meshMode); // Hide color map and scalar bar range _paramWidget->toggleCommonFieldWidget(false); - // Connect combo box changes - QObject::connect( this, SIGNAL(presentationUpdateSignal(const PresentationEvent *)), - _presController, SIGNAL(presentationSignal(const PresentationEvent *)) ); - QObject::connect( _paramWidget, SIGNAL(comboMeshIndexChanged(int)), this, SLOT(onMeshModeChanged(int)) ); + if (connect) + { + // Connect combo box changes + QObject::connect( this, SIGNAL(presentationUpdateSignal(const PresentationEvent *)), + _presController, SIGNAL(presentationSignal(const PresentationEvent *)) ); + QObject::connect( _paramWidget, SIGNAL(comboMeshIndexChanged(int)), this, SLOT(onMeshModeChanged(int)) ); + } } void MEDWidgetHelperMeshView::releaseWidget() diff --git a/src/MEDCalc/gui/MEDWidgetHelperMeshView.hxx b/src/MEDCalc/gui/MEDWidgetHelperMeshView.hxx index efbd56117..83f2b50e6 100644 --- a/src/MEDCalc/gui/MEDWidgetHelperMeshView.hxx +++ b/src/MEDCalc/gui/MEDWidgetHelperMeshView.hxx @@ -34,7 +34,7 @@ public: WidgetPresentationParameters * paramW); virtual ~MEDWidgetHelperMeshView(); - virtual void udpateWidget(); + virtual void updateWidget(bool connect); virtual void releaseWidget(); virtual std::string getPythonTag() const { return "MeshView"; } diff --git a/src/MEDCalc/gui/MEDWidgetHelperSlices.cxx b/src/MEDCalc/gui/MEDWidgetHelperSlices.cxx index b785cfab6..eb99e8775 100644 --- a/src/MEDCalc/gui/MEDWidgetHelperSlices.cxx +++ b/src/MEDCalc/gui/MEDWidgetHelperSlices.cxx @@ -44,19 +44,22 @@ void MEDWidgetHelperSlices::loadParametersFromEngine() _presManager->getPresentationIntProperty(_presId, MEDPresentationSlices::PROP_SLICE_ORIENTATION.c_str())); } -void MEDWidgetHelperSlices::udpateWidget() +void MEDWidgetHelperSlices::updateWidget(bool connect) { - MEDWidgetHelper::udpateWidget(); + MEDWidgetHelper::updateWidget(connect); STDLOG("MEDWidgetHelperSlices::udpateWidget() nbSlices is " << _nbSlices); -// _paramWidget->setNbSlices(_nbSlices); // TODO: uncomment when ready to deal with slice number + _paramWidget->setNbSlices(_nbSlices); _paramWidget->setSliceOrientation(_sliceOrientation); // Connect combo box changes - QObject::connect( this, SIGNAL(presentationUpdateSignal(const PresentationEvent *)), - _presController, SIGNAL(presentationSignal(const PresentationEvent *)) ); - QObject::connect( _paramWidget, SIGNAL(spinBoxValueChanged(int)), this, SLOT(onNbSlicesChanged(int)) ); - QObject::connect( _paramWidget, SIGNAL(comboOrientIndexChanged(int)), this, SLOT(onSliceOrientationChanged(int)) ); + if (connect) + { + QObject::connect( this, SIGNAL(presentationUpdateSignal(const PresentationEvent *)), + _presController, SIGNAL(presentationSignal(const PresentationEvent *)) ); + QObject::connect( _paramWidget, SIGNAL(spinBoxValueChanged(int)), this, SLOT(onNbSlicesChanged(int)) ); + QObject::connect( _paramWidget, SIGNAL(comboOrientIndexChanged(int)), this, SLOT(onSliceOrientationChanged(int)) ); + } } void MEDWidgetHelperSlices::releaseWidget() @@ -83,7 +86,7 @@ void MEDWidgetHelperSlices::onNbSlicesChanged(int nbSlices) void MEDWidgetHelperSlices::onSliceOrientationChanged(int sliceOrient) { - STDLOG("MEDWidgetHelperSlices::onNbSlicesChanged"); + STDLOG("MEDWidgetHelperSlices::onSliceOrientationChanged"); PresentationEvent* event = new PresentationEvent(); event->eventtype = PresentationEvent::EVENT_CHANGE_SLICE_ORIENTATION; event->presentationId = _presId; diff --git a/src/MEDCalc/gui/MEDWidgetHelperSlices.hxx b/src/MEDCalc/gui/MEDWidgetHelperSlices.hxx index ddfcb2a84..bce48ef03 100644 --- a/src/MEDCalc/gui/MEDWidgetHelperSlices.hxx +++ b/src/MEDCalc/gui/MEDWidgetHelperSlices.hxx @@ -34,7 +34,7 @@ public: WidgetPresentationParameters * paramW); virtual ~MEDWidgetHelperSlices(); - virtual void udpateWidget(); + virtual void updateWidget(bool connect); virtual void releaseWidget(); virtual std::string getPythonTag() const { return "Slices"; } diff --git a/src/MEDCalc/gui/MED_msg_en.ts b/src/MEDCalc/gui/MED_msg_en.ts index a3564ddd2..a9a9a1ebc 100644 --- a/src/MEDCalc/gui/MED_msg_en.ts +++ b/src/MEDCalc/gui/MED_msg_en.ts @@ -179,6 +179,10 @@ WidgetPresentationParameters + + LAB_DEFAULT_DYN_TITLE + Default parameters + LAB_DISP_COMP Displayed component: diff --git a/src/MEDCalc/gui/PresentationController.cxx b/src/MEDCalc/gui/PresentationController.cxx index 44acb921e..c6fcbbe78 100644 --- a/src/MEDCalc/gui/PresentationController.cxx +++ b/src/MEDCalc/gui/PresentationController.cxx @@ -619,7 +619,7 @@ PresentationController::onPresentationSelected(int presId, const QString& presTy _presManager->activateView(presId); // Update widgets parameters _currentWidgetHelper = findOrCreateWidgetHelper(_presManager, presId, presType.toStdString(), presName.toStdString()); - _currentWidgetHelper->udpateWidget(); + _currentWidgetHelper->updateWidget(true); } } @@ -752,7 +752,7 @@ PresentationController::processWorkspaceEvent(const MEDCALC::MedEvent* event) else if ( event->type == MEDCALC::EVENT_MODIFY_PRESENTATION ) { // Update parameter widget if shown: if(_currentWidgetHelper) - _currentWidgetHelper->udpateWidget(); + _currentWidgetHelper->updateWidget(false); } } diff --git a/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx b/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx index 8d7a3e1be..601e46d44 100644 --- a/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx +++ b/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx @@ -28,15 +28,15 @@ WidgetPresentationParameters::WidgetPresentationParameters(QWidget* parent) _ui.setupUi(this); // To be done first toggleWidget(false); - QObject::connect(_ui.comboBoxCompo, SIGNAL(currentIndexChanged(int)), + QObject::connect(_ui.comboBoxCompo, SIGNAL(activated(int)), this, SLOT(onComboCompoIndexChanged(int)) ); - QObject::connect(_ui.comboBoxMesh, SIGNAL(currentIndexChanged(int)), + QObject::connect(_ui.comboBoxMesh, SIGNAL(activated(int)), this, SLOT(onComboMeshIndexChanged(int)) ); - QObject::connect(_ui.comboBoxScalarBarRange, SIGNAL(currentIndexChanged(int)), + QObject::connect(_ui.comboBoxScalarBarRange, SIGNAL(activated(int)), this, SLOT(onComboScalarBarRangeIndexChanged(int)) ); - QObject::connect(_ui.comboBoxColorMap, SIGNAL(currentIndexChanged(int)), + QObject::connect(_ui.comboBoxColorMap, SIGNAL(activated(int)), this, SLOT(onComboColorMapIndexChanged(int)) ); - QObject::connect(_ui.comboBoxSliceOrient, SIGNAL(currentIndexChanged(int)), + QObject::connect(_ui.comboBoxSliceOrient, SIGNAL(activated(int)), this, SLOT(onComboOrientIndexChanged(int)) ); QObject::connect(_ui.spinBox, SIGNAL(valueChanged(int)), this, SLOT(onSpinBoxValueChanged(int)) ); @@ -96,7 +96,7 @@ WidgetPresentationParameters::toggleWidget(bool show) _blockSig = true; _ui.widgetDynamic->hide(); - setPresName("Choose a presentation"); + setPresName(tr("LAB_DEFAULT_DYN_TITLE").toStdString()); // reset colorMap and scalarBarRange: setColorMap(MEDCALC::COLOR_MAP_DEFAULT); setScalarBarRange(MEDCALC::SCALAR_BAR_RANGE_DEFAULT); @@ -135,22 +135,26 @@ WidgetPresentationParameters::getComponent() const void WidgetPresentationParameters::setComponents(vector compos, int selecIndex) { + _blockSig = true; + // Show the widget: _ui.labelCompo->show(); _ui.comboBoxCompo->show(); - _blockSig = true; _ui.comboBoxCompo->clear(); _ui.comboBoxCompo->addItem(tr("LAB_EUCLIDEAN_NORM")); for(vector::const_iterator it = compos.begin(); it != compos.end(); ++it) _ui.comboBoxCompo->addItem(QString::fromStdString(*it)); _ui.comboBoxCompo->setCurrentIndex(selecIndex); + _blockSig = false; } void WidgetPresentationParameters::setNbContour(int nbContour) { + _blockSig = true; + if (nbContour <= 0) { //TODO throw? @@ -161,15 +165,16 @@ WidgetPresentationParameters::setNbContour(int nbContour) _ui.labelSpinBox->setText(tr("LAB_NB_CONTOURS")); _ui.labelSpinBox->show(); _ui.spinBox->show(); - - _blockSig = true; _ui.spinBox->setValue(nbContour); + _blockSig = false; } void WidgetPresentationParameters::setNbSlices(int nbSlices) { + _blockSig = true; + if (nbSlices <= 0) { //TODO throw? @@ -180,9 +185,8 @@ WidgetPresentationParameters::setNbSlices(int nbSlices) _ui.labelSpinBox->setText(tr("LAB_NB_SLICES")); _ui.labelSpinBox->show(); _ui.spinBox->show(); - - _blockSig = true; _ui.spinBox->setValue(nbSlices); + _blockSig = false; } @@ -200,6 +204,8 @@ int WidgetPresentationParameters::getNbSlices() const void WidgetPresentationParameters::setScalarBarRange(MEDCALC::ScalarBarRangeType sbrange) { + _blockSig = true; + int idx; if (sbrange == MEDCALC::SCALAR_BAR_ALL_TIMESTEPS) idx = _ui.comboBoxScalarBarRange->findText(tr("LAB_ALL_TIMESTEPS")); @@ -207,18 +213,18 @@ WidgetPresentationParameters::setScalarBarRange(MEDCALC::ScalarBarRangeType sbra idx = _ui.comboBoxScalarBarRange->findText(tr("LAB_CURRENT_TIMESTEP")); if (idx >= 0) - { - _blockSig = true; _ui.comboBoxScalarBarRange->setCurrentIndex(idx); - _blockSig = false; - } else STDLOG("Strange!! No matching found - unable to set scalar bar range in GUI."); + + _blockSig = false; } void WidgetPresentationParameters::setColorMap(MEDCALC::ColorMapType colorMap) { + _blockSig = true; + int idx = -1; if (colorMap == MEDCALC::COLOR_MAP_BLUE_TO_RED_RAINBOW) idx = _ui.comboBoxColorMap->findText(tr("LAB_BLUE_TO_RED")); @@ -226,19 +232,18 @@ WidgetPresentationParameters::setColorMap(MEDCALC::ColorMapType colorMap) idx = _ui.comboBoxColorMap->findText(tr("LAB_COOL_TO_WARM")); if (idx >= 0) - { - _blockSig = true; _ui.comboBoxColorMap->setCurrentIndex(idx); - _blockSig = false; - } - else STDLOG("Strange!! No matching found - unable to set color map in GUI."); + + _blockSig = false; } void WidgetPresentationParameters::setMeshMode(MEDCALC::MeshModeType mode) { + _blockSig = true; + // Show the widget: _ui.labelMeshMode->show(); _ui.comboBoxMesh->show(); @@ -259,18 +264,18 @@ WidgetPresentationParameters::setMeshMode(MEDCALC::MeshModeType mode) idx = -1; } if (idx >= 0) - { - _blockSig = true; _ui.comboBoxMesh->setCurrentIndex(idx); - _blockSig = false; - } else STDLOG("Strange!! No matching found - unable to set mesh mode in GUI."); + + _blockSig = false; } void WidgetPresentationParameters::setSliceOrientation(MEDCALC::SliceOrientationType orient) { + _blockSig = true; + // Show the widget: _ui.labelSliceOrient->show(); _ui.comboBoxSliceOrient->show(); @@ -303,13 +308,11 @@ WidgetPresentationParameters::setSliceOrientation(MEDCALC::SliceOrientationType idx = -1; } if (idx >= 0) - { - _blockSig = true; - _ui.comboBoxSliceOrient->setCurrentIndex(idx); - _blockSig = false; - } + _ui.comboBoxSliceOrient->setCurrentIndex(idx); else STDLOG("Strange!! No matching found - unable to set slice orientation in GUI."); + + _blockSig = false; } diff --git a/src/MEDCalc/res/presentations/classic/visu_mesh16.png b/src/MEDCalc/res/presentations/classic/visu_mesh16.png index 1105b373753ad9b14d01afd7ef22615420e64099..d2671e057f9110bdc93379def7f441903e2a6692 100644 GIT binary patch delta 389 zcmV;00eb$*0EdrS%=roxs-ORL7zMf`=6XVs zG%b@04Zs)x2B5@$?>s0!Ncamd44({4_SIj%-vje00000NkvXXu0mjfA@HaC delta 286 zcmV+(0pb3!1IhxB83+IX0026epuLeVAb$Z40W}wDMeYCq0O?6YK~xyiP0uk)LSX=f z;rF{;ig0qdrT7_`C=?R329=mwE^bmFLQ{M67oz5dmLTe1Bm@OPLxHHMNJ9pZH@VOj zRGx-g&~zTobdC`KjB!Hz#`(A&LMUcUJ^@jC#dps-$#9UaE6ifbbYiJH`emVdN^ zD?84k$N^GP{l#c$GrI67D>*P|nWbPl668$p8C)2aKb9##WNZ8aM!;>QGH;&FE>^?o kl5_&cq0HZXO@#OXzL{*}Y4BD#01E&B07*qoM6N<$f}taXEdT%j diff --git a/src/MEDCalc/res/presentations/classic/visu_mesh24.png b/src/MEDCalc/res/presentations/classic/visu_mesh24.png index 3b3de8b4a828a5534ec47e4613938b1d8bd85be7..a9708fab288ce7e424cc0e631efea8bda0829719 100644 GIT binary patch delta 665 zcmV;K0%rY<1j7Z885RTp002sU^>Y9K00Lr5M??Sss*NKuks%;|1PT=rtQmhk00071 zNklR3AfaCub)m-LlgR7-)?$vQg+W^=asa+TQ67!m>Eyj)ZF5IxW2w;0Y z{Q>}WYa<=Aoa$U(tNO|+%dD`lvuYi{(Ghw#aBIr+M`X6zWse69y4O7hJ!Frc+$96$ zPtKJNF^3Ve&~`^~TEsJ>`^Od;HP4bIAuFu(iUYp3$ucj0dciWAd}GE-&T+OOE%_~o zM{W0>amy`siyu|(GHJ18mU!QGqZ$VYj)=k}>1G<=fFFqbU;+co;1in&k6s?k4Fi4WKd<7)HVrrSsA_9n{ zIYW}cv4TQ>4%0@04@3aSkpm#YdunOt2!;7CZ9M8zGqxJB+V^Usjp{q+S>$aqKK-*x zIU+Q(f;4rUCqssFETE5-B#8{?`(1QE3V@%axj~lGyhYMHB*%HOKnNj_XDVv7Z`Gwf zRI@g?!mRqh<>vfg!kD8)cLV#&KR>G*+(|z{AV{2e*l?5~Mb-DNmpf+WeZB(#R5um9 zz?40sMfbW}48NSW5g?V{r!4?97biBA^iQ|VMjP#LmXik)+tyD4*f{=(R$iySz_1Kd z+%)))c^)#?u(0$_>D^^Z{xC8=_Jva6zn}a9a^F8_dnMws00000NkvXXu0mjfy{0;! delta 482 zcmV<80UiFs1&sud83+IX006}tVkD6-Ab$Z1GagWFDl`B90jx&w zAUI42=7XH9y9ge`e;DXsw{c=?gma-1KM%-r%=rI*K9}^KAIK7i{l$dUPyhdaQd3mI zdp}&_dkjOwpW)+wn2ykv z&kX+=P4#q582|tO)EEjks&Kvjb$?CidFr>f6ER3 z|JvI9{lCWM-*p{ks8MgU3}U`AF);D-F)=WGOVLz(4RsaYx;<|$ZFEdrS%=roxs-ORL7zMf`=6XVs zG%b@04Zs)x2B5@$?>s0!Ncamd44({4_SIj%-vje00000NkvXXu0mjfA@HaC delta 286 zcmV+(0pb3!1IhxB83+IX0026epuLeVAb$Z40W}wDMeYCq0O?6YK~xyiP0uk)LSX=f z;rF{;ig0qdrT7_`C=?R329=mwE^bmFLQ{M67oz5dmLTe1Bm@OPLxHHMNJ9pZH@VOj zRGx-g&~zTobdC`KjB!Hz#`(A&LMUcUJ^@jC#dps-$#9UaE6ifbbYiJH`emVdN^ zD?84k$N^GP{l#c$GrI67D>*P|nWbPl668$p8C)2aKb9##WNZ8aM!;>QGH;&FE>^?o kl5_&cq0HZXO@#OXzL{*}Y4BD#01E&B07*qoM6N<$f}taXEdT%j diff --git a/src/MEDCalc/res/presentations/modern/mesh24.png b/src/MEDCalc/res/presentations/modern/mesh24.png index 3b3de8b4a828a5534ec47e4613938b1d8bd85be7..a9708fab288ce7e424cc0e631efea8bda0829719 100644 GIT binary patch delta 665 zcmV;K0%rY<1j7Z885RTp002sU^>Y9K00Lr5M??Sss*NKuks%;|1PT=rtQmhk00071 zNklR3AfaCub)m-LlgR7-)?$vQg+W^=asa+TQ67!m>Eyj)ZF5IxW2w;0Y z{Q>}WYa<=Aoa$U(tNO|+%dD`lvuYi{(Ghw#aBIr+M`X6zWse69y4O7hJ!Frc+$96$ zPtKJNF^3Ve&~`^~TEsJ>`^Od;HP4bIAuFu(iUYp3$ucj0dciWAd}GE-&T+OOE%_~o zM{W0>amy`siyu|(GHJ18mU!QGqZ$VYj)=k}>1G<=fFFqbU;+co;1in&k6s?k4Fi4WKd<7)HVrrSsA_9n{ zIYW}cv4TQ>4%0@04@3aSkpm#YdunOt2!;7CZ9M8zGqxJB+V^Usjp{q+S>$aqKK-*x zIU+Q(f;4rUCqssFETE5-B#8{?`(1QE3V@%axj~lGyhYMHB*%HOKnNj_XDVv7Z`Gwf zRI@g?!mRqh<>vfg!kD8)cLV#&KR>G*+(|z{AV{2e*l?5~Mb-DNmpf+WeZB(#R5um9 zz?40sMfbW}48NSW5g?V{r!4?97biBA^iQ|VMjP#LmXik)+tyD4*f{=(R$iySz_1Kd z+%)))c^)#?u(0$_>D^^Z{xC8=_Jva6zn}a9a^F8_dnMws00000NkvXXu0mjfy{0;! delta 482 zcmV<80UiFs1&sud83+IX006}tVkD6-Ab$Z1GagWFDl`B90jx&w zAUI42=7XH9y9ge`e;DXsw{c=?gma-1KM%-r%=rI*K9}^KAIK7i{l$dUPyhdaQd3mI zdp}&_dkjOwpW)+wn2ykv z&kX+=P4#q582|tO)EEjks&Kvjb$?CidFr>f6ER3 z|JvI9{lCWM-*p{ks8MgU3}U`AF);D-F)=WGOVLz(4RsaYx;<|$ZF