#3085 Ensemble curve filters. Display info label when filters are hiding some curves

This commit is contained in:
Bjørn Erik Jensen 2018-06-27 13:10:39 +02:00
parent bb2e136df7
commit e77ff07685
5 changed files with 67 additions and 1 deletions

View File

@ -25,6 +25,7 @@
class EnsembleParameter;
class RimEnsembleCurveSet;
class RimSummaryCase;
class RimSummaryPlot;
class RimEnsembleCurveFilterCollection;
//==================================================================================================

View File

@ -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;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -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;
};

View File

@ -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);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -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;