#1322 Several refactorings of RimSummaryPlot, added TimeHistoryCurve support

Removed unique_pointer, as childFields now owns (and deletes) the contained object
Simplified extraction of visible curves
Simplified calculation of zoom range
This commit is contained in:
Magne Sjaastad
2017-03-19 08:45:29 +01:00
parent 388fa2b70e
commit ad90d3f38f
5 changed files with 251 additions and 184 deletions

View File

@@ -399,14 +399,12 @@ void RiuSummaryQwtPlot::setDefaults()
axisTitleY.setRenderFlags(Qt::AlignRight);
setAxisTitle(QwtPlot::yLeft, axisTitleY);
QwtLegend* legend = new QwtLegend(this);
// The legend will be deleted in the destructor of the plot or when
// another legend is inserted.
this->insertLegend(legend, BottomLegend);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -420,7 +418,6 @@ void RiuSummaryQwtPlot::useDateBasedTimeAxis()
setAxisScaleDraw(QwtPlot::xBottom, scaleDraw);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -490,7 +487,7 @@ void RiuSummaryQwtPlot::selectClosestCurve(const QPoint& pos)
if(closestCurve && distMin < 20)
{
RimSummaryCurve* selectedCurve = m_plotDefinition->findRimCurveFromQwtCurve(closestCurve);
caf::PdmObject* selectedCurve = m_plotDefinition->findRimCurveFromQwtCurve(closestCurve);
if(selectedCurve)
{
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(selectedCurve);
@@ -508,7 +505,7 @@ void RiuSummaryQwtPlot::onZoomedSlot()
this->setZoomWindow(left, right, time);
m_plotDefinition->updateZoomFromQwt();
m_plotDefinition->updateZoomWindowFromQwt();
}
//--------------------------------------------------------------------------------------------------