diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp index 46b25bd14c..2fd884197c 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp @@ -42,6 +42,9 @@ RimWellLogPlot::RimWellLogPlot() CAF_PDM_InitField(&showWindow, "ShowWindow", true, "Show well log plot", "", "", ""); showWindow.uiCapability()->setUiHidden(true); + + CAF_PDM_InitField(&minimumDepth, "MinimumDepth", 0.0, "Set minimum depth", "", "", ""); + CAF_PDM_InitField(&maximumDepth, "MaximumDepth", 1000.0, "Set maximum depth", "", "", ""); CAF_PDM_InitFieldNoDefault(&traces, "Traces", "", "", "", ""); traces.uiCapability()->setUiHidden(true); @@ -113,6 +116,10 @@ void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c } } } + else if (changedField == &minimumDepth || changedField == &maximumDepth) + { + m_viewer->setDepthRange(minimumDepth, maximumDepth); + } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h index 7fda170ece..eff1cc5bba 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h @@ -59,4 +59,7 @@ private: private: QPointer m_viewer; + + caf::PdmField minimumDepth; + caf::PdmField maximumDepth; }; diff --git a/ApplicationCode/UserInterface/RiuWellLogPlot.cpp b/ApplicationCode/UserInterface/RiuWellLogPlot.cpp index dc1abc8316..b3352e7290 100644 --- a/ApplicationCode/UserInterface/RiuWellLogPlot.cpp +++ b/ApplicationCode/UserInterface/RiuWellLogPlot.cpp @@ -59,3 +59,14 @@ RiuWellLogTracePlot* RiuWellLogPlot::createTracePlot() return tracePlot; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuWellLogPlot::setDepthRange(double minDepth, double maxDepth) +{ + for (int tpIdx = 0; tpIdx < m_tracePlots.count(); tpIdx++) + { + m_tracePlots[tpIdx]->setDepthRange(minDepth, maxDepth); + } +} diff --git a/ApplicationCode/UserInterface/RiuWellLogPlot.h b/ApplicationCode/UserInterface/RiuWellLogPlot.h index 1241c8ae83..45e85d5f87 100644 --- a/ApplicationCode/UserInterface/RiuWellLogPlot.h +++ b/ApplicationCode/UserInterface/RiuWellLogPlot.h @@ -41,6 +41,8 @@ public: RiuWellLogTracePlot* createTracePlot(); + void setDepthRange(double minDepth, double maxDepth); + private: void setDefults(); diff --git a/ApplicationCode/UserInterface/RiuWellLogTracePlot.cpp b/ApplicationCode/UserInterface/RiuWellLogTracePlot.cpp index 681769c648..5cbabfa115 100644 --- a/ApplicationCode/UserInterface/RiuWellLogTracePlot.cpp +++ b/ApplicationCode/UserInterface/RiuWellLogTracePlot.cpp @@ -62,7 +62,6 @@ RiuWellLogTracePlot::~RiuWellLogTracePlot() delete m_grid; } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -92,3 +91,13 @@ void RiuWellLogTracePlot::setDefaults() axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Inverted, true); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuWellLogTracePlot::setDepthRange(double minDepth, double maxDepth) +{ + // Note: Y-axis is inverted + setAxisScale(QwtPlot::yLeft, maxDepth, minDepth); + replot(); +} diff --git a/ApplicationCode/UserInterface/RiuWellLogTracePlot.h b/ApplicationCode/UserInterface/RiuWellLogTracePlot.h index 1a939d53c1..8666c79b3d 100644 --- a/ApplicationCode/UserInterface/RiuWellLogTracePlot.h +++ b/ApplicationCode/UserInterface/RiuWellLogTracePlot.h @@ -37,6 +37,8 @@ public: RiuWellLogTracePlot(QWidget* parent = NULL); virtual ~RiuWellLogTracePlot(); + void setDepthRange(double minDepth, double maxDepth); + private: void setDefaults();