#2657 WIP: Add movable widget with color legend for ensemble curve sets to summary plot

This commit is contained in:
Jacob Støren
2018-04-18 15:58:49 +02:00
parent e468227dfe
commit 53a6e0e502
9 changed files with 443 additions and 0 deletions

View File

@@ -145,6 +145,13 @@ RimEnsambleCurveSet::RimEnsambleCurveSet()
RimEnsambleCurveSet::~RimEnsambleCurveSet()
{
m_curves.deleteAllChildObjects();
RimSummaryPlot* parentPlot;
firstAncestorOrThisOfTypeAsserted(parentPlot);
if (parentPlot->qwtPlot())
{
parentPlot->qwtPlot()->removeEnsambleCurveSetLegend(this);
}
}
//--------------------------------------------------------------------------------------------------
@@ -185,6 +192,15 @@ void RimEnsambleCurveSet::loadDataAndUpdate(bool updateParentPlot)
parentPlot->qwtPlot()->updateLegend();
parentPlot->updateAxes();
parentPlot->updateZoomInQwt();
if (m_showCurves() && m_colorMode() == BY_ENSAMBLE_PARAM)
{
parentPlot->qwtPlot()->addOrUpdateEnsambleCurveSetLegend(this);
}
else
{
parentPlot->qwtPlot()->removeEnsambleCurveSetLegend(this);
}
}
}
}
@@ -422,6 +438,14 @@ void RimEnsambleCurveSet::handleKeyPressEvent(QKeyEvent* keyEvent)
//}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimRegularLegendConfig* RimEnsambleCurveSet::legendConfig()
{
return m_legendConfig;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -79,6 +79,7 @@ public:
//std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
void handleKeyPressEvent(QKeyEvent* keyEvent);
RimRegularLegendConfig* legendConfig();
private:
caf::PdmFieldHandle* objectToggleField();