From b5adc088f7ba0db3e390b67074068ee86b121a2a Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Wed, 6 Dec 2023 15:07:44 +0000 Subject: [PATCH] Issue with contour-min/max and contour_shade_min/max --- src/visualisers/LevelListSelectionType.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/visualisers/LevelListSelectionType.cc b/src/visualisers/LevelListSelectionType.cc index ae5338cb..3fb3d49c 100644 --- a/src/visualisers/LevelListSelectionType.cc +++ b/src/visualisers/LevelListSelectionType.cc @@ -45,12 +45,17 @@ void LevelListSelectionType::print(ostream& out) const { void LevelListSelectionType::calculate(double min, double max, bool shading) { clear(); +// Here have to take into account contour_min/max and comtour_shade_min/max : we take the max of the min and the min of the max. + + double use_min = ( shade_min_ > min_ ) ? shade_min_ : min_; + double use_max = ( shade_max_ < max_ ) ? shade_max_ : max_; + doublearray::const_iterator last = list_.begin(); - double prevVal = min_; + double prevVal = use_min; for (doublearray::const_iterator val = list_.begin(); val != list_.end(); ++val) { MagLog::dev() << "LevelListSelectionType::calculate(double min, double max)--->" << *val << "\n"; - if (min_ <= *val && *val <= max_) { + if (use_min <= *val && *val <= use_max) { if (*val < prevVal) { MagLog::error() << " level list values should increase, but " << *val << " follows " << prevVal << endl; break;