mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-26 16:26:48 -06:00
#3085 Ensemble curve filters. Display info label when filters are hiding some curves
This commit is contained in:
parent
bb2e136df7
commit
e77ff07685
@ -25,6 +25,7 @@
|
||||
class EnsembleParameter;
|
||||
class RimEnsembleCurveSet;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryPlot;
|
||||
class RimEnsembleCurveFilterCollection;
|
||||
|
||||
//==================================================================================================
|
||||
|
@ -175,6 +175,7 @@ RimEnsembleCurveSet::RimEnsembleCurveSet()
|
||||
m_ensembleStatCase->createSummaryReaderInterface();
|
||||
|
||||
m_disableStatisticCurves = false;
|
||||
m_isCurveSetFiltered = false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -937,6 +938,8 @@ void RimEnsembleCurveSet::updateEnsembleCurves()
|
||||
m_yValuesSummaryFilter->updateFromAddress(addr->address());
|
||||
|
||||
if (plot->qwtPlot()) m_qwtPlotCurveForLegendText->attach(plot->qwtPlot());
|
||||
|
||||
m_isCurveSetFiltered = filteredCases.size() < group->allSummaryCases().size();
|
||||
}
|
||||
|
||||
RimSummaryPlot* plot;
|
||||
@ -946,6 +949,7 @@ void RimEnsembleCurveSet::updateEnsembleCurves()
|
||||
plot->qwtPlot()->updateLegend();
|
||||
plot->qwtPlot()->replot();
|
||||
plot->updateAxes();
|
||||
plot->updatePlotInfoLabel();
|
||||
}
|
||||
}
|
||||
updateCurveColors();
|
||||
@ -1105,6 +1109,14 @@ void RimEnsembleCurveSet::disableStatisticCurves()
|
||||
m_disableStatisticCurves = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEnsembleCurveSet::isFiltered() const
|
||||
{
|
||||
return m_isCurveSetFiltered;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -108,6 +108,7 @@ public:
|
||||
|
||||
std::vector<RimSummaryCase*> filterEnsembleCases(const RimSummaryCaseCollection* ensemble);
|
||||
void disableStatisticCurves();
|
||||
bool isFiltered() const;
|
||||
|
||||
bool hasP10Data() const;
|
||||
bool hasP50Data() const;
|
||||
@ -174,5 +175,6 @@ private:
|
||||
std::unique_ptr<RimEnsembleStatisticsCase> m_ensembleStatCase;
|
||||
|
||||
bool m_disableStatisticCurves;
|
||||
bool m_isCurveSetFiltered;
|
||||
};
|
||||
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include "qwt_legend.h"
|
||||
#include "qwt_plot_curve.h"
|
||||
#include "qwt_plot_renderer.h"
|
||||
#include "qwt_plot_textlabel.h"
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QString>
|
||||
@ -185,6 +186,8 @@ RimSummaryPlot::RimSummaryPlot()
|
||||
m_isCrossPlot = false;
|
||||
|
||||
m_nameHelperAllCurves.reset(new RimSummaryPlotNameHelper);
|
||||
|
||||
setPlotInfoLabel("Filters Active");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -470,6 +473,49 @@ void RimSummaryPlot::updateAll()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::setPlotInfoLabel(const QString& label)
|
||||
{
|
||||
auto qwtText = QwtText(label);
|
||||
qwtText.setRenderFlags(Qt::AlignBottom | Qt::AlignRight);
|
||||
|
||||
QFont font;
|
||||
font.setBold(true);
|
||||
qwtText.setFont(font);
|
||||
|
||||
m_plotInfoLabel.reset(new QwtPlotTextLabel());
|
||||
m_plotInfoLabel->setText(qwtText);
|
||||
m_plotInfoLabel->setMargin(30);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::showPlotInfoLabel(bool show)
|
||||
{
|
||||
if (show) m_plotInfoLabel->attach(m_qwtPlot);
|
||||
else m_plotInfoLabel->detach();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::updatePlotInfoLabel()
|
||||
{
|
||||
bool anyCurveSetFiltered = false;
|
||||
for (auto group : m_ensembleCurveSetCollection->curveSets())
|
||||
{
|
||||
if (group->isFiltered())
|
||||
{
|
||||
anyCurveSetFiltered = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
showPlotInfoLabel(anyCurveSetFiltered);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include "RimViewWindow.h"
|
||||
|
||||
#include "qwt_plot_textlabel.h"
|
||||
#include <QPointer>
|
||||
|
||||
#include <set>
|
||||
@ -121,6 +122,10 @@ public:
|
||||
|
||||
void updateAll();
|
||||
|
||||
void setPlotInfoLabel(const QString& label);
|
||||
void showPlotInfoLabel(bool show);
|
||||
void updatePlotInfoLabel();
|
||||
|
||||
// RimViewWindow overrides
|
||||
public:
|
||||
virtual QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||
@ -183,7 +188,7 @@ private:
|
||||
caf::PdmChildField<RimSummaryTimeAxisProperties*> m_timeAxisProperties;
|
||||
|
||||
QPointer<RiuSummaryQwtPlot> m_qwtPlot;
|
||||
|
||||
std::unique_ptr<QwtPlotTextLabel> m_plotInfoLabel;
|
||||
|
||||
bool m_isCrossPlot;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user