mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add seismic result info in 3D view (#10032)
Add seismic result info in 3D view and selection in tree
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
set(SOURCE_GROUP_HEADER_FILES
|
set(SOURCE_GROUP_HEADER_FILES
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RivSeismicSectionPartMgr.h
|
${CMAKE_CURRENT_LIST_DIR}/RivSeismicSectionPartMgr.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RivSeismicSectionSourceInfo.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SOURCE_GROUP_SOURCE_FILES
|
set(SOURCE_GROUP_SOURCE_FILES
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RivSeismicSectionPartMgr.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RivSeismicSectionPartMgr.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RivSeismicSectionSourceInfo.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "RivPartPriority.h"
|
#include "RivPartPriority.h"
|
||||||
#include "RivPolylinePartMgr.h"
|
#include "RivPolylinePartMgr.h"
|
||||||
|
#include "RivSeismicSectionSourceInfo.h"
|
||||||
|
|
||||||
#include "Rim3dView.h"
|
#include "Rim3dView.h"
|
||||||
#include "RimRegularLegendConfig.h"
|
#include "RimRegularLegendConfig.h"
|
||||||
@@ -106,6 +107,10 @@ void RivSeismicSectionPartMgr::appendGeometryPartsToModel( cvf::ModelBasicList*
|
|||||||
}
|
}
|
||||||
|
|
||||||
cvf::ref<cvf::Part> quadPart = createSingleTexturedQuadPart( displayPoints, part.texture );
|
cvf::ref<cvf::Part> quadPart = createSingleTexturedQuadPart( displayPoints, part.texture );
|
||||||
|
|
||||||
|
cvf::ref<RivSeismicSectionSourceInfo> si = new RivSeismicSectionSourceInfo( m_section, i );
|
||||||
|
quadPart->setSourceInfo( si.p() );
|
||||||
|
|
||||||
model->addPart( quadPart.p() );
|
model->addPart( quadPart.p() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,46 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2023 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 <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RivSeismicSectionSourceInfo.h"
|
||||||
|
|
||||||
|
#include "RimSeismicSection.h"
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RivSeismicSectionSourceInfo::RivSeismicSectionSourceInfo( RimSeismicSection* section, int partIndex )
|
||||||
|
: m_section( section )
|
||||||
|
, m_partIndex( partIndex )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimSeismicSection* RivSeismicSectionSourceInfo::section() const
|
||||||
|
{
|
||||||
|
return m_section;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
int RivSeismicSectionSourceInfo::partIndex() const
|
||||||
|
{
|
||||||
|
return m_partIndex;
|
||||||
|
}
|
@@ -0,0 +1,38 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2023 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 <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "cafPdmPointer.h"
|
||||||
|
|
||||||
|
#include "cvfObject.h"
|
||||||
|
|
||||||
|
class RimSeismicSection;
|
||||||
|
|
||||||
|
class RivSeismicSectionSourceInfo : public cvf::Object
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
RivSeismicSectionSourceInfo( RimSeismicSection* section, int partIndex );
|
||||||
|
|
||||||
|
RimSeismicSection* section() const;
|
||||||
|
int partIndex() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
caf::PdmPointer<RimSeismicSection> m_section;
|
||||||
|
int m_partIndex;
|
||||||
|
};
|
@@ -511,6 +511,16 @@ cvf::Vec3d RimSeismicData::convertToWorldCoords( int iLine, int xLine, double de
|
|||||||
return m_filereader->convertToWorldCoords( iLine, xLine, depth );
|
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;
|
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( "" );
|
||||||
|
}
|
||||||
|
@@ -81,13 +81,16 @@ public:
|
|||||||
|
|
||||||
std::vector<cvf::Vec3d> worldOutline() const;
|
std::vector<cvf::Vec3d> worldOutline() const;
|
||||||
|
|
||||||
cvf::Vec3d convertToWorldCoords( int iLine, int xLine, double depth );
|
cvf::Vec3d convertToWorldCoords( int iLine, int xLine, double depth );
|
||||||
|
std::pair<int, int> convertToInlineXline( cvf::Vec3d worldCoords );
|
||||||
|
|
||||||
std::shared_ptr<ZGYAccess::SeismicSliceData>
|
std::shared_ptr<ZGYAccess::SeismicSliceData>
|
||||||
sliceData( RiaDefines::SeismicSliceDirection direction, int sliceNumber, double zMin, double zMax );
|
sliceData( RiaDefines::SeismicSliceDirection direction, int sliceNumber, double zMin, double zMax );
|
||||||
std::shared_ptr<ZGYAccess::SeismicSliceData>
|
std::shared_ptr<ZGYAccess::SeismicSliceData>
|
||||||
sliceData( double worldX1, double worldY1, double worldX2, double worldY2, double zMin, double zMax );
|
sliceData( double worldX1, double worldY1, double worldX2, double worldY2, double zMin, double zMax );
|
||||||
|
|
||||||
|
float valueAt( cvf::Vec3d worldCoord );
|
||||||
|
|
||||||
std::pair<double, double> dataRangeMinMax() const;
|
std::pair<double, double> dataRangeMinMax() const;
|
||||||
|
|
||||||
RimRegularLegendConfig* legendConfig() const;
|
RimRegularLegendConfig* legendConfig() const;
|
||||||
|
@@ -54,6 +54,7 @@
|
|||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RimSeismicSection, "SeismicSection" );
|
CAF_PDM_SOURCE_INIT( RimSeismicSection, "SeismicSection" );
|
||||||
|
|
||||||
@@ -898,3 +899,32 @@ int RimSeismicSection::lowerFilterZ( int lowerGridLimit ) const
|
|||||||
return lowerGridLimit;
|
return lowerGridLimit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RimSeismicSection::resultInfoText( cvf::Vec3d worldCoord, int partIndex )
|
||||||
|
{
|
||||||
|
if ( ( seismicData() == nullptr ) || ( m_texturedSection.isNull() ) || ( partIndex >= m_texturedSection->partsCount() ) )
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
auto [iline, xline] = m_seismicData->convertToInlineXline( worldCoord );
|
||||||
|
|
||||||
|
QString retVal = QString( "Inline: %1\nCrossline: %2\nDepth: %3\n\n" ).arg( iline ).arg( xline ).arg( std::abs( (int)worldCoord[2] ) );
|
||||||
|
|
||||||
|
if ( m_texturedSection->partsCount() > 1 )
|
||||||
|
{
|
||||||
|
retVal += QString( "Section part: %1\n\n" ).arg( partIndex + 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
float val = m_seismicData->valueAt( worldCoord );
|
||||||
|
|
||||||
|
if ( !std::isnan( val ) )
|
||||||
|
{
|
||||||
|
retVal += QString( "Value: %1\n\n" ).arg( val );
|
||||||
|
}
|
||||||
|
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
@@ -89,6 +89,8 @@ public:
|
|||||||
int lowerFilterZ( int lowerGridLimit ) const;
|
int lowerFilterZ( int lowerGridLimit ) const;
|
||||||
RimIntersectionFilterEnum zFilterType() const;
|
RimIntersectionFilterEnum zFilterType() const;
|
||||||
|
|
||||||
|
QString resultInfoText( cvf::Vec3d worldCoord, int partIndex );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initAfterRead() override;
|
void initAfterRead() override;
|
||||||
caf::PdmFieldHandle* userDescriptionField() override;
|
caf::PdmFieldHandle* userDescriptionField() override;
|
||||||
|
@@ -60,6 +60,7 @@
|
|||||||
#include "RimLegendConfig.h"
|
#include "RimLegendConfig.h"
|
||||||
#include "RimPerforationInterval.h"
|
#include "RimPerforationInterval.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
#include "RimSeismicSection.h"
|
||||||
#include "RimSimWellInView.h"
|
#include "RimSimWellInView.h"
|
||||||
#include "RimStimPlanFractureTemplate.h"
|
#include "RimStimPlanFractureTemplate.h"
|
||||||
#include "RimSurfaceInView.h"
|
#include "RimSurfaceInView.h"
|
||||||
@@ -82,6 +83,7 @@
|
|||||||
#include "RivObjectSourceInfo.h"
|
#include "RivObjectSourceInfo.h"
|
||||||
#include "RivPartPriority.h"
|
#include "RivPartPriority.h"
|
||||||
#include "RivReservoirSurfaceIntersectionSourceInfo.h"
|
#include "RivReservoirSurfaceIntersectionSourceInfo.h"
|
||||||
|
#include "RivSeismicSectionSourceInfo.h"
|
||||||
#include "RivSimWellConnectionSourceInfo.h"
|
#include "RivSimWellConnectionSourceInfo.h"
|
||||||
#include "RivSimWellPipeSourceInfo.h"
|
#include "RivSimWellPipeSourceInfo.h"
|
||||||
#include "RivSourceInfo.h"
|
#include "RivSourceInfo.h"
|
||||||
@@ -713,9 +715,10 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard
|
|||||||
if ( firstHitPart && firstHitPart->sourceInfo() )
|
if ( firstHitPart && firstHitPart->sourceInfo() )
|
||||||
{
|
{
|
||||||
// clang-format off
|
// clang-format off
|
||||||
const RivObjectSourceInfo* rivObjectSourceInfo = dynamic_cast<const RivObjectSourceInfo*>( firstHitPart->sourceInfo() );
|
const RivObjectSourceInfo* rivObjectSourceInfo = dynamic_cast<const RivObjectSourceInfo*>( firstHitPart->sourceInfo() );
|
||||||
const RivSimWellPipeSourceInfo* eclipseWellSourceInfo = dynamic_cast<const RivSimWellPipeSourceInfo*>( firstHitPart->sourceInfo() );
|
const RivSimWellPipeSourceInfo* eclipseWellSourceInfo = dynamic_cast<const RivSimWellPipeSourceInfo*>( firstHitPart->sourceInfo() );
|
||||||
const RivWellConnectionSourceInfo* wellConnectionSourceInfo = dynamic_cast<const RivWellConnectionSourceInfo*>( firstHitPart->sourceInfo() );
|
const RivWellConnectionSourceInfo* wellConnectionSourceInfo = dynamic_cast<const RivWellConnectionSourceInfo*>( firstHitPart->sourceInfo() );
|
||||||
|
const RivSeismicSectionSourceInfo* seismicSourceInfo = dynamic_cast<const RivSeismicSectionSourceInfo*>(firstHitPart->sourceInfo());
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
if ( rivObjectSourceInfo )
|
if ( rivObjectSourceInfo )
|
||||||
@@ -949,6 +952,30 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard
|
|||||||
}
|
}
|
||||||
RiuMainWindow::instance()->selectAsCurrentItem( simWellConnectionSourceInfo->simWellInView(), allowActiveViewChange );
|
RiuMainWindow::instance()->selectAsCurrentItem( simWellConnectionSourceInfo->simWellInView(), allowActiveViewChange );
|
||||||
}
|
}
|
||||||
|
else if ( seismicSourceInfo != nullptr )
|
||||||
|
{
|
||||||
|
auto section = seismicSourceInfo->section();
|
||||||
|
|
||||||
|
RiuMainWindow::instance()->selectAsCurrentItem( section );
|
||||||
|
|
||||||
|
cvf::ref<caf::DisplayCoordTransform> transForm = mainOrComparisonView->displayCoordTransform();
|
||||||
|
cvf::Vec3d domainCoord = transForm->transformToDomainCoord( globalIntersectionPoint );
|
||||||
|
|
||||||
|
// Set surface resultInfo text
|
||||||
|
QString resultInfoText = "Seismic Section: \"" + section->userDescription() + "\"\n\n";
|
||||||
|
|
||||||
|
resultInfoText += section->resultInfoText( domainCoord, seismicSourceInfo->partIndex() );
|
||||||
|
|
||||||
|
// Set intersection point result text
|
||||||
|
QString pointText = QString( "Global point : [E: %1, N: %2, Depth: %3]" )
|
||||||
|
.arg( domainCoord.x(), 5, 'f', 2 )
|
||||||
|
.arg( domainCoord.y(), 5, 'f', 2 )
|
||||||
|
.arg( -domainCoord.z(), 5, 'f', 2 );
|
||||||
|
resultInfoText.append( pointText );
|
||||||
|
|
||||||
|
// Display result info text
|
||||||
|
RiuMainWindow::instance()->setResultInfo( resultInfoText );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
ThirdParty/openzgy
vendored
2
ThirdParty/openzgy
vendored
Submodule ThirdParty/openzgy updated: 9629375019...9c61a2b55d
Reference in New Issue
Block a user