Skip to content

Commit

Permalink
Issue with contour-min/max and contour_shade_min/max
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvielamythepaut committed Dec 6, 2023
1 parent 66a126f commit b5adc08
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/visualisers/LevelListSelectionType.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b5adc08

Please sign in to comment.