///////////////////////////////////////////////////////////////////////////////// // // 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RiaDefines.h" #include "RiaWellLogUnitTools.h" #include "cvfObject.h" #include #include #include #include class RigWellLogCurveDataTestInterface; //================================================================================================== /// //================================================================================================== class RigWellLogCurveData : public cvf::Object { public: RigWellLogCurveData(); ~RigWellLogCurveData() override; void clear(); void setDepthUnit( RiaDefines::DepthUnitType depthUnit ); void setValuesAndDepths( const std::vector& propertyValues, const std::vector& depths, RiaDefines::DepthTypeEnum depthType, double rkbDiff, RiaDefines::DepthUnitType depthUnit, bool isExtractionCurve, bool useLogarithmicScale ); void setValuesAndDepths( const std::vector& propertyValues, const std::map>& depths, double rkbDiff, RiaDefines::DepthUnitType depthUnit, bool isExtractionCurve, bool useLogarithmicScale ); void setPropertyValueUnit( const QString& propertyValueUnitString ); std::vector propertyValues() const; std::vector propertyValues( const QString& units ) const; QString propertyValueUnit() const; std::vector depths( RiaDefines::DepthTypeEnum depthType ) const; std::vector depths( RiaDefines::DepthTypeEnum depthType, RiaDefines::DepthUnitType destinationDepthUnit ) const; std::set availableDepthTypes() const; bool calculateDepthRange( RiaDefines::DepthTypeEnum depthType, RiaDefines::DepthUnitType depthUnit, double* minMD, double* maxMD ) const; RiaDefines::DepthUnitType depthUnit() const; std::vector propertyValuesByIntervals() const; std::vector depthValuesByIntervals( RiaDefines::DepthTypeEnum depthType, RiaDefines::DepthUnitType destinationDepthUnit ) const; std::vector> polylineStartStopIndices() const; cvf::ref calculateResampledCurveData( double newMeasuredDepthStepSize ) const; cvf::ref calculateResampledCurveData( RiaDefines::DepthTypeEnum resamplingDepthType, const std::vector& depths ) const; static void interpolateSegment( RiaDefines::DepthTypeEnum resamplingDepthType, std::vector& resampledValues, std::map>& resampledDepths, double targetDepthValue, size_t firstIndex, const std::map>& originalDepths, const std::vector& propertyValues, double eps ); static std::pair, std::map>> createResampledValuesAndDepths( RiaDefines::DepthTypeEnum resamplingDepthType, const std::vector& targetDepths, const std::map>& originalDepths, const std::vector& propertyValues ); private: void calculateIntervalsOfContinousValidValues(); static std::vector depthsForDepthUnit( const std::vector& depths, RiaDefines::DepthUnitType sourceDepthUnit, RiaDefines::DepthUnitType destinationDepthUnit ); static void splitIntervalAtEmptySpace( const std::vector& depthValues, size_t startIdx, size_t stopIdx, std::vector>* intervals ); private: std::vector m_propertyValues; std::map> m_depths; bool m_isExtractionCurve; double m_rkbDiff; bool m_useLogarithmicScale; std::vector> m_intervalsOfContinousValidValues; RiaDefines::DepthUnitType m_depthUnit; QString m_propertyValueUnitString; };