diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp index 4bf3e65f6c..f4be3a33d3 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp @@ -350,9 +350,10 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot ) isUsingPseudoLength = false; } - m_qwtPlotCurve->setSamples( curveData()->xPlotValues().data(), - curveData()->depthPlotValues( depthType, displayUnit ).data(), - static_cast( curveData()->xPlotValues().size() ) ); + std::vector xPlotValues = curveData()->xPlotValues(); + std::vector depthPlotValues = curveData()->depthPlotValues( depthType, displayUnit ); + CAF_ASSERT( xPlotValues.size() == depthPlotValues.size() ); + m_qwtPlotCurve->setSamples( xPlotValues.data(), depthPlotValues.data(), static_cast( xPlotValues.size() ) ); m_qwtPlotCurve->setLineSegmentStartStopIndices( curveData()->polylineStartStopIndices() ); diff --git a/ApplicationCode/ReservoirDataModel/RigWellLogCurveData.cpp b/ApplicationCode/ReservoirDataModel/RigWellLogCurveData.cpp index 1ecb03904d..bf09fbd313 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellLogCurveData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellLogCurveData.cpp @@ -147,27 +147,25 @@ std::vector RigWellLogCurveData::depths( RiaDefines::DepthTypeEnum depth return it->second; } - if ( m_rkbDiff != 0.0 ) + if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB && m_depths.count( RiaDefines::TRUE_VERTICAL_DEPTH ) ) { - if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB && m_depths.count( RiaDefines::TRUE_VERTICAL_DEPTH ) ) + std::vector tvds = depths( RiaDefines::TRUE_VERTICAL_DEPTH ); + for ( double& tvdValue : tvds ) { - std::vector tvds = depths( RiaDefines::TRUE_VERTICAL_DEPTH ); - for ( double& tvdValue : tvds ) - { - tvdValue += m_rkbDiff; - } - return tvds; - } - else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH && m_depths.count( RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) ) - { - std::vector tvds = depths( RiaDefines::TRUE_VERTICAL_DEPTH_RKB ); - for ( double& tvdValue : tvds ) - { - tvdValue -= m_rkbDiff; - } - return tvds; + tvdValue += m_rkbDiff; } + return tvds; } + else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH && m_depths.count( RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) ) + { + std::vector tvds = depths( RiaDefines::TRUE_VERTICAL_DEPTH_RKB ); + for ( double& tvdValue : tvds ) + { + tvdValue -= m_rkbDiff; + } + return tvds; + } + return std::vector(); }