#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

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