Commit 44752931 authored by Marc R.'s avatar Marc R.

Merge branch '225-horizontal-cross-section-line-contours-disapear' into 'master'

Resolve "Horizontal and Vertical Cross-Section: Line Contours disappear"

Closes #225

See merge request !206
parents 2e8ad287 b6ed6ab6
......@@ -2872,7 +2872,8 @@ bool MNWP2DSectionActorVariable::parseContourLevelString(
if (step > 0)
for (double d = from; d <= to; d += step) *contourSet << d;
else if (step < 0)
for (double d = from; d >= to; d += step) *contourSet << d;
// Sort iso values by ascending order (reason see below).
for (double d = to; d <= from; d -= step) *contourSet << d;
contours->stopIndex = contourSet->size();
return true;
......@@ -2885,6 +2886,11 @@ bool MNWP2DSectionActorVariable::parseContourLevelString(
for (int i = 0; i < listValues.size(); i++)
*contourSet << listValues.value(i).toDouble(&ok);
// Sort contour levels to avoid all levels disappearing if the user
// ends the sequence with a iso value smaller than the minimum value of
// the data field or starts the sequence with a level greater than the
// maximum.
std::sort(contourSet->begin(), contourSet->end());
contours->stopIndex = contourSet->size();
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment