From 6a2484c40ecf566f7d0dd6f407cabf6575199a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Jensen?= Date: Wed, 5 Dec 2018 09:35:05 +0100 Subject: [PATCH] #3826 Summary curves. Draw error bars in front of all curves except from observed data curves --- .../Summary/RimSummaryCurve.cpp | 17 ++++------------- .../UserInterface/RiuQwtPlotCurve.cpp | 1 + ApplicationCode/UserInterface/RiuQwtPlotCurve.h | 10 ++++++++++ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index fbc1cc8630..8621556562 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -667,15 +667,6 @@ void RimSummaryCurve::appendOptionItemsForSummaryAddresses(QListisObservedData()) { - setZOrder(Z_SINGLE_CURVE_OBSERVED); + setZOrder(RiuQwtPlotCurve::Z_SINGLE_CURVE_OBSERVED); } else if (sumAddr.category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS) { - setZOrder(Z_ENSEMBLE_STAT_CURVE); + setZOrder(RiuQwtPlotCurve::Z_ENSEMBLE_STAT_CURVE); } else if (sumCase->ensemble()) { - setZOrder(Z_ENSEMBLE_CURVE); + setZOrder(RiuQwtPlotCurve::Z_ENSEMBLE_CURVE); } else { - setZOrder(Z_SINGLE_CURVE_NON_OBSERVED); + setZOrder(RiuQwtPlotCurve::Z_SINGLE_CURVE_NON_OBSERVED); } } } diff --git a/ApplicationCode/UserInterface/RiuQwtPlotCurve.cpp b/ApplicationCode/UserInterface/RiuQwtPlotCurve.cpp index 3b2fb9c8c1..60f97cf916 100644 --- a/ApplicationCode/UserInterface/RiuQwtPlotCurve.cpp +++ b/ApplicationCode/UserInterface/RiuQwtPlotCurve.cpp @@ -55,6 +55,7 @@ RiuQwtPlotCurve::RiuQwtPlotCurve(const QString &title) m_errorBars->setStyle(QwtPlotIntervalCurve::CurveStyle::NoCurve); m_errorBars->setSymbol(new QwtIntervalSymbol(QwtIntervalSymbol::Bar)); m_errorBars->setItemAttribute(QwtPlotItem::Legend, false); + m_errorBars->setZ(Z_ERROR_BARS); m_showErrorBars = true; m_attachedToPlot = nullptr; diff --git a/ApplicationCode/UserInterface/RiuQwtPlotCurve.h b/ApplicationCode/UserInterface/RiuQwtPlotCurve.h index 6d483db3f2..ac0d3a4e33 100644 --- a/ApplicationCode/UserInterface/RiuQwtPlotCurve.h +++ b/ApplicationCode/UserInterface/RiuQwtPlotCurve.h @@ -63,6 +63,16 @@ public: STYLE_DASH_DOT }; + // Z index. Higher Z is painted in front + enum ZIndex + { + Z_ENSEMBLE_CURVE = 100, + Z_ENSEMBLE_STAT_CURVE = 200, + Z_SINGLE_CURVE_NON_OBSERVED = 300, + Z_ERROR_BARS = 400, + Z_SINGLE_CURVE_OBSERVED = 500 + }; + public: explicit RiuQwtPlotCurve(const QString &title = QString::null); ~RiuQwtPlotCurve() override;