From 5efd60c227286a16751d704b2678b7db8868ee1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Sun, 12 Nov 2017 23:51:08 +0100 Subject: [PATCH] #2135 Fix broken drawing order of WellFlowRateCurves. Add group awareness to the drawing order. Higher groupids are drawn on top. --- .../ProjectDataModel/Flow/RimWellFlowRateCurve.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp index 95cea77cdc..c7d3af2c03 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellFlowRateCurve.cpp @@ -217,6 +217,8 @@ void RimWellFlowRateCurve::updateStackedPlotData() std::vector depthValues; std::vector stackedValues; std::vector< std::pair > polyLineStartStopIndices; + double zPos = -10000.0 + 100*groupId(); // Z-position of curve, to draw them in correct order hiding the things behind + // Starting way behind the grid (z == 0) at -10000 giving room for 100 groups with 100 curves each before getting above the grid { std::map> stackedCurveGroups = wellLogTrack->visibleStackedCurves(); @@ -230,7 +232,6 @@ void RimWellFlowRateCurve::updateStackedPlotData() std::vector allDepthValues = m_curveData->measuredDepths(); std::vector allStackedValues(allDepthValues.size()); - double zPos = -0.1; for (RimWellFlowRateCurve * stCurve : stackedCurves) { std::vector allValues = stCurve->curveData()->xValues(); @@ -255,8 +256,6 @@ void RimWellFlowRateCurve::updateStackedPlotData() polyLineStartStopIndices = tempCurveData.polylineStartStopIndices(); } - double zPos = -0.1; - // Insert the first depth position again, to add a value pair if ( depthValues.size() ) // Should we really do this for all curve variants ? @@ -302,7 +301,7 @@ void RimWellFlowRateCurve::updateStackedPlotData() m_qwtPlotCurve->setSamples(stackedValues.data(), depthValues.data(), static_cast(depthValues.size())); m_qwtPlotCurve->setLineSegmentStartStopIndices(polyLineStartStopIndices); - m_qwtPlotCurve->setZ(doFillCurve() ? zPos : zPos + 10 /*?*/); + m_qwtPlotCurve->setZ(zPos); } //--------------------------------------------------------------------------------------------------