(#504) Move common code to base class

This commit is contained in:
Magne Sjaastad 2015-09-22 11:17:24 +02:00
parent f49c7fc983
commit 7ded798055
3 changed files with 40 additions and 26 deletions

View File

@ -217,31 +217,7 @@ void RimWellLogExtractionCurve::updatePlotData()
if (filteredValues.size())
{
RimWellLogPlotTrack* plotTrack;
firstAnchestorOrThisOfType(plotTrack);
if (plotTrack)
{
plotTrack->updateXAxisRangeFromCurves();
}
RimWellLogPlot* wellLogPlot;
firstAnchestorOrThisOfType(wellLogPlot);
if (wellLogPlot && plotTrack)
{
bool setDepthRange = !wellLogPlot->hasAvailableDepthRange();
wellLogPlot->updateAvailableDepthRange();
if (setDepthRange)
{
wellLogPlot->setVisibleDepthRangeFromContents();
}
else if (plotTrack->curveCount() == 1)
{
plotTrack->updateAxisRangesAndReplot();
}
}
updateTrackAndPlotFromCurveData();
}
m_plot->replot();

View File

@ -93,6 +93,10 @@ void RimWellLogFileCurve::updatePlotData()
{
m_plotCurve->setSamples(NULL, NULL, 0);
}
updateTrackAndPlotFromCurveData();
m_plot->replot();
}
}

View File

@ -21,8 +21,10 @@
#include "RimWellLogPlot.h"
#include "RiuWellLogTrackPlot.h"
#include "RimWellLogPlotTrack.h"
#include "RiuWellLogPlotCurve.h"
#include "RiuWellLogTrackPlot.h"
#include "cvfAssert.h"
@ -279,3 +281,35 @@ void RimWellLogPlotCurve::updateOptionSensitivity()
{
m_customCurveName.uiCapability()->setUiReadOnly(!m_useCustomCurveName);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotCurve::updateTrackAndPlotFromCurveData()
{
RimWellLogPlotTrack* plotTrack;
firstAnchestorOrThisOfType(plotTrack);
if (plotTrack)
{
plotTrack->updateXAxisRangeFromCurves();
}
RimWellLogPlot* wellLogPlot;
firstAnchestorOrThisOfType(wellLogPlot);
if (wellLogPlot && plotTrack)
{
bool setDepthRange = !wellLogPlot->hasAvailableDepthRange();
wellLogPlot->updateAvailableDepthRange();
if (setDepthRange)
{
wellLogPlot->setVisibleDepthRangeFromContents();
}
else if (plotTrack->curveCount() == 1)
{
plotTrack->updateAxisRangesAndReplot();
}
}
}