Files
ResInsight/ApplicationLibCode/ReservoirDataModel/Well/RigWellLogCurveData.h
Magne Sjaastad 8c82f834cf #13727 WellLog: Remove cvf::Object from RigWellLogCurveData, use value types throughout
- RigWellLogCurveData no longer inherits from cvf::Object; calculateResampledCurveData returns by value
- RimWellLogCurve::curveData() returns const reference instead of pointer; m_curveData stored by value
- RigLasFileExporter: replace cvf::Collection with std::vector<RigWellLogCurveData>; SingleChannelData stores RigWellLogCurveData by value
- Update all callers to use dot notation instead of pointer dereference
2026-03-17 20:13:26 +01:00

125 lines
6.7 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
// 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.
//
// 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.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaDefines.h"
#include "RiaWellLogUnitTools.h"
#include <QString>
#include <map>
#include <set>
#include <vector>
class RigWellLogCurveDataTestInterface;
//==================================================================================================
///
//==================================================================================================
class RigWellLogCurveData
{
public:
RigWellLogCurveData();
~RigWellLogCurveData();
void clear();
void setDepthUnit( RiaDefines::DepthUnitType depthUnit );
void setValuesAndDepths( const std::vector<double>& propertyValues,
const std::vector<double>& depths,
RiaDefines::DepthType depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale );
void setValuesAndDepths( const std::vector<double>& propertyValues,
const std::map<RiaDefines::DepthType, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale );
void setPropertyValueUnit( const QString& propertyValueUnitString );
std::vector<double> propertyValues() const;
std::vector<double> propertyValues( const QString& units ) const;
QString propertyValueUnit() const;
std::vector<double> depths( RiaDefines::DepthType depthType ) const;
std::vector<double> depths( RiaDefines::DepthType depthType, RiaDefines::DepthUnitType destinationDepthUnit ) const;
std::set<RiaDefines::DepthType> availableDepthTypes() const;
bool calculateDepthRange( RiaDefines::DepthType depthType, RiaDefines::DepthUnitType depthUnit, double* minMD, double* maxMD ) const;
RiaDefines::DepthUnitType depthUnit() const;
std::vector<double> propertyValuesByIntervals() const;
std::vector<double> depthValuesByIntervals( RiaDefines::DepthType depthType, RiaDefines::DepthUnitType destinationDepthUnit ) const;
std::vector<std::pair<size_t, size_t>> polylineStartStopIndices() const;
RigWellLogCurveData calculateResampledCurveData( double newMeasuredDepthStepSize ) const;
RigWellLogCurveData calculateResampledCurveData( RiaDefines::DepthType resamplingDepthType, const std::vector<double>& depths ) const;
// Made static due to unit testing
static void createAndAddInterpolatedSegmentValueAndDepths( std::vector<double>& resampledValues,
std::map<RiaDefines::DepthType, std::vector<double>>& resampledDepths,
RiaDefines::DepthType resamplingDepthType,
double targetDepthValue,
size_t firstIndex,
size_t secondIndex,
const std::map<RiaDefines::DepthType, std::vector<double>>& originalDepths,
const std::vector<double>& propertyValues,
double eps );
// Made static due to unit testing
static std::pair<std::vector<double>, std::map<RiaDefines::DepthType, std::vector<double>>>
createResampledValuesAndDepths( RiaDefines::DepthType resamplingDepthType,
const std::vector<double>& targetDepths,
const std::map<RiaDefines::DepthType, std::vector<double>>& originalDepths,
const std::vector<double>& propertyValues );
private:
void calculateIntervalsOfContinousValidValues();
static std::vector<double> depthsForDepthUnit( const std::vector<double>& depths,
RiaDefines::DepthUnitType sourceDepthUnit,
RiaDefines::DepthUnitType destinationDepthUnit );
static void splitIntervalAtEmptySpace( const std::vector<double>& depthValues,
size_t startIdx,
size_t stopIdx,
std::vector<std::pair<size_t, size_t>>* intervals );
private:
std::vector<double> m_propertyValues;
std::map<RiaDefines::DepthType, std::vector<double>> m_depths;
bool m_isExtractionCurve;
double m_rkbDiff;
bool m_useLogarithmicScale;
std::vector<std::pair<size_t, size_t>> m_intervalsOfContinousValidValues;
RiaDefines::DepthUnitType m_depthUnit;
QString m_propertyValueUnitString;
};