From 2db495662fcfc3c3a1cefa7361488fa553d0c3fb Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Wed, 4 Jul 2018 13:44:35 +0200 Subject: [PATCH] Use only the current step to for 3d well log curve range when follow current time step is off --- .../Rim3dWellLogExtractionCurve.cpp | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp index 5b7caaa934..dfc0159ce5 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp @@ -51,6 +51,8 @@ #include +#include + //================================================================================================== /// /// @@ -232,11 +234,25 @@ std::pair Rim3dWellLogExtractionCurve::findCurveValueRange() double foundMinValue = std::numeric_limits::infinity(); double foundMaxValue = -std::numeric_limits::infinity(); - for (int i = 0; i < m_case->timeStepStrings().size(); ++i) + std::set timeStepsToCheck; + if (followAnimationTimeStep()) + { + // Check all time steps to avoid range changing during animation. + for (int i = 0; i < m_case->timeStepStrings().size(); ++i) + { + timeStepsToCheck.insert(i); + } + } + else + { + timeStepsToCheck.insert(m_timeStep()); + } + + for (int timeStep : timeStepsToCheck) { std::vector values; std::vector measuredDepths; - this->curveValuesAndMdsAtTimeStep(&values, &measuredDepths, int(i)); + this->curveValuesAndMdsAtTimeStep(&values, &measuredDepths, timeStep); for (double value : values) { @@ -245,7 +261,7 @@ std::pair Rim3dWellLogExtractionCurve::findCurveValueRange() foundMinValue = std::min(foundMinValue, value); foundMaxValue = std::max(foundMaxValue, value); } - } + } } return std::make_pair(foundMinValue, foundMaxValue); }