Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into grid-geometry-extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgenherje committed Feb 27, 2024
2 parents 8d7986b + a0ecdf4 commit e0118b5
Show file tree
Hide file tree
Showing 186 changed files with 3,691 additions and 1,191 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ResInsightWithCache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r GrpcInterface/Python/requirements.txt
pip install -r GrpcInterface/Python/dev-requirements.txt
- name: Use CMake
uses: lukka/get-cmake@latest
Expand Down
9 changes: 5 additions & 4 deletions ApplicationExeCode/Resources/ResInsight.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,15 @@
<file>SeismicDelta16x16.png</file>
<file>SeismicView16x16.png</file>
<file>SeismicView24x24.png</file>
<file>SeismicViews24x24.png</file>
<file>SeismicData24x24.png</file>
<file>SeismicSection16x16.png</file>
<file>Fullscreen.png</file>
<file>SeismicViews24x24.png</file>
<file>SeismicData24x24.png</file>
<file>SeismicSection16x16.png</file>
<file>Fullscreen.png</file>
<file>plot-template-standard.svg</file>
<file>plot-template-ensemble.svg</file>
<file>decline-curve.svg</file>
<file>regression-curve.svg</file>
<file>padlock.svg</file>
</qresource>
<qresource prefix="/Shader">
<file>fs_CellFace.glsl</file>
Expand Down
11 changes: 11 additions & 0 deletions ApplicationExeCode/Resources/padlock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ApplicationExeCode/RiaMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ RiaApplication* createApplication( int& argc, char* argv[] )
{
for ( int i = 1; i < argc; ++i )
{
if ( !qstrcmp( argv[i], "--console" ) || !qstrcmp( argv[i], "--unittest" ) || !qstrcmp( argv[i], "--version" ) )
if ( !qstrcmp( argv[i], "--console" ) || !qstrcmp( argv[i], "--unittest" ) )
{
#ifdef ENABLE_GRPC
return new RiaGrpcConsoleApplication( argc, argv );
Expand Down
2 changes: 2 additions & 0 deletions ApplicationLibCode/Adm/RiaVersionInfo.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@
#define RESINSIGHT_OCTAVE_VERSION "@OCTAVE_VERSION_STRING@"

#define RESINSIGHT_PYTHON_VERSION "@Python3_VERSION@"

#define RESINSIGHT_GIT_HASH "@RESINSIGHT_GIT_HASH@"
9 changes: 8 additions & 1 deletion ApplicationLibCode/Application/RiaApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include "RicfCommandObject.h"

#include "PlotTemplates/RimPlotTemplateFolderItem.h"
#include "Polygons/RimPolygonCollection.h"

#include "Rim2dIntersectionViewCollection.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationInViewCollection.h"
Expand Down Expand Up @@ -544,6 +546,8 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct
{
seismicData->ensureFileReaderIsInitialized();
}

oilField->polygonCollection()->loadData();
}

{
Expand Down Expand Up @@ -658,7 +662,10 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct
}
}

setActiveReservoirView( riv );
if ( riv->showWindow() )
{
setActiveReservoirView( riv );
}

RimGridView* rigv = dynamic_cast<RimGridView*>( riv );
if ( rigv ) rigv->cellFilterCollection()->updateIconState();
Expand Down
1 change: 1 addition & 0 deletions ApplicationLibCode/Application/RiaConsoleApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ RiaApplication::ApplicationStatus RiaConsoleApplication::handleArguments( gsl::n
if ( progOpt->option( "version" ) )
{
QString text = QString( STRPRODUCTVER ) + "\n";
text += "SHA " + QString( RESINSIGHT_GIT_HASH ) + "\n";

showFormattedTextInMessageBoxOrConsole( text );

Expand Down
9 changes: 9 additions & 0 deletions ApplicationLibCode/Application/RiaDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,17 @@ enum class View3dContent
ALL = 0b00011111
};

enum class ItemIn3dView
{
NONE = 0b00000000,
SURFACE = 0b00000001,
POLYGON = 0b00000010,
ALL = 0b00000011
};

}; // namespace RiaDefines

// Activate bit mask operators at global scope
ENABLE_BITMASK_OPERATORS( RiaDefines::MultiPlotPageUpdateType )
ENABLE_BITMASK_OPERATORS( RiaDefines::View3dContent )
ENABLE_BITMASK_OPERATORS( RiaDefines::ItemIn3dView )
10 changes: 10 additions & 0 deletions ApplicationLibCode/Application/RiaGuiApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,16 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( gsl::not_n
return RiaApplication::ApplicationStatus::EXIT_COMPLETED;
}

if ( progOpt->option( "version" ) )
{
QString text = QString( STRPRODUCTVER ) + "\n";
text += "SHA " + QString( RESINSIGHT_GIT_HASH ) + "\n";

showFormattedTextInMessageBoxOrConsole( text );

return RiaApplication::ApplicationStatus::EXIT_COMPLETED;
}

// Code generation
// -----------------
if ( cvf::Option o = progOpt->option( "generate" ) )
Expand Down
4 changes: 2 additions & 2 deletions ApplicationLibCode/Application/RiaMemoryCleanup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ RiaMemoryCleanup::RiaMemoryCleanup()
m_resultsToDelete.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );

CAF_PDM_InitFieldNoDefault( &m_performDelete, "ClearSelectedData", "" );
caf::PdmUiPushButtonEditor::configureEditorForField( &m_performDelete );
caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_performDelete );

CAF_PDM_InitFieldNoDefault( &m_showMemoryReport, "ShowMemoryReport", "" );
caf::PdmUiPushButtonEditor::configureEditorForField( &m_showMemoryReport );
caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_showMemoryReport );
}

//--------------------------------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions ApplicationLibCode/Application/RiaPreferencesSummary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ RiaPreferencesSummary::RiaPreferencesSummary()
"" );

CAF_PDM_InitField( &m_selectDefaultTemplates, "selectDefaultTemplate", false, "", "", "Select Default Templates" );
m_selectDefaultTemplates.xmlCapability()->disableIO();
m_selectDefaultTemplates.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_selectDefaultTemplates );

CAF_PDM_InitFieldNoDefault( &m_selectedDefaultTemplates, "defaultSummaryTemplates", "Select Summary Plot Templates" );
m_selectedDefaultTemplates.uiCapability()->setUiReadOnly( true );
Expand Down
4 changes: 4 additions & 0 deletions ApplicationLibCode/Application/RiaResultNames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,5 +595,9 @@ std::vector<QString> RiaResultNames::wbsDerivedResultNames()
wbsSHMkMaxResult(),
wbsFGMkExpResult(),
wbsFGMkMinResult(),
wbsPPMinResult(),
wbsPPMaxResult(),
wbsPPExpResult(),
wbsPPInitialResult(),
};
}
1 change: 1 addition & 0 deletions ApplicationLibCode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ list(
ProjectDataModel/Intersections/CMakeLists_files.cmake
ProjectDataModel/CellFilters/CMakeLists_files.cmake
ProjectDataModel/ProcessControl/CMakeLists_files.cmake
ProjectDataModel/Polygons/CMakeLists_files.cmake
ProjectDataModel/WellLog/CMakeLists_files.cmake
ProjectDataModel/WellMeasurement/CMakeLists_files.cmake
ProjectDataModel/WellPath/CMakeLists_files.cmake
Expand Down
1 change: 1 addition & 0 deletions ApplicationLibCode/Commands/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ set(COMMAND_REFERENCED_CMAKE_FILES
PlotTemplateCommands/CMakeLists_files.cmake
FractureCommands/CMakeLists_files.cmake
PlotBuilderCommands/CMakeLists_files.cmake
PolygonCommands/CMakeLists_files.cmake
)

# Include source file lists from *.cmake files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#include "RicNewPolygonFilter3dviewFeature.h"

#include "Polygons/RimPolygonInView.h"

#include "RiaApplication.h"
#include "RimCase.h"
#include "RimCellFilterCollection.h"
Expand Down Expand Up @@ -46,7 +48,7 @@ void RicNewPolygonFilter3dviewFeature::onActionTriggered( bool isChecked )
// and the case to use
RimCase* sourceCase = viewOrComparisonView->ownerCase();

RimPolygonFilter* lastCreatedOrUpdated = filtColl->addNewPolygonFilter( sourceCase );
RimPolygonFilter* lastCreatedOrUpdated = filtColl->addNewPolygonFilter( sourceCase, nullptr );
if ( lastCreatedOrUpdated )
{
Riu3DMainWindowTools::selectAsCurrentItem( lastCreatedOrUpdated );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@

#include "RicNewPolygonFilterFeature.h"

#include "RiaApplication.h"

#include "Polygons/RimPolygon.h"
#include "Polygons/RimPolygonInView.h"

#include "RimCase.h"
#include "RimCellFilterCollection.h"
#include "RimGridView.h"
#include "RimPolygonFilter.h"

#include "Riu3DMainWindowTools.h"

#include "cafSelectionManagerTools.h"
Expand All @@ -35,16 +42,31 @@ CAF_CMD_SOURCE_INIT( RicNewPolygonFilterFeature, "RicNewPolygonFilterFeature" );
//--------------------------------------------------------------------------------------------------
void RicNewPolygonFilterFeature::onActionTriggered( bool isChecked )
{
// Find the selected Cell Filter Collection
std::vector<RimCellFilterCollection*> colls = caf::selectedObjectsByTypeStrict<RimCellFilterCollection*>();
if ( colls.empty() ) return;
RimCellFilterCollection* filtColl = colls[0];
auto cellFilterCollection = caf::SelectionManager::instance()->selectedItemOfType<RimCellFilterCollection>();

if ( !cellFilterCollection )
{
RimGridView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( activeView )
{
cellFilterCollection = activeView->cellFilterCollection();
}
}

if ( !cellFilterCollection ) return;

auto polygon = caf::SelectionManager::instance()->selectedItemOfType<RimPolygon>();
if ( !polygon )
{
if ( auto polygonInView = caf::SelectionManager::instance()->selectedItemOfType<RimPolygonInView>() )
{
polygon = polygonInView->polygon();
}
}

// and the case to use
RimCase* sourceCase = filtColl->firstAncestorOrThisOfTypeAsserted<RimCase>();
auto sourceCase = cellFilterCollection->firstAncestorOrThisOfTypeAsserted<RimCase>();

RimPolygonFilter* lastCreatedOrUpdated = filtColl->addNewPolygonFilter( sourceCase );
if ( lastCreatedOrUpdated )
if ( auto lastCreatedOrUpdated = cellFilterCollection->addNewPolygonFilter( sourceCase, polygon ) )
{
Riu3DMainWindowTools::selectAsCurrentItem( lastCreatedOrUpdated );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineIntersectionFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewAzimuthDipIntersectionFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicCopyIntersectionsToAllViewsInCaseFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonIntersectionFeature.h
)

set(SOURCE_GROUP_SOURCE_FILES
Expand All @@ -16,6 +17,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineIntersectionFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewAzimuthDipIntersectionFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCopyIntersectionsToAllViewsInCaseFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonIntersectionFeature.cpp
)

list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2024 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 "RicNewPolygonIntersectionFeature.h"

#include "RiaApplication.h"

#include "RimExtrudedCurveIntersection.h"
#include "RimGridView.h"
#include "RimIntersectionCollection.h"

#include "Polygons/RimPolygon.h"
#include "Polygons/RimPolygonInView.h"

#include "cafSelectionManager.h"

#include <QAction>

CAF_CMD_SOURCE_INIT( RicNewPolygonIntersectionFeature, "RicNewPolygonIntersectionFeature" );

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewPolygonIntersectionFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
if ( !activeView ) return;

auto collection = activeView->intersectionCollection();
if ( !collection ) return;

auto polygon = caf::SelectionManager::instance()->selectedItemOfType<RimPolygon>();
if ( !polygon )
{
if ( auto polygonInView = caf::SelectionManager::instance()->selectedItemOfType<RimPolygonInView>() )
{
polygon = polygonInView->polygon();
}
}

auto intersection = new RimExtrudedCurveIntersection();
intersection->configureForProjectPolyLine( polygon );
collection->appendIntersectionAndUpdate( intersection );
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewPolygonIntersectionFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon( QIcon( ":/CrossSection16x16.png" ) );
actionToSetup->setText( "Create Polygon Intersection" );
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
// Copyright (C) 2024 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
Expand All @@ -23,12 +23,11 @@
//==================================================================================================
///
//==================================================================================================
class RicAppendPointsToPolygonFilterFeature : public caf::CmdFeature
class RicNewPolygonIntersectionFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;

protected:
bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};
19 changes: 19 additions & 0 deletions ApplicationLibCode/Commands/PolygonCommands/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFileFeature.h
)

set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFileFeature.cpp
)

list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})

list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES})

source_group(
"CommandFeature\\Polygons"
FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES}
${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake
)
Loading

0 comments on commit e0118b5

Please sign in to comment.