#3187 symbols and labels for well path attributes, initial work.

This commit is contained in:
Gaute Lindkvist
2018-08-30 14:03:58 +02:00
parent 46c5bbf4c6
commit adc9ad322a
16 changed files with 472 additions and 62 deletions

View File

@@ -28,7 +28,6 @@
#include "RimSummaryPlot.h"
#include "RiuRimQwtPlotCurve.h"
#include "RiuLineSegmentQwtPlotCurve.h"
#include "cafPdmUiComboBoxEditor.h"
@@ -84,6 +83,7 @@ void RimPlotCurve::CurveInterpolation::setUp()
///
//--------------------------------------------------------------------------------------------------
RimPlotCurve::RimPlotCurve()
: m_symbolLabelPosition(RiuCurveQwtSymbol::LabelAboveSymbol)
{
CAF_PDM_InitObject("Curve", ":/WellLogCurve16x16.png", "", "");
@@ -476,7 +476,7 @@ void RimPlotCurve::updateCurveAppearance()
}
// QwtPlotCurve will take ownership of the symbol
symbol = new RiuCurveQwtSymbol(style, m_symbolLabel);
symbol = new RiuCurveQwtSymbol(style, m_symbolLabel, m_symbolLabelPosition);
symbol->setSize(m_symbolSize, m_symbolSize);
symbol->setColor(curveColor);
@@ -584,6 +584,44 @@ void RimPlotCurve::loadDataAndUpdate(bool updateParentPlot)
this->onLoadDataAndUpdate(updateParentPlot);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimPlotCurve::xValueRange(double* minimumValue, double* maximumValue) const
{
CVF_ASSERT(minimumValue && maximumValue);
CVF_ASSERT(m_qwtPlotCurve);
if (m_qwtPlotCurve->data()->size() < 1)
{
return false;
}
*minimumValue = m_qwtPlotCurve->minXValue();
*maximumValue = m_qwtPlotCurve->maxXValue();
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimPlotCurve::yValueRange(double* minimumValue, double* maximumValue) const
{
CVF_ASSERT(minimumValue && maximumValue);
CVF_ASSERT(m_qwtPlotCurve);
if (m_qwtPlotCurve->data()->size() < 1)
{
return false;
}
*minimumValue = m_qwtPlotCurve->minYValue();
*maximumValue = m_qwtPlotCurve->maxYValue();
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -700,16 +738,15 @@ void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate()
RimSummaryPlot* summaryPlot = nullptr;
this->firstAncestorOrThisOfType(summaryPlot);
bool showLegendInQwt = m_showLegend();
if (summaryPlot)
{
bool showLegendInQwt = m_showLegend();
if (summaryPlot->ensembleCurveSetCollection()->curveSets().empty() && summaryPlot->curveCount() == 1)
{
// Disable display of legend if the summary plot has only one single curve
showLegendInQwt = false;
}
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, showLegendInQwt);
}
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, showLegendInQwt);
}