mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3872 Summary Plot : Move last activated curve on top within category
This commit is contained in:
parent
9c750c5287
commit
f36d0eeee7
@ -142,6 +142,9 @@ RimSummaryCurve::RimSummaryCurve()
|
||||
|
||||
m_curveNameConfig = new RimSummaryCurveAutoName;
|
||||
|
||||
CAF_PDM_InitField(&m_isTopZWithinCategory, "isTopZWithinCategory", false, "", "", "", "");
|
||||
m_isTopZWithinCategory.uiCapability()->setUiHidden(true);
|
||||
|
||||
m_symbolSkipPixelDistance = 10.0f;
|
||||
m_curveThickness = 2;
|
||||
}
|
||||
@ -670,25 +673,34 @@ void RimSummaryCurve::setZIndexFromCurveInfo()
|
||||
auto sumAddr = summaryAddressY();
|
||||
auto sumCase = summaryCaseY();
|
||||
|
||||
double zOrder = 0.0;
|
||||
|
||||
if (sumCase && sumAddr.isValid())
|
||||
{
|
||||
if (sumCase->isObservedData())
|
||||
{
|
||||
setZOrder(RiuQwtPlotCurve::Z_SINGLE_CURVE_OBSERVED);
|
||||
zOrder = RiuQwtPlotCurve::Z_SINGLE_CURVE_OBSERVED;
|
||||
}
|
||||
else if (sumAddr.category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS)
|
||||
{
|
||||
setZOrder(RiuQwtPlotCurve::Z_ENSEMBLE_STAT_CURVE);
|
||||
zOrder = RiuQwtPlotCurve::Z_ENSEMBLE_STAT_CURVE;
|
||||
}
|
||||
else if (sumCase->ensemble())
|
||||
{
|
||||
setZOrder(RiuQwtPlotCurve::Z_ENSEMBLE_CURVE);
|
||||
zOrder = RiuQwtPlotCurve::Z_ENSEMBLE_CURVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
setZOrder(RiuQwtPlotCurve::Z_SINGLE_CURVE_NON_OBSERVED);
|
||||
zOrder = RiuQwtPlotCurve::Z_SINGLE_CURVE_NON_OBSERVED;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_isTopZWithinCategory)
|
||||
{
|
||||
zOrder += 1.0;
|
||||
}
|
||||
|
||||
setZOrder(zOrder);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -778,6 +790,14 @@ void RimSummaryCurve::markCachedDataForPurge()
|
||||
if(reader) reader->markForCachePurge(m_yValuesCurveVariable->address());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurve::setAsTopZWithinCategory(bool enable)
|
||||
{
|
||||
m_isTopZWithinCategory = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -816,6 +836,11 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
|
||||
RiuPlotMainWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
||||
mainPlotWindow->updateSummaryPlotToolBar();
|
||||
|
||||
if (m_showCurve() == true)
|
||||
{
|
||||
plot->summaryCurveCollection()->setCurveAsTopZWithinCategory(this);
|
||||
}
|
||||
}
|
||||
else if (changedField == &m_plotAxis)
|
||||
{
|
||||
|
@ -80,6 +80,9 @@ public:
|
||||
void forceUpdateCurveAppearanceFromCaseType();
|
||||
|
||||
void markCachedDataForPurge();
|
||||
|
||||
void setAsTopZWithinCategory(bool enable);
|
||||
void setZIndexFromCurveInfo();
|
||||
|
||||
protected:
|
||||
// RimPlotCurve overrides
|
||||
@ -106,7 +109,6 @@ private:
|
||||
static void appendOptionItemsForSummaryAddresses(QList<caf::PdmOptionItemInfo>* options,
|
||||
RimSummaryCase* summaryCase,
|
||||
RimSummaryFilter* summaryFilter);
|
||||
void setZIndexFromCurveInfo();
|
||||
|
||||
private:
|
||||
// Y values
|
||||
@ -127,4 +129,5 @@ private:
|
||||
|
||||
caf::PdmChildField<RimSummaryCurveAutoName*> m_curveNameConfig;
|
||||
caf::PdmField<caf::AppEnum< RiaDefines::PlotAxis>> m_plotAxis;
|
||||
caf::PdmField<bool> m_isTopZWithinCategory;
|
||||
};
|
||||
|
@ -335,6 +335,26 @@ void RimSummaryCurveCollection::handleKeyPressEvent(QKeyEvent* keyEvent)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveCollection::setCurveAsTopZWithinCategory(RimSummaryCurve* curve)
|
||||
{
|
||||
for (const auto& c : m_curves)
|
||||
{
|
||||
if (c == curve)
|
||||
{
|
||||
c->setAsTopZWithinCategory(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
c->setAsTopZWithinCategory(false);
|
||||
}
|
||||
|
||||
c->setZIndexFromCurveInfo();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -67,6 +67,8 @@ public:
|
||||
|
||||
void handleKeyPressEvent(QKeyEvent* keyEvent);
|
||||
|
||||
void setCurveAsTopZWithinCategory(RimSummaryCurve* curve);
|
||||
|
||||
private:
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void defineObjectEditorAttribute(QString uiConfigName,
|
||||
|
Loading…
Reference in New Issue
Block a user