///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2021- Equinor ASA // // 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. // ///////////////////////////////////////////////////////////////////////////////// #include "RigWellLogIndexDepthOffset.h" #include #include //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RigWellLogIndexDepthOffset::setIndexOffsetDepth( int kIndex, double topMd, double bottomMd, double topTvd, double bottomTvd ) { m_mdOffsets[kIndex] = std::pair( topMd, bottomMd ); m_tvdOffsets[kIndex] = std::pair( topTvd, bottomTvd ); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- double RigWellLogIndexDepthOffset::getTopMd( int kIndex ) const { auto hit = m_mdOffsets.find( kIndex ); if ( hit != m_mdOffsets.end() ) { return hit->second.first; } return std::numeric_limits::infinity(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- double RigWellLogIndexDepthOffset::getBottomMd( int kIndex ) const { auto hit = m_mdOffsets.find( kIndex ); if ( hit != m_mdOffsets.end() ) { return hit->second.second; } return std::numeric_limits::infinity(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- double RigWellLogIndexDepthOffset::getTopTvd( int kIndex ) const { auto hit = m_tvdOffsets.find( kIndex ); if ( hit != m_tvdOffsets.end() ) { return hit->second.first; } return std::numeric_limits::infinity(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- double RigWellLogIndexDepthOffset::getBottomTvd( int kIndex ) const { auto hit = m_tvdOffsets.find( kIndex ); if ( hit != m_tvdOffsets.end() ) { return hit->second.second; } return std::numeric_limits::infinity(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- std::vector RigWellLogIndexDepthOffset::sortedIndexes() const { std::vector indexes; for ( auto m : m_mdOffsets ) { indexes.push_back( m.first ); } std::sort( indexes.begin(), indexes.end() ); return indexes; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- bool RigWellLogIndexDepthOffset::hasIndex( int kIndex ) const { return m_mdOffsets.count( kIndex ) > 0; }