mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3338 Keep order of summary plot curves if you uncheck and check back curves.
This commit is contained in:
parent
612409ac59
commit
bd9d1be3c2
@ -260,6 +260,26 @@ void RimEnsembleCurveSet::detachQwtCurves()
|
|||||||
m_qwtPlotCurveForLegendText->detach();
|
m_qwtPlotCurveForLegendText->detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEnsembleCurveSet::reattachQwtCurves()
|
||||||
|
{
|
||||||
|
for (RimSummaryCurve* curve : m_curves)
|
||||||
|
{
|
||||||
|
curve->reattachQwtCurve();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_qwtPlotCurveForLegendText->detach();
|
||||||
|
|
||||||
|
RimSummaryPlot* plot = nullptr;
|
||||||
|
firstAncestorOrThisOfType(plot);
|
||||||
|
if (plot)
|
||||||
|
{
|
||||||
|
m_qwtPlotCurveForLegendText->attach(plot->qwtPlot());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -74,6 +74,7 @@ public:
|
|||||||
void loadDataAndUpdate(bool updateParentPlot);
|
void loadDataAndUpdate(bool updateParentPlot);
|
||||||
void setParentQwtPlotNoReplot(QwtPlot* plot);
|
void setParentQwtPlotNoReplot(QwtPlot* plot);
|
||||||
void detachQwtCurves();
|
void detachQwtCurves();
|
||||||
|
void reattachQwtCurves();
|
||||||
|
|
||||||
void addCurve(RimSummaryCurve* curve);
|
void addCurve(RimSummaryCurve* curve);
|
||||||
void deleteCurve(RimSummaryCurve* curve);
|
void deleteCurve(RimSummaryCurve* curve);
|
||||||
|
@ -110,6 +110,17 @@ void RimEnsembleCurveSetCollection::detachQwtCurves()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEnsembleCurveSetCollection::reattachQwtCurves()
|
||||||
|
{
|
||||||
|
for (const auto& curveSet : m_curveSets)
|
||||||
|
{
|
||||||
|
curveSet->reattachQwtCurves();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -44,6 +44,7 @@ public:
|
|||||||
void loadDataAndUpdate(bool updateParentPlot);
|
void loadDataAndUpdate(bool updateParentPlot);
|
||||||
void setParentQwtPlotAndReplot(QwtPlot* plot);
|
void setParentQwtPlotAndReplot(QwtPlot* plot);
|
||||||
void detachQwtCurves();
|
void detachQwtCurves();
|
||||||
|
void reattachQwtCurves();
|
||||||
|
|
||||||
RimEnsembleCurveSet* findRimCurveSetFromQwtCurve(const QwtPlotCurve* qwtCurve) const;
|
RimEnsembleCurveSet* findRimCurveSetFromQwtCurve(const QwtPlotCurve* qwtCurve) const;
|
||||||
|
|
||||||
|
@ -550,6 +550,16 @@ void RimSummaryCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
|||||||
if (updateParentPlot) updateQwtPlotAxis();
|
if (updateParentPlot) updateQwtPlotAxis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryCurve::updateLegendsInPlot()
|
||||||
|
{
|
||||||
|
RimSummaryPlot* plot = nullptr;
|
||||||
|
firstAncestorOrThisOfTypeAsserted(plot);
|
||||||
|
plot->updateAllLegendItems();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -85,6 +85,9 @@ protected:
|
|||||||
virtual void updateZoomInParentPlot() override;
|
virtual void updateZoomInParentPlot() override;
|
||||||
virtual void onLoadDataAndUpdate(bool updateParentPlot) override;
|
virtual void onLoadDataAndUpdate(bool updateParentPlot) override;
|
||||||
|
|
||||||
|
|
||||||
|
virtual void updateLegendsInPlot() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RifSummaryReaderInterface* valuesSummaryReaderX() const;
|
RifSummaryReaderInterface* valuesSummaryReaderX() const;
|
||||||
RifSummaryReaderInterface* valuesSummaryReaderY() const;
|
RifSummaryReaderInterface* valuesSummaryReaderY() const;
|
||||||
|
@ -133,6 +133,17 @@ void RimSummaryCurveCollection::detachQwtCurves()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryCurveCollection::reattachQwtCurves()
|
||||||
|
{
|
||||||
|
for (RimSummaryCurve* curve : m_curves)
|
||||||
|
{
|
||||||
|
curve->reattachQwtCurve();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -48,6 +48,7 @@ public:
|
|||||||
void loadDataAndUpdate(bool updateParentPlot);
|
void loadDataAndUpdate(bool updateParentPlot);
|
||||||
void setParentQwtPlotAndReplot(QwtPlot* plot);
|
void setParentQwtPlotAndReplot(QwtPlot* plot);
|
||||||
void detachQwtCurves();
|
void detachQwtCurves();
|
||||||
|
void reattachQwtCurves();
|
||||||
|
|
||||||
RimSummaryCurve* findRimCurveFromQwtCurve(const QwtPlotCurve* qwtCurve) const;
|
RimSummaryCurve* findRimCurveFromQwtCurve(const QwtPlotCurve* qwtCurve) const;
|
||||||
|
|
||||||
|
@ -479,6 +479,15 @@ void RimSummaryPlot::updateAll()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryPlot::updateAllLegendItems()
|
||||||
|
{
|
||||||
|
reattachAllCurves();
|
||||||
|
qwtPlot()->updateLegend();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -1573,6 +1582,29 @@ void RimSummaryPlot::detachAllCurves()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryPlot::reattachAllCurves()
|
||||||
|
{
|
||||||
|
if (m_summaryCurveCollection)
|
||||||
|
{
|
||||||
|
m_summaryCurveCollection->reattachQwtCurves();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ensembleCurveSetCollection->reattachQwtCurves();
|
||||||
|
|
||||||
|
for (RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves)
|
||||||
|
{
|
||||||
|
curve->reattachQwtCurve();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (RimAsciiDataCurve* curve : m_asciiDataCurves)
|
||||||
|
{
|
||||||
|
curve->reattachQwtCurve();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -87,6 +87,7 @@ public:
|
|||||||
size_t curveCount() const;
|
size_t curveCount() const;
|
||||||
|
|
||||||
void detachAllCurves();
|
void detachAllCurves();
|
||||||
|
void reattachAllCurves();
|
||||||
void updateCaseNameHasChanged();
|
void updateCaseNameHasChanged();
|
||||||
|
|
||||||
void updateAxes();
|
void updateAxes();
|
||||||
@ -123,13 +124,13 @@ public:
|
|||||||
void copyAxisPropertiesFromOther(const RimSummaryPlot& sourceSummaryPlot);
|
void copyAxisPropertiesFromOther(const RimSummaryPlot& sourceSummaryPlot);
|
||||||
|
|
||||||
void updateAll();
|
void updateAll();
|
||||||
|
void updateAllLegendItems();
|
||||||
|
|
||||||
void setPlotInfoLabel(const QString& label);
|
void setPlotInfoLabel(const QString& label);
|
||||||
void showPlotInfoLabel(bool show);
|
void showPlotInfoLabel(bool show);
|
||||||
void updatePlotInfoLabel();
|
void updatePlotInfoLabel();
|
||||||
|
|
||||||
bool containsResamplableCurves() const;
|
bool containsResamplableCurves() const;
|
||||||
|
|
||||||
// RimViewWindow overrides
|
// RimViewWindow overrides
|
||||||
public:
|
public:
|
||||||
virtual QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
virtual QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||||
|
Loading…
Reference in New Issue
Block a user