(#437) Using MD or TVD depth values for well log extraction curves

Also renamed some methods for clarity, and fixed a bug in
RimWellLogPlot::updateViewerWidget(). Using this method instead of
loadDataAndUpdate() when toggling visibility of the plot.
This commit is contained in:
Pål Hagen 2015-09-11 10:44:10 +02:00
parent b841af62bb
commit d3909c5d27
9 changed files with 48 additions and 21 deletions

View File

@ -120,7 +120,7 @@ void RicDeleteItemExec::redo()
parentObj->firstAnchestorOrThisOfType(wellLogPlotTrace); parentObj->firstAnchestorOrThisOfType(wellLogPlotTrace);
if (wellLogPlotTrace) if (wellLogPlotTrace)
{ {
wellLogPlotTrace->updateAxisRanges(); wellLogPlotTrace->updateAxisRangesAndReplot();
} }
RimWellLogPlotCollection* wellLogPlotCollection = NULL; RimWellLogPlotCollection* wellLogPlotCollection = NULL;

View File

@ -32,9 +32,9 @@
#include "RigCaseCellResultsData.h" #include "RigCaseCellResultsData.h"
#include "RigCaseData.h" #include "RigCaseData.h"
#include "RimWellLogPlotCurve.h" #include "RimWellLogPlotCurve.h"
#include "RimWellLogPlot.h" #include "RimWellLogPlot.h"
#include "RimWellLogPlotTrace.h" #include "RimWellLogPlotTrace.h"
#include "RiuWellLogTracePlot.h" #include "RiuWellLogTracePlot.h"
#include "qwt_plot_curve.h" #include "qwt_plot_curve.h"
#include "RimWellLogPlotCollection.h" #include "RimWellLogPlotCollection.h"
@ -104,7 +104,6 @@ void RimWellLogExtractionCurve::fieldChangedByUi(const caf::PdmFieldHandle* chan
{ {
this->updatePlotData(); this->updatePlotData();
} }
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -136,7 +135,11 @@ void RimWellLogExtractionCurve::updatePlotData()
if (eclExtractor.notNull()) if (eclExtractor.notNull())
{ {
const std::vector<double>& depthValues = eclExtractor->measuredDepth(); RimWellLogPlot* wellLogPlot;
firstAnchestorOrThisOfType(wellLogPlot);
CVF_ASSERT(wellLogPlot);
const std::vector<double>& depthValues = wellLogPlot->depthType() == RimWellLogPlot::MEASURED_DEPTH ? eclExtractor->measuredDepth() : eclExtractor->trueVerticalDepth();
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_eclipseResultDefinition->porosityModel()); RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_eclipseResultDefinition->porosityModel());
m_eclipseResultDefinition->loadResult(); m_eclipseResultDefinition->loadResult();
@ -192,7 +195,7 @@ void RimWellLogExtractionCurve::updatePlotData()
} }
else if (plotTrace->curveCount() == 1) else if (plotTrace->curveCount() == 1)
{ {
plotTrace->updateAxisRanges(); plotTrace->updateAxisRangesAndReplot();
} }
} }
} }

View File

@ -38,6 +38,7 @@ class RimWellLogExtractionCurve : public RimWellLogPlotCurve
public: public:
RimWellLogExtractionCurve(); RimWellLogExtractionCurve();
virtual ~RimWellLogExtractionCurve(); virtual ~RimWellLogExtractionCurve();
virtual void updatePlotData(); virtual void updatePlotData();
protected: protected:

View File

@ -101,11 +101,11 @@ void RimWellLogPlot::updateViewerWidget()
m_viewer = new RiuWellLogPlot(this, RiuMainWindow::instance()); m_viewer = new RiuWellLogPlot(this, RiuMainWindow::instance());
recreateTracePlots(); recreateTracePlots();
}
RiuMainWindow::instance()->addViewer(m_viewer, windowGeometry()); RiuMainWindow::instance()->addViewer(m_viewer, windowGeometry());
RiuMainWindow::instance()->setActiveViewer(m_viewer); RiuMainWindow::instance()->setActiveViewer(m_viewer);
updateAxisRanges(); }
updateViewerWidgetWindowTitle(); updateViewerWidgetWindowTitle();
} }
else else
@ -130,7 +130,7 @@ void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
{ {
if (changedField == &m_showWindow) if (changedField == &m_showWindow)
{ {
updateViewerWidget(); loadDataAndUpdate();
} }
else if (changedField == &m_minimumVisibleDepth || changedField == &m_maximumVisibleDepth) else if (changedField == &m_minimumVisibleDepth || changedField == &m_maximumVisibleDepth)
{ {
@ -140,6 +140,10 @@ void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
{ {
updateViewerWidgetWindowTitle(); updateViewerWidgetWindowTitle();
} }
if (changedField == &m_depthType)
{
updateTraces();
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -289,7 +293,14 @@ void RimWellLogPlot::setupBeforeSave()
void RimWellLogPlot::loadDataAndUpdate() void RimWellLogPlot::loadDataAndUpdate()
{ {
updateViewerWidget(); updateViewerWidget();
updateTraces();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlot::updateTraces()
{
for (size_t tIdx = 0; tIdx < traces.size(); ++tIdx) for (size_t tIdx = 0; tIdx < traces.size(); ++tIdx)
{ {
traces[tIdx]->loadDataAndUpdate(); traces[tIdx]->loadDataAndUpdate();
@ -299,6 +310,7 @@ void RimWellLogPlot::loadDataAndUpdate()
updateAxisRanges(); updateAxisRanges();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -309,7 +321,7 @@ void RimWellLogPlot::updateAxisRanges()
double minDepth = m_minimumVisibleDepth < HUGE_VAL ? m_minimumVisibleDepth : RI_LOGPLOT_MINDEPTH_DEFAULT; double minDepth = m_minimumVisibleDepth < HUGE_VAL ? m_minimumVisibleDepth : RI_LOGPLOT_MINDEPTH_DEFAULT;
double maxDepth = m_maximumVisibleDepth > -HUGE_VAL ? m_maximumVisibleDepth : RI_LOGPLOT_MAXDEPTH_DEFAULT; double maxDepth = m_maximumVisibleDepth > -HUGE_VAL ? m_maximumVisibleDepth : RI_LOGPLOT_MAXDEPTH_DEFAULT;
m_viewer->setDepthRange(minDepth, maxDepth); m_viewer->setDepthRangeAndReplot(minDepth, maxDepth);
} }
} }
@ -391,3 +403,11 @@ void RimWellLogPlot::handleViewerDeletion()
uiCapability()->updateUiIconFromToggleField(); uiCapability()->updateUiIconFromToggleField();
updateConnectedEditors(); updateConnectedEditors();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlot::DepthTypeEnum RimWellLogPlot::depthType() const
{
return m_depthType.value();
}

View File

@ -56,6 +56,7 @@ public:
size_t traceCount() { return traces.size();} size_t traceCount() { return traces.size();}
void loadDataAndUpdate(); void loadDataAndUpdate();
void updateTraces();
RiuWellLogPlot* viewer(); RiuWellLogPlot* viewer();
@ -71,6 +72,8 @@ public:
void updateAxisRanges(); void updateAxisRanges();
void setVisibleDepthRangeFromContents(); void setVisibleDepthRangeFromContents();
DepthTypeEnum depthType() const;
virtual caf::PdmFieldHandle* userDescriptionField() { return &m_userName; } virtual caf::PdmFieldHandle* userDescriptionField() { return &m_userName; }
protected: protected:

View File

@ -44,8 +44,8 @@ RimWellLogPlotTrace::RimWellLogPlotTrace()
{ {
CAF_PDM_InitObject("Trace", "", "", ""); CAF_PDM_InitObject("Trace", "", "", "");
CAF_PDM_InitField(&show, "Show", true, "Show trace", "", "", ""); CAF_PDM_InitField(&m_show, "Show", true, "Show trace", "", "", "");
show.uiCapability()->setUiHidden(true); m_show.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&curves, "Curves", "", "", "", ""); CAF_PDM_InitFieldNoDefault(&curves, "Curves", "", "", "", "");
curves.uiCapability()->setUiHidden(true); curves.uiCapability()->setUiHidden(true);
@ -67,9 +67,9 @@ RimWellLogPlotTrace::~RimWellLogPlotTrace()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlotTrace::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) void RimWellLogPlotTrace::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{ {
if (changedField == &show) if (changedField == &m_show)
{ {
if (m_viewer) m_viewer->setVisible(show()); if (m_viewer) m_viewer->setVisible(m_show());
} }
else if (changedField == &m_minimumValue || changedField == &m_maximumValue) else if (changedField == &m_minimumValue || changedField == &m_maximumValue)
{ {
@ -83,7 +83,7 @@ void RimWellLogPlotTrace::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimWellLogPlotTrace::objectToggleField() caf::PdmFieldHandle* RimWellLogPlotTrace::objectToggleField()
{ {
return &show; return &m_show;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -195,7 +195,7 @@ void RimWellLogPlotTrace::detachAllCurves()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlotTrace::updateAxisRanges() void RimWellLogPlotTrace::updateAxisRangesAndReplot()
{ {
bool rangesChanged = false; bool rangesChanged = false;

View File

@ -50,7 +50,7 @@ public:
void loadDataAndUpdate(); void loadDataAndUpdate();
bool availableDepthRange(double* minimumDepth, double* maximumDepth); bool availableDepthRange(double* minimumDepth, double* maximumDepth);
void updateAxisRanges(); void updateAxisRangesAndReplot();
RiuWellLogTracePlot* viewer(); RiuWellLogTracePlot* viewer();
@ -61,7 +61,7 @@ protected:
virtual caf::PdmFieldHandle* objectToggleField(); virtual caf::PdmFieldHandle* objectToggleField();
private: private:
caf::PdmField<bool> show; caf::PdmField<bool> m_show;
caf::PdmChildArrayField<RimWellLogPlotCurve*> curves; caf::PdmChildArrayField<RimWellLogPlotCurve*> curves;
caf::PdmField<double> m_minimumValue; caf::PdmField<double> m_minimumValue;
caf::PdmField<double> m_maximumValue; caf::PdmField<double> m_maximumValue;

View File

@ -76,7 +76,7 @@ void RiuWellLogPlot::insertTracePlot(RiuWellLogTracePlot* tracePlot)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::setDepthRange(double minDepth, double maxDepth) void RiuWellLogPlot::setDepthRangeAndReplot(double minDepth, double maxDepth)
{ {
for (int tpIdx = 0; tpIdx < m_tracePlots.count(); tpIdx++) for (int tpIdx = 0; tpIdx < m_tracePlots.count(); tpIdx++)
{ {

View File

@ -46,7 +46,7 @@ public:
void insertTracePlot(RiuWellLogTracePlot* tracePlot); void insertTracePlot(RiuWellLogTracePlot* tracePlot);
void setDepthRange(double minDepth, double maxDepth); void setDepthRangeAndReplot(double minDepth, double maxDepth);
private: private:
void updateScrollBar(double minDepth, double maxDepth); void updateScrollBar(double minDepth, double maxDepth);