diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp index 380b9c8a88..f4190f5185 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp @@ -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(); + } + } } } diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp index 1ed451ed74..877e43fd2e 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp @@ -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); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h index 278e0d3994..2dfa64f813 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h @@ -56,6 +56,8 @@ public: void visibleDepthRange(double* minimumDepth, double* maximumDepth) const; void updateAxisRanges(); + void setVisibleDepthRangeFromContents(); + protected: // Overridden PDM methods