(#396) Set visible depth range from all available data when there's only 1 trace with 1 curve

This commit is contained in:
Pål Hagen 2015-09-04 12:21:41 +02:00
parent dfdfdc3efc
commit 94095a16f0
3 changed files with 22 additions and 0 deletions

View File

@ -34,6 +34,7 @@
#include "RimWellLogPlotCurve.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotTrace.h"
#include "RiuWellLogTracePlot.h"
#include "qwt_plot_curve.h"
#include "RimWellLogPlotCollection.h"
@ -184,6 +185,16 @@ void RimWellLogExtractionCurve::updatePlotData()
if (wellLogPlot)
{
wellLogPlot->updateAvailableDepthRange();
if (wellLogPlot->traceCount() == 1)
{
RimWellLogPlotTrace* plotTrace;
firstAnchestorOrThisOfType(plotTrace);
if (plotTrace && plotTrace->curveCount() == 1)
{
wellLogPlot->setVisibleDepthRangeFromContents();
}
}
}
}

View File

@ -277,6 +277,15 @@ void RimWellLogPlot::updateAxisRanges()
if (m_viewer) m_viewer->setDepthRange(m_minimumVisibleDepth, m_maximumVisibleDepth);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlot::setVisibleDepthRangeFromContents()
{
setDepthRange(m_depthRangeMinimum, m_depthRangeMaximum);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -56,6 +56,8 @@ public:
void visibleDepthRange(double* minimumDepth, double* maximumDepth) const;
void updateAxisRanges();
void setVisibleDepthRangeFromContents();
protected:
// Overridden PDM methods