_presManager->getPresentationIntProperty(_presId, MEDPresentation::PROP_COLOR_MAP.c_str()));
_scalarBarRange = static_cast<MEDCALC::ScalarBarRangeType>(
_presManager->getPresentationIntProperty(_presId, MEDPresentation::PROP_SCALAR_BAR_RANGE.c_str()));
+
+ _scalarBarVisibility = static_cast<bool>(
+ _presManager->getPresentationIntProperty(_presId, MEDPresentation::PROP_SCALAR_BAR_VISIBILITY.c_str()));
+
+ _scalarBarRangeArray[0] = _presManager->getPresentationDoubleProperty(_presId, MEDPresentation::PROP_SCALAR_BAR_MIN_VALUE.c_str());
+ _scalarBarRangeArray[1] = _presManager->getPresentationDoubleProperty(_presId, MEDPresentation::PROP_SCALAR_BAR_MAX_VALUE.c_str());
+
+ _hideDataOutsideCustomRange = _presManager->getPresentationIntProperty(_presId, MEDPresentation::PROP_HIDE_DATA_OUTSIDE_CUSTOM_RANGE.c_str());
}
void MEDWidgetHelper::updateWidget(bool connect)
STDLOG("MEDWidgetHelper::udpateWidget() scalarBarRange is " << _scalarBarRange);
_paramWidget->setScalarBarRange(_scalarBarRange);
+ _paramWidget->setScalarBarVisibility(_scalarBarVisibility);
+
+ _paramWidget->setScalarBarRangeValue(_scalarBarRangeArray[0], _scalarBarRangeArray[1]);
+
+ _paramWidget->setHideDataOutsideCustomRange(_hideDataOutsideCustomRange);
+
if (connect)
{
QObject::connect( this, SIGNAL(presentationUpdateSignal(const PresentationEvent *)),
_presController, SIGNAL(presentationSignal(const PresentationEvent *)) );
QObject::connect( _paramWidget, SIGNAL(comboScalarBarRangeIndexChanged(int)), this, SLOT(onScalarBarRangeChanged(int)) );
QObject::connect( _paramWidget, SIGNAL(comboColorMapIndexChanged(int)), this, SLOT(onColorMapChanged(int)) );
- }
+ QObject::connect( _paramWidget, SIGNAL(checkboxScalarBarVisibilityChanged(int)), this, SLOT(onScalarBarVisibilityChanged(int)) );
+ QObject::connect( _paramWidget, SIGNAL(checkboxCustomRangeChanged(int)), this, SLOT(onUseCustomRangeChanged(int)));
+ QObject::connect( _paramWidget, SIGNAL(spinboxCustomRangeChanged(double, double)), this, SLOT(onCustomRangeValueChanged(double, double)));
+ QObject::connect( _paramWidget, SIGNAL(checkboxHideDataOutsideCustomRangeChanged(int)), this, SLOT(onHideDataOutsideCustomRangeChanged(int)));
+ }
}
void MEDWidgetHelper::releaseWidget()
_presController, SIGNAL(presentationSignal(const PresentationEvent *)) );
QObject::disconnect( _paramWidget, SIGNAL(comboScalarBarRangeIndexChanged(int)), this, SLOT(onScalarBarRangeChanged(int)) );
QObject::disconnect( _paramWidget, SIGNAL(comboColorMapIndexChanged(int)), this, SLOT(onColorMapChanged(int)) );
+ QObject::disconnect( _paramWidget, SIGNAL(checkboxScalarBarVisibilityChanged(int)), this, SLOT(onScalarBarVisibilityChanged(int)));
+ QObject::disconnect( _paramWidget, SIGNAL(checkboxCustomRangeChanged(int)), this, SLOT(onUseCustomRangeChanged(int)));
+ QObject::disconnect( _paramWidget, SIGNAL(spinboxCustomRangeChanged(double, double)), this, SLOT(onCustomRangeChanged(double, double)));
+ QObject::disconnect( _paramWidget, SIGNAL(checkboxHideDataOutsideCustomRangeChanged(int)), this, SLOT(onHideDataOutsideCustomRangeChanged(int)));
+
+
// Reset default for color map and scalar bar range
_paramWidget->setColorMap(MEDCALC::COLOR_MAP_DEFAULT);
_paramWidget->setScalarBarRange(MEDCALC::SCALAR_BAR_RANGE_DEFAULT);
}
+void MEDWidgetHelper::onScalarBarVisibilityChanged(int flag) {
+ STDLOG("MEDWidgetHelper::onScalarBarVisibilityChanged");
+ PresentationEvent* event = new PresentationEvent();
+ event->eventtype = PresentationEvent::EVENT_SCALAR_BAR_VISIBILITY_CHANGED;
+ event->presentationId = _presId;
+ event->anInteger = flag;
+
+ emit presentationUpdateSignal(event); // --> PresentationController::processPresentationEvent
+}
+
void MEDWidgetHelper::onComponentChanged(int idx)
{
STDLOG("MEDWidgetHelper::onComponentChanged");
emit presentationUpdateSignal(event); // --> PresentationController::processPresentationEvent
}
+
+void MEDWidgetHelper::onUseCustomRangeChanged(int flag) {
+ STDLOG("MEDWidgetHelper::onUseCustomRangeChanged");
+ PresentationEvent* event = new PresentationEvent();
+ event->eventtype = PresentationEvent::EVENT_CHANGE_TIME_RANGE;
+ event->presentationId = _presId;
+ event->anInteger = flag ? _paramWidget->getRangeComboBox()->count() : _paramWidget->getRangeComboBox()->currentIndex();
+ event->aDouble1 = _paramWidget->getMixCustomRange();
+ event->aDouble2 = _paramWidget->getMaxCustomRange();
+
+ emit presentationUpdateSignal(event); // --> PresentationController::processPresentationEvent
+}
+
+void MEDWidgetHelper::onCustomRangeValueChanged(double min, double max) {
+ STDLOG("MEDWidgetHelper::onCustomRangeChanged");
+ PresentationEvent* event = new PresentationEvent();
+ event->eventtype = PresentationEvent::EVENT_CUSTOM_RANGE_CHANGED;
+ event->presentationId = _presId;
+ event->aDouble1 = min;
+ event->aDouble2 = max;
+
+ emit presentationUpdateSignal(event); // --> PresentationController::processPresentationEvent
+}
+
+void MEDWidgetHelper::onHideDataOutsideCustomRangeChanged(int flag) {
+ STDLOG("MEDWidgetHelper::onCustomRangeFlagChanged");
+ PresentationEvent* event = new PresentationEvent();
+ event->eventtype = PresentationEvent::EVENT_HIDE_DATA_OUTSIDE_CUSTOM_RANGE_CHANGED;
+ event->presentationId = _presId;
+ event->anInteger = flag;
+ event->aDouble1 = _paramWidget->getMixCustomRange();
+ event->aDouble2 = _paramWidget->getMaxCustomRange();
+
+ emit presentationUpdateSignal(event); // --> PresentationController::processPresentationEvent
+}
\ No newline at end of file