mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#491) Updating X-range fields according to changes in plots
This commit is contained in:
parent
1df537627d
commit
2653bcf1a9
@ -108,6 +108,7 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
|
|||||||
|
|
||||||
plot->updateAvailableDepthRange();
|
plot->updateAvailableDepthRange();
|
||||||
plot->setVisibleDepthRangeFromContents();
|
plot->setVisibleDepthRangeFromContents();
|
||||||
|
plotTrace->updateXAxisRangeFromCurves();
|
||||||
plotTrace->viewer()->replot();
|
plotTrace->viewer()->replot();
|
||||||
|
|
||||||
RiaApplication::instance()->project()->updateConnectedEditors();
|
RiaApplication::instance()->project()->updateConnectedEditors();
|
||||||
|
@ -193,6 +193,11 @@ void RimWellLogExtractionCurve::updatePlotData()
|
|||||||
RimWellLogPlotTrace* plotTrace;
|
RimWellLogPlotTrace* plotTrace;
|
||||||
firstAnchestorOrThisOfType(plotTrace);
|
firstAnchestorOrThisOfType(plotTrace);
|
||||||
|
|
||||||
|
if (plotTrace)
|
||||||
|
{
|
||||||
|
plotTrace->updateXAxisRangeFromCurves();
|
||||||
|
}
|
||||||
|
|
||||||
RimWellLogPlot* wellLogPlot;
|
RimWellLogPlot* wellLogPlot;
|
||||||
firstAnchestorOrThisOfType(wellLogPlot);
|
firstAnchestorOrThisOfType(wellLogPlot);
|
||||||
|
|
||||||
|
@ -119,17 +119,26 @@ void RimWellLogFileCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
{
|
{
|
||||||
RimWellLogPlotCurve::fieldChangedByUi(changedField, oldValue, newValue);
|
RimWellLogPlotCurve::fieldChangedByUi(changedField, oldValue, newValue);
|
||||||
|
|
||||||
|
RimWellLogPlot* wellLoglot;
|
||||||
|
firstAnchestorOrThisOfType(wellLoglot);
|
||||||
|
|
||||||
|
RimWellLogPlotTrace* wellLoglotTrace;
|
||||||
|
firstAnchestorOrThisOfType(wellLoglotTrace);
|
||||||
|
|
||||||
if (changedField == &m_wellPath)
|
if (changedField == &m_wellPath)
|
||||||
{
|
{
|
||||||
this->updatePlotData();
|
this->updatePlotData();
|
||||||
|
|
||||||
RimWellLogPlot* wellLoglot;
|
|
||||||
firstAnchestorOrThisOfType(wellLoglot);
|
|
||||||
if (wellLoglot)
|
if (wellLoglot)
|
||||||
{
|
{
|
||||||
wellLoglot->updateAvailableDepthRange();
|
wellLoglot->updateAvailableDepthRange();
|
||||||
wellLoglot->setVisibleDepthRangeFromContents();
|
wellLoglot->setVisibleDepthRangeFromContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wellLoglotTrace)
|
||||||
|
{
|
||||||
|
wellLoglotTrace->updateXAxisRangeFromCurves();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (changedField == &m_wellLogChannnelName)
|
else if (changedField == &m_wellLogChannnelName)
|
||||||
{
|
{
|
||||||
@ -140,8 +149,6 @@ void RimWellLogFileCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
|
|
||||||
this->updatePlotData();
|
this->updatePlotData();
|
||||||
|
|
||||||
RimWellLogPlot* wellLoglot;
|
|
||||||
firstAnchestorOrThisOfType(wellLoglot);
|
|
||||||
if (wellLoglot)
|
if (wellLoglot)
|
||||||
{
|
{
|
||||||
if (!wellLoglot->hasAvailableDepthRange())
|
if (!wellLoglot->hasAvailableDepthRange())
|
||||||
@ -149,6 +156,11 @@ void RimWellLogFileCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
wellLoglot->updateAvailableDepthRange();
|
wellLoglot->updateAvailableDepthRange();
|
||||||
wellLoglot->setVisibleDepthRangeFromContents();
|
wellLoglot->setVisibleDepthRangeFromContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wellLoglotTrace)
|
||||||
|
{
|
||||||
|
wellLoglotTrace->updateXAxisRangeFromCurves();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,9 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "RimWellLogPlotCurve.h"
|
#include "RimWellLogPlotCurve.h"
|
||||||
|
|
||||||
#include "RimWellLogPlot.h"
|
#include "RimWellLogPlot.h"
|
||||||
|
|
||||||
#include "RiuWellLogTracePlot.h"
|
#include "RiuWellLogTracePlot.h"
|
||||||
#include "RiuWellLogPlotCurve.h"
|
#include "RiuWellLogPlotCurve.h"
|
||||||
|
|
||||||
@ -157,6 +159,26 @@ bool RimWellLogPlotCurve::depthRange(double* minimumDepth, double* maximumDepth)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimWellLogPlotCurve::valueRange(double* minimumValue, double* maximumValue) const
|
||||||
|
{
|
||||||
|
CVF_ASSERT(minimumValue && maximumValue);
|
||||||
|
CVF_ASSERT(m_plotCurve);
|
||||||
|
|
||||||
|
if (m_plotCurve->data()->size() < 1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
*minimumValue = m_plotCurve->minXValue();
|
||||||
|
*maximumValue = m_plotCurve->maxXValue();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -180,4 +202,3 @@ QwtPlotCurve* RimWellLogPlotCurve::plotCurve() const
|
|||||||
{
|
{
|
||||||
return m_plotCurve;
|
return m_plotCurve;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ public:
|
|||||||
void setColor(const cvf::Color3f& color);
|
void setColor(const cvf::Color3f& color);
|
||||||
|
|
||||||
bool depthRange(double* minimumDepth, double* maximumDepth) const;
|
bool depthRange(double* minimumDepth, double* maximumDepth) const;
|
||||||
|
bool valueRange(double* minimumValue, double* maximumValue) const;
|
||||||
|
|
||||||
void setPlot(RiuWellLogTracePlot* plot);
|
void setPlot(RiuWellLogTracePlot* plot);
|
||||||
void detachCurve();
|
void detachCurve();
|
||||||
|
@ -172,6 +172,8 @@ void RimWellLogPlotTrace::loadDataAndUpdate()
|
|||||||
{
|
{
|
||||||
curves[cIdx]->updatePlotData();
|
curves[cIdx]->updatePlotData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateXAxisRangeFromCurves();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -233,6 +235,49 @@ void RimWellLogPlotTrace::updateAxisRangesAndReplot()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogPlotTrace::updateXAxisRangeFromCurves()
|
||||||
|
{
|
||||||
|
double minValue = HUGE_VAL;
|
||||||
|
double maxValue = -HUGE_VAL;
|
||||||
|
|
||||||
|
size_t curveCount = curves.size();
|
||||||
|
if (curveCount < 1) return;
|
||||||
|
|
||||||
|
bool rangeUpdated = false;
|
||||||
|
|
||||||
|
for (size_t cIdx = 0; cIdx < curveCount; cIdx++)
|
||||||
|
{
|
||||||
|
double minCurveValue = HUGE_VAL;
|
||||||
|
double maxCurveValue = -HUGE_VAL;
|
||||||
|
|
||||||
|
if (curves[cIdx]->valueRange(&minCurveValue, &maxCurveValue))
|
||||||
|
{
|
||||||
|
if (minCurveValue < minValue)
|
||||||
|
{
|
||||||
|
minValue = minCurveValue;
|
||||||
|
rangeUpdated = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (maxCurveValue > maxValue)
|
||||||
|
{
|
||||||
|
maxValue = maxCurveValue;
|
||||||
|
rangeUpdated = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rangeUpdated)
|
||||||
|
{
|
||||||
|
m_minimumValue = minValue;
|
||||||
|
m_maximumValue = maxValue;
|
||||||
|
|
||||||
|
updateConnectedEditors();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -53,6 +53,7 @@ public:
|
|||||||
|
|
||||||
bool availableDepthRange(double* minimumDepth, double* maximumDepth);
|
bool availableDepthRange(double* minimumDepth, double* maximumDepth);
|
||||||
void updateAxisRangesAndReplot();
|
void updateAxisRangesAndReplot();
|
||||||
|
void updateXAxisRangeFromCurves();
|
||||||
|
|
||||||
RiuWellLogTracePlot* viewer();
|
RiuWellLogTracePlot* viewer();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user