mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 07:00:17 -05:00
Add seismic 3d view (#10472)
* Show seismic, surfaces, annotations and wellpaths in new view not requiring a grid loaded first.
This commit is contained in:
1 parent
5bf2c2a89d
commit
2172199999
73 files changed
+1520
-299
No files matched your search
@@ -8,6 +8,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellpathSeismicSectionFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSeismicSectionFromIntersectionFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSeismicDifferenceFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSeismicViewFeature.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -20,6 +21,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellpathSeismicSectionFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSeismicSectionFromIntersectionFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSeismicDifferenceFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSeismicViewFeature.cpp
|
||||
)
|
||||
|
||||
list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
|
||||
@@ -63,7 +63,7 @@ void RicImportSeismicFeature::onActionTriggered( bool isChecked )
|
||||
app->setLastUsedDialogDirectory( "SEISMIC_GRID", QFileInfo( fileName ).absolutePath() );
|
||||
|
||||
auto proj = RimProject::current();
|
||||
auto& seisColl = proj->activeOilField()->seismicCollection();
|
||||
auto& seisColl = proj->activeOilField()->seismicDataCollection();
|
||||
|
||||
if ( !seisColl ) return;
|
||||
|
||||
|
||||
@@ -37,6 +37,6 @@ void RicNewInlineSeismicSectionFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewInlineSeismicSectionFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Seismic16x16.png" ) );
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicSection16x16.png" ) );
|
||||
actionToSetup->setText( "New Inline Section" );
|
||||
}
|
||||
@@ -37,6 +37,6 @@ void RicNewPolylineSeismicSectionFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPolylineSeismicSectionFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Seismic16x16.png" ) );
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicSection16x16.png" ) );
|
||||
actionToSetup->setText( "New Polyline Section" );
|
||||
}
|
||||
@@ -51,7 +51,7 @@ bool RicNewSeismicDifferenceFeature::isCommandEnabled() const
|
||||
void RicNewSeismicDifferenceFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
auto proj = RimProject::current();
|
||||
auto& seisColl = proj->activeOilField()->seismicCollection();
|
||||
auto& seisColl = proj->activeOilField()->seismicDataCollection();
|
||||
if ( !seisColl ) return;
|
||||
|
||||
auto seismicInput = selectedSeismic();
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RicNewSeismicViewFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaSeismicDefines.h"
|
||||
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSeismicData.h"
|
||||
#include "RimSeismicDataCollection.h"
|
||||
#include "RimSeismicSection.h"
|
||||
#include "RimSeismicSectionCollection.h"
|
||||
#include "RimSeismicView.h"
|
||||
#include "RimSeismicViewCollection.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafSelectionManagerTools.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QMessageBox>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicNewSeismicViewFeature, "RicNewSeismicViewFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewSeismicViewFeature::isCommandEnabled() const
|
||||
{
|
||||
auto proj = RimProject::current();
|
||||
auto& seisColl = proj->activeOilField()->seismicDataCollection();
|
||||
return ( seisColl && !seisColl->isEmpty() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewSeismicViewFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
auto proj = RimProject::current();
|
||||
auto& seisViewColl = proj->activeOilField()->seismicViewCollection();
|
||||
auto& seisDataColl = proj->activeOilField()->seismicDataCollection();
|
||||
if ( !seisViewColl || !seisDataColl ) return;
|
||||
|
||||
std::vector<caf::PdmUiItem*> uiItems;
|
||||
caf::SelectionManager::instance()->selectedItems( uiItems );
|
||||
|
||||
RimSeismicData* selectedData = nullptr;
|
||||
|
||||
if ( uiItems.size() > 0 )
|
||||
{
|
||||
selectedData = dynamic_cast<RimSeismicData*>( uiItems[0] );
|
||||
}
|
||||
|
||||
if ( ( selectedData == nullptr ) && !seisDataColl->isEmpty() )
|
||||
{
|
||||
selectedData = seisDataColl->seismicData()[0];
|
||||
}
|
||||
|
||||
if ( selectedData )
|
||||
{
|
||||
auto view = seisViewColl->addView( selectedData, RiaDefines::SeismicSectionType::SS_INLINE );
|
||||
|
||||
if ( view )
|
||||
{
|
||||
seisViewColl->updateAllRequiredEditors();
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
|
||||
if ( view->seismicSectionCollection()->size() > 0 )
|
||||
{
|
||||
auto section = view->seismicSectionCollection()->seismicSections()[0];
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( section );
|
||||
}
|
||||
else
|
||||
{
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( view );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewSeismicViewFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicView16x16.png" ) );
|
||||
actionToSetup->setText( "New Seismic View" );
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "cafCmdFeature.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewSeismicViewFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() const override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
||||
@@ -37,6 +37,6 @@ void RicNewWellpathSeismicSectionFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellpathSeismicSectionFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Seismic16x16.png" ) );
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicSection16x16.png" ) );
|
||||
actionToSetup->setText( "New Well Path Section" );
|
||||
}
|
||||
@@ -37,6 +37,6 @@ void RicNewXlineSeismicSectionFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewXlineSeismicSectionFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Seismic16x16.png" ) );
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicSection16x16.png" ) );
|
||||
actionToSetup->setText( "New Xline Section" );
|
||||
}
|
||||
@@ -37,6 +37,6 @@ void RicNewZSliceSeismicSectionFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewZSliceSeismicSectionFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Seismic16x16.png" ) );
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicSection16x16.png" ) );
|
||||
actionToSetup->setText( "New Depth Slice" );
|
||||
}
|
||||
+1
-1
@@ -113,7 +113,7 @@ void RicSeismicSectionFromIntersectionFeature::onActionTriggered( bool isChecked
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSeismicSectionFromIntersectionFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/Seismic16x16.png" ) );
|
||||
actionToSetup->setIcon( QIcon( ":/SeismicSection16x16.png" ) );
|
||||
actionToSetup->setText( "Create as Seismic Section" );
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user