2015-08-26 12:27:29 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2015-08-26 12:27:29 +02:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2015-08-26 12:27:29 +02:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-08-26 12:27:29 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2015-11-04 16:22:53 +01:00
|
|
|
#include "RimWellLogCurve.h"
|
2015-09-18 10:50:01 +02:00
|
|
|
|
2019-09-17 16:26:03 +02:00
|
|
|
#include "RiaCurveDataTools.h"
|
2022-01-17 13:14:21 +01:00
|
|
|
#include "RiaPlotDefines.h"
|
2019-09-06 10:40:57 +02:00
|
|
|
#include "RigWellLogCurveData.h"
|
2015-09-18 10:50:01 +02:00
|
|
|
|
2020-05-14 06:39:55 +02:00
|
|
|
#include "RimDepthTrackPlot.h"
|
2015-11-04 16:14:42 +01:00
|
|
|
#include "RimWellLogTrack.h"
|
2015-09-22 11:17:24 +02:00
|
|
|
|
2018-09-04 09:08:29 +02:00
|
|
|
#include "RiuQwtPlotCurve.h"
|
2019-10-11 15:54:19 +02:00
|
|
|
#include "RiuQwtPlotWidget.h"
|
2015-09-17 18:42:35 +02:00
|
|
|
|
2015-12-01 16:22:18 +01:00
|
|
|
#include "cafPdmUiComboBoxEditor.h"
|
|
|
|
|
|
2015-08-31 02:06:37 +02:00
|
|
|
#include "cvfAssert.h"
|
2015-08-27 16:13:49 +02:00
|
|
|
|
2015-12-08 20:39:06 +01:00
|
|
|
#include "qwt_symbol.h"
|
|
|
|
|
|
2019-09-11 15:54:59 +02:00
|
|
|
#include <algorithm>
|
|
|
|
|
|
2015-09-18 13:02:33 +02:00
|
|
|
// NB! Special macro for pure virtual class
|
2019-09-06 10:40:57 +02:00
|
|
|
CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimWellLogCurve, "WellLogPlotCurve" );
|
2015-12-08 20:39:06 +01:00
|
|
|
|
2015-08-27 16:13:49 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2015-08-27 16:13:49 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-11-04 16:19:38 +01:00
|
|
|
RimWellLogCurve::RimWellLogCurve()
|
2016-05-23 15:44:15 +02:00
|
|
|
{
|
2022-01-07 08:31:52 +01:00
|
|
|
CAF_PDM_InitObject( "WellLogCurve", ":/WellLogCurve16x16.png" );
|
2016-05-23 15:44:15 +02:00
|
|
|
|
2019-10-29 09:29:15 +01:00
|
|
|
m_curveData = new RigWellLogCurveData;
|
|
|
|
|
|
2022-02-14 11:49:37 +01:00
|
|
|
m_curveDataPropertyValueRange =
|
|
|
|
|
std::make_pair( std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity() );
|
2020-05-18 16:02:27 +02:00
|
|
|
|
|
|
|
|
setDeletable( true );
|
2016-05-23 15:44:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2016-05-23 15:44:15 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 11:13:38 +01:00
|
|
|
RimWellLogCurve::~RimWellLogCurve()
|
|
|
|
|
{
|
|
|
|
|
}
|
2016-05-23 15:44:15 +02:00
|
|
|
|
2015-09-18 10:50:01 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-30 14:03:58 +02:00
|
|
|
///
|
2015-09-18 10:50:01 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2021-06-09 14:51:26 +02:00
|
|
|
void RimWellLogCurve::setDepthUnit( RiaDefines::DepthUnitType depthUnit )
|
|
|
|
|
{
|
|
|
|
|
m_curveData->setDepthUnit( depthUnit );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-02-14 11:49:37 +01:00
|
|
|
bool RimWellLogCurve::propertyValueRangeInData( double* minimumValue, double* maximumValue ) const
|
2015-09-18 10:50:01 +02:00
|
|
|
{
|
2019-09-17 16:26:03 +02:00
|
|
|
CAF_ASSERT( minimumValue && maximumValue );
|
|
|
|
|
|
|
|
|
|
if ( !( minimumValue && maximumValue ) )
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2019-09-30 09:48:05 +02:00
|
|
|
|
2022-02-14 11:49:37 +01:00
|
|
|
if ( m_curveDataPropertyValueRange.first == -std::numeric_limits<double>::infinity() ||
|
|
|
|
|
m_curveDataPropertyValueRange.second == std::numeric_limits<double>::infinity() )
|
2019-09-11 15:54:59 +02:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2019-09-17 16:26:03 +02:00
|
|
|
|
2022-02-14 11:49:37 +01:00
|
|
|
*minimumValue = m_curveDataPropertyValueRange.first;
|
|
|
|
|
*maximumValue = m_curveDataPropertyValueRange.second;
|
2019-09-17 16:26:03 +02:00
|
|
|
|
2019-09-11 15:54:59 +02:00
|
|
|
return true;
|
2015-09-18 10:50:01 +02:00
|
|
|
}
|
|
|
|
|
|
2019-10-11 15:54:19 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-02-14 11:49:37 +01:00
|
|
|
bool RimWellLogCurve::depthValueRangeInData( double* minimumValue, double* maximumValue ) const
|
2019-10-11 15:54:19 +02:00
|
|
|
{
|
|
|
|
|
CAF_ASSERT( minimumValue && maximumValue );
|
|
|
|
|
|
|
|
|
|
if ( !( minimumValue && maximumValue ) )
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-14 06:39:55 +02:00
|
|
|
RimDepthTrackPlot* wellLogPlot = nullptr;
|
2019-10-11 15:54:19 +02:00
|
|
|
firstAncestorOrThisOfTypeAsserted( wellLogPlot );
|
2019-11-29 10:02:34 +01:00
|
|
|
auto depthType = wellLogPlot->depthType();
|
|
|
|
|
auto displayUnit = wellLogPlot->depthUnit();
|
2019-10-11 15:54:19 +02:00
|
|
|
|
2019-11-29 10:02:34 +01:00
|
|
|
return m_curveData->calculateDepthRange( depthType, displayUnit, minimumValue, maximumValue );
|
2019-10-11 15:54:19 +02:00
|
|
|
}
|
|
|
|
|
|
2019-09-30 09:48:05 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-02-14 11:49:37 +01:00
|
|
|
void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
|
|
|
|
|
const std::vector<double>& depths,
|
|
|
|
|
RiaDefines::DepthTypeEnum depthType,
|
|
|
|
|
double rkbDiff,
|
|
|
|
|
RiaDefines::DepthUnitType depthUnit,
|
|
|
|
|
bool isExtractionCurve,
|
|
|
|
|
bool useLogarithmicScale,
|
|
|
|
|
const QString& propertyUnit )
|
2019-11-19 13:19:56 +01:00
|
|
|
{
|
2022-02-14 11:49:37 +01:00
|
|
|
m_curveData->setValuesAndDepths( propertyValues, depths, depthType, rkbDiff, depthUnit, isExtractionCurve, useLogarithmicScale );
|
|
|
|
|
m_curveData->setPropertyValueUnit( propertyUnit );
|
|
|
|
|
calculateCurveDataPropertyValueRange();
|
2019-11-19 13:19:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-02-14 11:49:37 +01:00
|
|
|
void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
|
|
|
|
|
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
|
|
|
|
|
double rkbDiff,
|
|
|
|
|
RiaDefines::DepthUnitType depthUnit,
|
|
|
|
|
bool isExtractionCurve,
|
|
|
|
|
bool useLogarithmicScale,
|
|
|
|
|
|
|
|
|
|
const QString& propertyUnit )
|
2019-09-30 09:48:05 +02:00
|
|
|
{
|
2022-02-14 11:49:37 +01:00
|
|
|
m_curveData->setValuesAndDepths( propertyValues, depths, rkbDiff, depthUnit, isExtractionCurve, useLogarithmicScale );
|
|
|
|
|
m_curveData->setPropertyValueUnit( propertyUnit );
|
|
|
|
|
calculateCurveDataPropertyValueRange();
|
2019-09-30 09:48:05 +02:00
|
|
|
}
|
|
|
|
|
|
2022-06-16 13:55:42 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimWellLogCurve::setPropertyAndDepthsAndErrors( const std::vector<double>& propertyValues,
|
|
|
|
|
const std::vector<double>& depthValues,
|
|
|
|
|
const std::vector<double>& errorValues )
|
|
|
|
|
{
|
|
|
|
|
bool useLogarithmicScale = false;
|
|
|
|
|
|
|
|
|
|
if ( isVerticalCurve() )
|
|
|
|
|
{
|
|
|
|
|
this->setSamplesFromXYErrorValues( propertyValues,
|
|
|
|
|
depthValues,
|
|
|
|
|
errorValues,
|
|
|
|
|
useLogarithmicScale,
|
|
|
|
|
RiaCurveDataTools::ErrorAxis::ERROR_ALONG_X_AXIS );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this->setSamplesFromXYErrorValues( depthValues,
|
|
|
|
|
propertyValues,
|
|
|
|
|
errorValues,
|
|
|
|
|
useLogarithmicScale,
|
|
|
|
|
RiaCurveDataTools::ErrorAxis::ERROR_ALONG_Y_AXIS );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-23 13:57:02 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimWellLogCurve::setPropertyAndDepthValuesToPlotCurve( const std::vector<double>& propertyValues,
|
|
|
|
|
const std::vector<double>& depthValues )
|
|
|
|
|
{
|
|
|
|
|
if ( !m_plotCurve ) return;
|
|
|
|
|
|
|
|
|
|
if ( isVerticalCurve() )
|
|
|
|
|
{
|
|
|
|
|
m_plotCurve->setSamplesValues( propertyValues, depthValues );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_plotCurve->setSamplesValues( depthValues, propertyValues );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-30 09:48:05 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-02-14 11:49:37 +01:00
|
|
|
void RimWellLogCurve::setPropertyValuesWithMdAndTVD( const std::vector<double>& propertyValues,
|
|
|
|
|
const std::vector<double>& measuredDepths,
|
|
|
|
|
const std::vector<double>& tvdMSL,
|
|
|
|
|
double rkbDiff,
|
|
|
|
|
RiaDefines::DepthUnitType depthUnit,
|
|
|
|
|
bool isExtractionCurve,
|
|
|
|
|
bool useLogarithmicScale,
|
|
|
|
|
const QString& propertyUnit )
|
2019-09-30 09:48:05 +02:00
|
|
|
{
|
2020-11-06 09:46:38 +00:00
|
|
|
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> depths = { { RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
|
|
|
|
|
measuredDepths },
|
|
|
|
|
{ RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH,
|
|
|
|
|
tvdMSL } };
|
2022-02-14 11:49:37 +01:00
|
|
|
setPropertyValuesAndDepths( propertyValues, depths, rkbDiff, depthUnit, isExtractionCurve, useLogarithmicScale, propertyUnit );
|
2019-09-30 09:48:05 +02:00
|
|
|
}
|
|
|
|
|
|
2018-09-07 13:39:50 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2018-09-07 13:39:50 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
const RigWellLogCurveData* RimWellLogCurve::curveData() const
|
|
|
|
|
{
|
|
|
|
|
return m_curveData.p();
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-19 10:31:36 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimWellLogCurve::updateCurveAppearance()
|
|
|
|
|
{
|
|
|
|
|
RimPlotCurve::updateCurveAppearance();
|
2022-01-17 13:14:21 +01:00
|
|
|
|
2022-02-21 07:15:56 +01:00
|
|
|
RimDepthTrackPlot::DepthOrientation orientation = RimDepthTrackPlot::DepthOrientation::VERTICAL;
|
|
|
|
|
|
|
|
|
|
RimDepthTrackPlot* wellLogPlot = nullptr;
|
|
|
|
|
firstAncestorOrThisOfType( wellLogPlot );
|
2022-08-12 08:36:52 +02:00
|
|
|
if ( wellLogPlot )
|
2022-01-17 13:14:21 +01:00
|
|
|
{
|
2022-08-12 08:36:52 +02:00
|
|
|
orientation = wellLogPlot->depthOrientation();
|
|
|
|
|
|
|
|
|
|
if ( m_plotCurve )
|
|
|
|
|
{
|
|
|
|
|
m_plotCurve->setXAxis( wellLogPlot->valueAxis() );
|
|
|
|
|
m_plotCurve->setYAxis( wellLogPlot->depthAxis() );
|
|
|
|
|
}
|
2022-01-17 13:14:21 +01:00
|
|
|
}
|
|
|
|
|
|
2021-09-20 19:15:13 +02:00
|
|
|
if ( fillStyle() != Qt::BrushStyle::NoBrush )
|
2020-06-19 10:31:36 +02:00
|
|
|
{
|
2022-01-17 13:14:21 +01:00
|
|
|
RiuQwtPlotCurve* qwtPlotCurve = dynamic_cast<RiuQwtPlotCurve*>( m_plotCurve );
|
|
|
|
|
if ( qwtPlotCurve )
|
|
|
|
|
{
|
2022-02-21 07:15:56 +01:00
|
|
|
if ( orientation == RimDepthTrackPlot::DepthOrientation::VERTICAL )
|
|
|
|
|
{
|
|
|
|
|
qwtPlotCurve->setOrientation( Qt::Horizontal );
|
2022-08-15 16:02:47 +02:00
|
|
|
qwtPlotCurve->setBaseline( 0.0 );
|
2022-02-21 07:15:56 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
qwtPlotCurve->setOrientation( Qt::Vertical );
|
2022-08-15 16:02:47 +02:00
|
|
|
qwtPlotCurve->setBaseline( 0.0 );
|
2022-02-21 07:15:56 +01:00
|
|
|
}
|
2022-01-17 13:14:21 +01:00
|
|
|
}
|
2020-06-19 10:31:36 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-28 10:09:23 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
QString RimWellLogCurve::wellLogChannelName() const
|
|
|
|
|
{
|
|
|
|
|
return wellLogChannelUiName();
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-28 06:46:06 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
QString RimWellLogCurve::wellLogCurveIconName()
|
|
|
|
|
{
|
|
|
|
|
return ":/WellLogCurve16x16.png";
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-23 15:35:17 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-02-14 11:49:37 +01:00
|
|
|
void RimWellLogCurve::setOverrideCurveData( const std::vector<double>& propertyValues,
|
2020-06-23 15:35:17 +02:00
|
|
|
const std::vector<double>& depthValues,
|
2022-02-23 13:57:02 +01:00
|
|
|
const RiaCurveDataTools::CurveIntervals& curveIntervals )
|
2020-06-23 15:35:17 +02:00
|
|
|
{
|
2022-02-14 11:49:37 +01:00
|
|
|
auto minmax_it = std::minmax_element( propertyValues.begin(), propertyValues.end() );
|
|
|
|
|
this->setOverrideCurveDataPropertyValueRange( *( minmax_it.first ), *( minmax_it.second ) );
|
2022-02-23 13:57:02 +01:00
|
|
|
|
2022-01-17 13:14:21 +01:00
|
|
|
if ( m_plotCurve )
|
2020-06-23 15:35:17 +02:00
|
|
|
{
|
2022-02-23 13:57:02 +01:00
|
|
|
setPropertyAndDepthValuesToPlotCurve( propertyValues, depthValues );
|
|
|
|
|
|
2022-01-17 13:14:21 +01:00
|
|
|
m_plotCurve->setLineSegmentStartStopIndices( curveIntervals );
|
2020-06-23 15:35:17 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-22 11:17:24 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2015-09-22 11:17:24 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2016-09-13 09:59:34 +02:00
|
|
|
void RimWellLogCurve::updateZoomInParentPlot()
|
2015-09-22 11:17:24 +02:00
|
|
|
{
|
2020-01-08 11:03:45 +01:00
|
|
|
const double eps = 1.0e-8;
|
|
|
|
|
|
2020-02-04 09:45:32 +01:00
|
|
|
RimWellLogTrack* wellLogTrack;
|
|
|
|
|
firstAncestorOrThisOfType( wellLogTrack );
|
|
|
|
|
|
|
|
|
|
if ( wellLogTrack )
|
2015-09-22 11:17:24 +02:00
|
|
|
{
|
2022-02-14 11:49:37 +01:00
|
|
|
wellLogTrack->setAutoScalePropertyValuesIfNecessary();
|
2020-01-16 14:11:08 +01:00
|
|
|
|
2020-05-14 06:39:55 +02:00
|
|
|
RimDepthTrackPlot* wellLogPlot;
|
2020-02-04 09:45:32 +01:00
|
|
|
wellLogTrack->firstAncestorOrThisOfType( wellLogPlot );
|
|
|
|
|
|
|
|
|
|
if ( wellLogPlot )
|
2020-01-08 11:03:45 +01:00
|
|
|
{
|
2020-02-04 09:45:32 +01:00
|
|
|
double minPlotDepth, maxPlotDepth;
|
|
|
|
|
wellLogPlot->availableDepthRange( &minPlotDepth, &maxPlotDepth );
|
|
|
|
|
|
|
|
|
|
bool updateDepthZoom = false;
|
|
|
|
|
if ( minPlotDepth == std::numeric_limits<double>::infinity() ||
|
|
|
|
|
maxPlotDepth == -std::numeric_limits<double>::infinity() )
|
|
|
|
|
{
|
|
|
|
|
updateDepthZoom = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
double plotRange = std::abs( maxPlotDepth - minPlotDepth );
|
|
|
|
|
double minCurveDepth, maxCurveDepth;
|
|
|
|
|
m_curveData->calculateDepthRange( wellLogPlot->depthType(),
|
|
|
|
|
wellLogPlot->depthUnit(),
|
|
|
|
|
&minCurveDepth,
|
|
|
|
|
&maxCurveDepth );
|
|
|
|
|
updateDepthZoom = minCurveDepth < minPlotDepth - eps * plotRange ||
|
|
|
|
|
maxCurveDepth > maxPlotDepth + eps * plotRange;
|
|
|
|
|
}
|
|
|
|
|
if ( updateDepthZoom )
|
|
|
|
|
{
|
2022-03-08 08:42:21 +01:00
|
|
|
wellLogPlot->setAutoScaleDepthValuesEnabled( true );
|
2020-02-04 09:45:32 +01:00
|
|
|
}
|
2020-01-08 11:03:45 +01:00
|
|
|
wellLogPlot->updateZoom();
|
|
|
|
|
}
|
2015-09-22 11:17:24 +02:00
|
|
|
}
|
|
|
|
|
}
|
2015-09-22 15:23:52 +02:00
|
|
|
|
2015-10-15 11:27:12 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-07 13:39:50 +02:00
|
|
|
///
|
2015-10-15 11:27:12 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-07 13:39:50 +02:00
|
|
|
void RimWellLogCurve::updateLegendsInPlot()
|
2015-10-15 11:27:12 +02:00
|
|
|
{
|
2018-09-07 13:39:50 +02:00
|
|
|
RimWellLogTrack* wellLogTrack;
|
2019-09-06 10:40:57 +02:00
|
|
|
firstAncestorOrThisOfType( wellLogTrack );
|
|
|
|
|
if ( wellLogTrack )
|
2018-09-07 13:39:50 +02:00
|
|
|
{
|
2019-11-15 13:35:39 +01:00
|
|
|
wellLogTrack->updateLegend();
|
2018-09-07 13:39:50 +02:00
|
|
|
}
|
2015-10-15 11:27:12 +02:00
|
|
|
}
|
2019-09-30 09:48:05 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-02-14 11:49:37 +01:00
|
|
|
void RimWellLogCurve::setOverrideCurveDataPropertyValueRange( double minimumValue, double maximumValue )
|
2019-09-30 09:48:05 +02:00
|
|
|
{
|
2022-02-14 11:49:37 +01:00
|
|
|
m_curveDataPropertyValueRange = std::make_pair( minimumValue, maximumValue );
|
2019-09-30 09:48:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-02-14 11:49:37 +01:00
|
|
|
void RimWellLogCurve::calculateCurveDataPropertyValueRange()
|
2019-09-30 09:48:05 +02:00
|
|
|
{
|
|
|
|
|
// Invalidate range first
|
2022-02-14 11:49:37 +01:00
|
|
|
m_curveDataPropertyValueRange =
|
|
|
|
|
std::make_pair( std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity() );
|
|
|
|
|
for ( double xValue : m_curveData->propertyValues() )
|
2019-09-30 09:48:05 +02:00
|
|
|
{
|
|
|
|
|
if ( RiaCurveDataTools::isValidValue( xValue, false ) )
|
|
|
|
|
{
|
2022-02-14 11:49:37 +01:00
|
|
|
m_curveDataPropertyValueRange.first = std::min( m_curveDataPropertyValueRange.first, xValue );
|
|
|
|
|
m_curveDataPropertyValueRange.second = std::max( m_curveDataPropertyValueRange.second, xValue );
|
2019-09-30 09:48:05 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-02-04 09:45:32 +01:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimWellLogCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|
|
|
|
const QVariant& oldValue,
|
|
|
|
|
const QVariant& newValue )
|
|
|
|
|
{
|
2021-02-22 08:38:20 +01:00
|
|
|
RimStackablePlotCurve::fieldChangedByUi( changedField, oldValue, newValue );
|
|
|
|
|
|
2022-02-23 13:57:02 +01:00
|
|
|
if ( changedField == &m_showCurve )
|
2020-02-04 09:45:32 +01:00
|
|
|
{
|
2022-02-23 13:57:02 +01:00
|
|
|
if ( m_isStacked() || m_showCurve() )
|
|
|
|
|
{
|
|
|
|
|
updateZoomInParentPlot();
|
|
|
|
|
}
|
2020-02-04 09:45:32 +01:00
|
|
|
}
|
2021-02-22 08:38:20 +01:00
|
|
|
|
|
|
|
|
if ( changedField == &m_isStacked )
|
|
|
|
|
{
|
|
|
|
|
loadDataAndUpdate( true );
|
|
|
|
|
}
|
2020-02-04 09:45:32 +01:00
|
|
|
}
|
2022-02-23 13:57:02 +01:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
bool RimWellLogCurve::isVerticalCurve() const
|
|
|
|
|
{
|
|
|
|
|
RimDepthTrackPlot::DepthOrientation orientation = RimDepthTrackPlot::DepthOrientation::VERTICAL;
|
|
|
|
|
|
|
|
|
|
RimDepthTrackPlot* depthTrackPlot = nullptr;
|
|
|
|
|
firstAncestorOrThisOfType( depthTrackPlot );
|
|
|
|
|
if ( depthTrackPlot ) orientation = depthTrackPlot->depthOrientation();
|
|
|
|
|
|
|
|
|
|
return orientation == RimDepthTrackPlot::DepthOrientation::VERTICAL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
RiuPlotAxis RimWellLogCurve::depthAxis() const
|
|
|
|
|
{
|
|
|
|
|
RimDepthTrackPlot* depthTrackPlot;
|
|
|
|
|
this->firstAncestorOrThisOfTypeAsserted( depthTrackPlot );
|
|
|
|
|
|
|
|
|
|
return depthTrackPlot->depthAxis();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
RiuPlotAxis RimWellLogCurve::valueAxis() const
|
|
|
|
|
{
|
|
|
|
|
RimDepthTrackPlot* depthTrackPlot;
|
|
|
|
|
this->firstAncestorOrThisOfTypeAsserted( depthTrackPlot );
|
|
|
|
|
|
|
|
|
|
return depthTrackPlot->valueAxis();
|
|
|
|
|
}
|