X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCalc%2Fcmp%2FMEDPresentation.txx;fp=src%2FMEDCalc%2Fcmp%2FMEDPresentation.txx;h=79172f408ba7245e6bd0967bc28b246ba166c8fa;hb=9a9f81053e1e8fa736b90baf2843b49e6df8af81;hp=8fcca7999f3d85e1348865cf7dd015ef3980a5a6;hpb=12e72b16e927a491139cde26adf98395bf222ce1;p=modules%2Fmed.git diff --git a/src/MEDCalc/cmp/MEDPresentation.txx b/src/MEDCalc/cmp/MEDPresentation.txx index 8fcca7999..79172f408 100644 --- a/src/MEDCalc/cmp/MEDPresentation.txx +++ b/src/MEDCalc/cmp/MEDPresentation.txx @@ -122,24 +122,90 @@ MEDPresentation::updateColorMap(MEDCALC::ColorMapType colorMap) template void -MEDPresentation::updateScalarBarRange(MEDCALC::ScalarBarRangeType sbRange) +MEDPresentation::updateScalarBarRange(MEDCALC::ScalarBarRangeType sbRange, + bool hideDataOutsideCustomRange, + double minValue, double maxValue) { PresentationType * p = static_cast(this); - PresentationParameters params; p->getParameters(params); + bool prevHideDataoutsideCustomRange = params.hideDataOutsideCustomRange; + params.scalarBarRange = sbRange; + params.scalarBarRangeArray[0] = minValue; + params.scalarBarRangeArray[1] = maxValue; + params.hideDataOutsideCustomRange = hideDataOutsideCustomRange; p->setParameters(params); p->_sbRange = sbRange; + p->_scalarBarRangeArray[0] = minValue; + p->_scalarBarRangeArray[1] = maxValue; + p->_hideDataOutsideCustomRange = hideDataOutsideCustomRange; // GUI helper: setIntProperty(MEDPresentation::PROP_SCALAR_BAR_RANGE, sbRange); + setDoubleProperty(MEDPresentation::PROP_SCALAR_BAR_MIN_VALUE, minValue); + setDoubleProperty(MEDPresentation::PROP_SCALAR_BAR_MAX_VALUE, maxValue); + setIntProperty(MEDPresentation::PROP_HIDE_DATA_OUTSIDE_CUSTOM_RANGE, static_cast(hideDataOutsideCustomRange)); + + // Update the pipeline: + if (hideDataOutsideCustomRange || hideDataOutsideCustomRange != prevHideDataoutsideCustomRange) { + MEDPyLockWrapper lock; + threshold(); //Swith on/off threshould or update threshould range + pushAndExecPyLine("pvs.Render();"); + } + else + { + MEDPyLockWrapper lock; + rescaleTransferFunction(); + pushAndExecPyLine("pvs.Render();"); + } +} + +template +void +MEDPresentation::updateVisibility(const bool theVisibility) +{ + PresentationType * p = static_cast(this); + + PresentationParameters params; + p->getParameters(params); + params.visibility = theVisibility; + p->setParameters(params); + + p->_presentationVisibility = theVisibility; + + // GUI helper: + setIntProperty(MEDPresentation::PROP_VISIBILITY, theVisibility); // Update the pipeline: { MEDPyLockWrapper lock; - rescaleTransferFunction(); + visibility(); + pushAndExecPyLine("pvs.Render();"); + } +} + +template +void +MEDPresentation::updateScalarBarVisibility(const bool theVisibility) +{ + PresentationType * p = static_cast(this); + + PresentationParameters params; + p->getParameters(params); + params.scalarBarVisibility = theVisibility; + p->setParameters(params); + + p->_scalarBarVisibility = theVisibility; + + // GUI helper: + setIntProperty(MEDPresentation::PROP_SCALAR_BAR_VISIBILITY, theVisibility); + + // Update the pipeline: + { + MEDPyLockWrapper lock; + scalarBarVisibility(); pushAndExecPyLine("pvs.Render();"); } }