Add seismic result info in 3D view (#10032)

Add seismic result info in 3D view and selection in tree
This commit is contained in:
jonjenssen
2023-03-29 14:08:45 +02:00
committed by GitHub
parent 090293c421
commit 1299af401b
10 changed files with 187 additions and 3 deletions

View File

@@ -511,6 +511,16 @@ cvf::Vec3d RimSeismicData::convertToWorldCoords( int iLine, int xLine, double de
return m_filereader->convertToWorldCoords( iLine, xLine, depth );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::pair<int, int> RimSeismicData::convertToInlineXline( cvf::Vec3d worldCoords )
{
if ( !openFileIfNotOpen() ) return { 0, 0 };
return m_filereader->convertToInlineXline( worldCoords[0], worldCoords[1] );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -681,3 +691,24 @@ std::shared_ptr<ZGYAccess::SeismicSliceData>
return retdata;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
float RimSeismicData::valueAt( cvf::Vec3d worldCoord )
{
if ( openFileIfNotOpen() )
{
auto [iline, xline] = convertToInlineXline( worldCoord );
int iIndex = toInlineIndex( iline );
int xIndex = toXlineIndex( xline );
int zIndex = toZIndex( std::abs( worldCoord[2] ) );
auto slice = m_filereader->trace( iIndex, xIndex, zIndex, 1 );
if ( slice->size() == 1 ) return slice->values()[0];
}
return std::nanf( "" );
}