diff --git a/.github/workflows/ResInsightWithCache.yml b/.github/workflows/ResInsightWithCache.yml
index 1d45d0c2bb..7c83bd0a88 100644
--- a/.github/workflows/ResInsightWithCache.yml
+++ b/.github/workflows/ResInsightWithCache.yml
@@ -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
diff --git a/ApplicationExeCode/Resources/ResInsight.qrc b/ApplicationExeCode/Resources/ResInsight.qrc
index 32ff262ffc..1a1b8b97d9 100644
--- a/ApplicationExeCode/Resources/ResInsight.qrc
+++ b/ApplicationExeCode/Resources/ResInsight.qrc
@@ -277,14 +277,15 @@
SeismicDelta16x16.png
SeismicView16x16.png
SeismicView24x24.png
- SeismicViews24x24.png
- SeismicData24x24.png
- SeismicSection16x16.png
- Fullscreen.png
+ SeismicViews24x24.png
+ SeismicData24x24.png
+ SeismicSection16x16.png
+ Fullscreen.png
plot-template-standard.svg
plot-template-ensemble.svg
decline-curve.svg
regression-curve.svg
+ padlock.svg
fs_CellFace.glsl
diff --git a/ApplicationExeCode/Resources/padlock.svg b/ApplicationExeCode/Resources/padlock.svg
new file mode 100644
index 0000000000..5009f6cebf
--- /dev/null
+++ b/ApplicationExeCode/Resources/padlock.svg
@@ -0,0 +1,11 @@
+
+
+
\ No newline at end of file
diff --git a/ApplicationExeCode/RiaMain.cpp b/ApplicationExeCode/RiaMain.cpp
index 700114d1cc..b8d35b48c2 100644
--- a/ApplicationExeCode/RiaMain.cpp
+++ b/ApplicationExeCode/RiaMain.cpp
@@ -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 );
diff --git a/ApplicationLibCode/Adm/RiaVersionInfo.h.cmake b/ApplicationLibCode/Adm/RiaVersionInfo.h.cmake
index 5cdacb8332..8e2910f76a 100644
--- a/ApplicationLibCode/Adm/RiaVersionInfo.h.cmake
+++ b/ApplicationLibCode/Adm/RiaVersionInfo.h.cmake
@@ -34,3 +34,5 @@
#define RESINSIGHT_OCTAVE_VERSION "@OCTAVE_VERSION_STRING@"
#define RESINSIGHT_PYTHON_VERSION "@Python3_VERSION@"
+
+#define RESINSIGHT_GIT_HASH "@RESINSIGHT_GIT_HASH@"
\ No newline at end of file
diff --git a/ApplicationLibCode/Application/RiaApplication.cpp b/ApplicationLibCode/Application/RiaApplication.cpp
index 478566d908..7bef9598e1 100644
--- a/ApplicationLibCode/Application/RiaApplication.cpp
+++ b/ApplicationLibCode/Application/RiaApplication.cpp
@@ -40,6 +40,8 @@
#include "RicfCommandObject.h"
#include "PlotTemplates/RimPlotTemplateFolderItem.h"
+#include "Polygons/RimPolygonCollection.h"
+
#include "Rim2dIntersectionViewCollection.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationInViewCollection.h"
@@ -544,6 +546,8 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct
{
seismicData->ensureFileReaderIsInitialized();
}
+
+ oilField->polygonCollection()->loadData();
}
{
@@ -658,7 +662,10 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct
}
}
- setActiveReservoirView( riv );
+ if ( riv->showWindow() )
+ {
+ setActiveReservoirView( riv );
+ }
RimGridView* rigv = dynamic_cast( riv );
if ( rigv ) rigv->cellFilterCollection()->updateIconState();
diff --git a/ApplicationLibCode/Application/RiaConsoleApplication.cpp b/ApplicationLibCode/Application/RiaConsoleApplication.cpp
index 1e3c85c51e..97a4b8b88b 100644
--- a/ApplicationLibCode/Application/RiaConsoleApplication.cpp
+++ b/ApplicationLibCode/Application/RiaConsoleApplication.cpp
@@ -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 );
diff --git a/ApplicationLibCode/Application/RiaDefines.h b/ApplicationLibCode/Application/RiaDefines.h
index 27afa6fd2b..4eaee4a384 100644
--- a/ApplicationLibCode/Application/RiaDefines.h
+++ b/ApplicationLibCode/Application/RiaDefines.h
@@ -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 )
diff --git a/ApplicationLibCode/Application/RiaGuiApplication.cpp b/ApplicationLibCode/Application/RiaGuiApplication.cpp
index 1a51c974df..461e99ec54 100644
--- a/ApplicationLibCode/Application/RiaGuiApplication.cpp
+++ b/ApplicationLibCode/Application/RiaGuiApplication.cpp
@@ -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" ) )
diff --git a/ApplicationLibCode/Application/RiaMemoryCleanup.cpp b/ApplicationLibCode/Application/RiaMemoryCleanup.cpp
index ee5d5bf64a..d72e85f2a0 100644
--- a/ApplicationLibCode/Application/RiaMemoryCleanup.cpp
+++ b/ApplicationLibCode/Application/RiaMemoryCleanup.cpp
@@ -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 );
}
//--------------------------------------------------------------------------------------------------
diff --git a/ApplicationLibCode/Application/RiaPreferencesSummary.cpp b/ApplicationLibCode/Application/RiaPreferencesSummary.cpp
index 9983ba5364..ae0b493ff3 100644
--- a/ApplicationLibCode/Application/RiaPreferencesSummary.cpp
+++ b/ApplicationLibCode/Application/RiaPreferencesSummary.cpp
@@ -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 );
diff --git a/ApplicationLibCode/Application/RiaResultNames.cpp b/ApplicationLibCode/Application/RiaResultNames.cpp
index 9752c9ff31..cac4338ada 100644
--- a/ApplicationLibCode/Application/RiaResultNames.cpp
+++ b/ApplicationLibCode/Application/RiaResultNames.cpp
@@ -595,5 +595,9 @@ std::vector RiaResultNames::wbsDerivedResultNames()
wbsSHMkMaxResult(),
wbsFGMkExpResult(),
wbsFGMkMinResult(),
+ wbsPPMinResult(),
+ wbsPPMaxResult(),
+ wbsPPExpResult(),
+ wbsPPInitialResult(),
};
}
diff --git a/ApplicationLibCode/CMakeLists.txt b/ApplicationLibCode/CMakeLists.txt
index 82e15fe623..e88e49300d 100644
--- a/ApplicationLibCode/CMakeLists.txt
+++ b/ApplicationLibCode/CMakeLists.txt
@@ -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
diff --git a/ApplicationLibCode/Commands/CMakeLists.txt b/ApplicationLibCode/Commands/CMakeLists.txt
index 931eb11e82..740ee78f12 100644
--- a/ApplicationLibCode/Commands/CMakeLists.txt
+++ b/ApplicationLibCode/Commands/CMakeLists.txt
@@ -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
diff --git a/ApplicationLibCode/Commands/CellFilterCommands/RicNewPolygonFilter3dviewFeature.cpp b/ApplicationLibCode/Commands/CellFilterCommands/RicNewPolygonFilter3dviewFeature.cpp
index 52db3a8110..def2a95673 100644
--- a/ApplicationLibCode/Commands/CellFilterCommands/RicNewPolygonFilter3dviewFeature.cpp
+++ b/ApplicationLibCode/Commands/CellFilterCommands/RicNewPolygonFilter3dviewFeature.cpp
@@ -18,6 +18,8 @@
#include "RicNewPolygonFilter3dviewFeature.h"
+#include "Polygons/RimPolygonInView.h"
+
#include "RiaApplication.h"
#include "RimCase.h"
#include "RimCellFilterCollection.h"
@@ -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 );
diff --git a/ApplicationLibCode/Commands/CellFilterCommands/RicNewPolygonFilterFeature.cpp b/ApplicationLibCode/Commands/CellFilterCommands/RicNewPolygonFilterFeature.cpp
index 4e8ba926b2..8ffa493ef8 100644
--- a/ApplicationLibCode/Commands/CellFilterCommands/RicNewPolygonFilterFeature.cpp
+++ b/ApplicationLibCode/Commands/CellFilterCommands/RicNewPolygonFilterFeature.cpp
@@ -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"
@@ -35,16 +42,31 @@ CAF_CMD_SOURCE_INIT( RicNewPolygonFilterFeature, "RicNewPolygonFilterFeature" );
//--------------------------------------------------------------------------------------------------
void RicNewPolygonFilterFeature::onActionTriggered( bool isChecked )
{
- // Find the selected Cell Filter Collection
- std::vector colls = caf::selectedObjectsByTypeStrict();
- if ( colls.empty() ) return;
- RimCellFilterCollection* filtColl = colls[0];
+ auto cellFilterCollection = caf::SelectionManager::instance()->selectedItemOfType();
- // and the case to use
- RimCase* sourceCase = filtColl->firstAncestorOrThisOfTypeAsserted();
+ if ( !cellFilterCollection )
+ {
+ RimGridView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
+ if ( activeView )
+ {
+ cellFilterCollection = activeView->cellFilterCollection();
+ }
+ }
- RimPolygonFilter* lastCreatedOrUpdated = filtColl->addNewPolygonFilter( sourceCase );
- if ( lastCreatedOrUpdated )
+ if ( !cellFilterCollection ) return;
+
+ auto polygon = caf::SelectionManager::instance()->selectedItemOfType();
+ if ( !polygon )
+ {
+ if ( auto polygonInView = caf::SelectionManager::instance()->selectedItemOfType() )
+ {
+ polygon = polygonInView->polygon();
+ }
+ }
+
+ auto sourceCase = cellFilterCollection->firstAncestorOrThisOfTypeAsserted();
+
+ if ( auto lastCreatedOrUpdated = cellFilterCollection->addNewPolygonFilter( sourceCase, polygon ) )
{
Riu3DMainWindowTools::selectAsCurrentItem( lastCreatedOrUpdated );
}
diff --git a/ApplicationLibCode/Commands/CrossSectionCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CrossSectionCommands/CMakeLists_files.cmake
index d1a18ed21d..bb0d00bef9 100644
--- a/ApplicationLibCode/Commands/CrossSectionCommands/CMakeLists_files.cmake
+++ b/ApplicationLibCode/Commands/CrossSectionCommands/CMakeLists_files.cmake
@@ -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
@@ -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})
diff --git a/ApplicationLibCode/Commands/CrossSectionCommands/RicNewPolygonIntersectionFeature.cpp b/ApplicationLibCode/Commands/CrossSectionCommands/RicNewPolygonIntersectionFeature.cpp
new file mode 100644
index 0000000000..3ee2f4e7a3
--- /dev/null
+++ b/ApplicationLibCode/Commands/CrossSectionCommands/RicNewPolygonIntersectionFeature.cpp
@@ -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
+// 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
+
+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();
+ if ( !polygon )
+ {
+ if ( auto polygonInView = caf::SelectionManager::instance()->selectedItemOfType() )
+ {
+ 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" );
+}
diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicAppendPointsToPolygonFilterFeature.h b/ApplicationLibCode/Commands/CrossSectionCommands/RicNewPolygonIntersectionFeature.h
similarity index 88%
rename from ApplicationLibCode/Commands/WellPathCommands/RicAppendPointsToPolygonFilterFeature.h
rename to ApplicationLibCode/Commands/CrossSectionCommands/RicNewPolygonIntersectionFeature.h
index 35cee0a6c5..f06741ab06 100644
--- a/ApplicationLibCode/Commands/WellPathCommands/RicAppendPointsToPolygonFilterFeature.h
+++ b/ApplicationLibCode/Commands/CrossSectionCommands/RicNewPolygonIntersectionFeature.h
@@ -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
@@ -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;
};
diff --git a/ApplicationLibCode/Commands/PolygonCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/PolygonCommands/CMakeLists_files.cmake
new file mode 100644
index 0000000000..8392652004
--- /dev/null
+++ b/ApplicationLibCode/Commands/PolygonCommands/CMakeLists_files.cmake
@@ -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
+)
diff --git a/ApplicationLibCode/Commands/PolygonCommands/RicNewPolygonFeature.cpp b/ApplicationLibCode/Commands/PolygonCommands/RicNewPolygonFeature.cpp
new file mode 100644
index 0000000000..7ff2d4aded
--- /dev/null
+++ b/ApplicationLibCode/Commands/PolygonCommands/RicNewPolygonFeature.cpp
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+// for more details.
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+#include "RicNewPolygonFeature.h"
+
+#include "Polygons/RimPolygon.h"
+#include "Polygons/RimPolygonCollection.h"
+#include "RimOilField.h"
+#include "RimProject.h"
+
+#include "RiuPlotMainWindowTools.h"
+
+#include
+
+CAF_CMD_SOURCE_INIT( RicNewPolygonFeature, "RicNewPolygonFeature" );
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RicNewPolygonFeature::onActionTriggered( bool isChecked )
+{
+ auto proj = RimProject::current();
+ auto polygonCollection = proj->activeOilField()->polygonCollection();
+
+ auto newPolygon = polygonCollection->appendUserDefinedPolygon();
+ polygonCollection->uiCapability()->updateAllRequiredEditors();
+
+ RiuPlotMainWindowTools::setExpanded( newPolygon );
+ RiuPlotMainWindowTools::selectAsCurrentItem( newPolygon );
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RicNewPolygonFeature::setupActionLook( QAction* actionToSetup )
+{
+ actionToSetup->setText( "New Polygon" );
+ actionToSetup->setIcon( QIcon( ":/PolylinesFromFile16x16.png" ) );
+}
diff --git a/ApplicationLibCode/Commands/PolygonCommands/RicNewPolygonFeature.h b/ApplicationLibCode/Commands/PolygonCommands/RicNewPolygonFeature.h
new file mode 100644
index 0000000000..ebb92b9b2c
--- /dev/null
+++ b/ApplicationLibCode/Commands/PolygonCommands/RicNewPolygonFeature.h
@@ -0,0 +1,33 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+// for more details.
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+#pragma once
+
+#include "cafCmdFeature.h"
+
+//==================================================================================================
+///
+//==================================================================================================
+class RicNewPolygonFeature : public caf::CmdFeature
+{
+ CAF_CMD_HEADER_INIT;
+
+protected:
+ void onActionTriggered( bool isChecked ) override;
+ void setupActionLook( QAction* actionToSetup ) override;
+};
diff --git a/ApplicationLibCode/Commands/PolygonCommands/RicNewPolygonFileFeature.cpp b/ApplicationLibCode/Commands/PolygonCommands/RicNewPolygonFileFeature.cpp
new file mode 100644
index 0000000000..3c061583d2
--- /dev/null
+++ b/ApplicationLibCode/Commands/PolygonCommands/RicNewPolygonFileFeature.cpp
@@ -0,0 +1,57 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+// for more details.
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+#include "RicNewPolygonFileFeature.h"
+
+#include "Polygons/RimPolygon.h"
+#include "Polygons/RimPolygonCollection.h"
+#include "Polygons/RimPolygonFile.h"
+#include "RimOilField.h"
+#include "RimProject.h"
+
+#include "RiuPlotMainWindowTools.h"
+
+#include
+
+CAF_CMD_SOURCE_INIT( RicNewPolygonFileFeature, "RicNewPolygonFileFeature" );
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RicNewPolygonFileFeature::onActionTriggered( bool isChecked )
+{
+ auto proj = RimProject::current();
+ auto polygonCollection = proj->activeOilField()->polygonCollection();
+
+ auto newPolygonFile = new RimPolygonFile();
+ newPolygonFile->setName( "File Polygon " + QString::number( polygonCollection->polygonFiles().size() + 1 ) );
+ polygonCollection->addPolygonFile( newPolygonFile );
+ polygonCollection->uiCapability()->updateAllRequiredEditors();
+
+ RiuPlotMainWindowTools::setExpanded( newPolygonFile );
+ RiuPlotMainWindowTools::selectAsCurrentItem( newPolygonFile );
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RicNewPolygonFileFeature::setupActionLook( QAction* actionToSetup )
+{
+ actionToSetup->setText( "New File Polygon" );
+ actionToSetup->setIcon( QIcon( ":/PolylinesFromFile16x16.png" ) );
+}
diff --git a/ApplicationLibCode/Commands/PolygonCommands/RicNewPolygonFileFeature.h b/ApplicationLibCode/Commands/PolygonCommands/RicNewPolygonFileFeature.h
new file mode 100644
index 0000000000..8c3ff090ef
--- /dev/null
+++ b/ApplicationLibCode/Commands/PolygonCommands/RicNewPolygonFileFeature.h
@@ -0,0 +1,33 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+// for more details.
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+#pragma once
+
+#include "cafCmdFeature.h"
+
+//==================================================================================================
+///
+//==================================================================================================
+class RicNewPolygonFileFeature : public caf::CmdFeature
+{
+ CAF_CMD_HEADER_INIT;
+
+protected:
+ void onActionTriggered( bool isChecked ) override;
+ void setupActionLook( QAction* actionToSetup ) override;
+};
diff --git a/ApplicationLibCode/Commands/RicUserDefinedCalculatorUi.cpp b/ApplicationLibCode/Commands/RicUserDefinedCalculatorUi.cpp
index 771f36f912..af596fcd5c 100644
--- a/ApplicationLibCode/Commands/RicUserDefinedCalculatorUi.cpp
+++ b/ApplicationLibCode/Commands/RicUserDefinedCalculatorUi.cpp
@@ -91,7 +91,9 @@ bool RicUserDefinedCalculatorUi::parseExpression() const
notifyCalculatedNameChanged( m_currentCalculation()->id(), currentCurveName );
}
- m_currentCalculation()->updateDependentObjects();
+ // Always rebuild the case meta data after parsing the expression. A change in name or change in result type will require rebuild of
+ // case metadata. The rebuild is considered lightweight and should not be a performance issue.
+ calculationCollection()->rebuildCaseMetaData();
}
return true;
@@ -198,8 +200,7 @@ void RicUserDefinedCalculatorUi::assignPushButtonEditor( caf::PdmFieldHandle* fi
CAF_ASSERT( fieldHandle );
CAF_ASSERT( fieldHandle->uiCapability() );
- fieldHandle->uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
- fieldHandle->uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
+ caf::PdmUiPushButtonEditor::configureEditorLabelHidden( fieldHandle );
}
//--------------------------------------------------------------------------------------------------
@@ -221,17 +222,7 @@ bool RicUserDefinedCalculatorUi::calculate() const
{
if ( m_currentCalculation() )
{
- QString previousCurveName = m_currentCalculation->description();
- if ( !m_currentCalculation()->parseExpression() )
- {
- return false;
- }
-
- QString currentCurveName = m_currentCalculation->description();
- if ( previousCurveName != currentCurveName )
- {
- notifyCalculatedNameChanged( m_currentCalculation()->id(), currentCurveName );
- }
+ if ( !parseExpression() ) return false;
if ( !m_currentCalculation()->preCalculate() )
{
diff --git a/ApplicationLibCode/Commands/SeismicCommands/RicSeismicSectionFromIntersectionFeature.cpp b/ApplicationLibCode/Commands/SeismicCommands/RicSeismicSectionFromIntersectionFeature.cpp
index 445ead3336..180db89511 100644
--- a/ApplicationLibCode/Commands/SeismicCommands/RicSeismicSectionFromIntersectionFeature.cpp
+++ b/ApplicationLibCode/Commands/SeismicCommands/RicSeismicSectionFromIntersectionFeature.cpp
@@ -47,6 +47,7 @@ bool RicSeismicSectionFromIntersectionFeature::isCommandEnabled() const
if ( intersection != nullptr )
{
return ( ( intersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_POLYLINE ) ||
+ ( intersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_POLYGON ) ||
( intersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_WELL_PATH ) );
}
@@ -70,7 +71,8 @@ void RicSeismicSectionFromIntersectionFeature::onActionTriggered( bool isChecked
RimSeismicSection* newSection = seisColl->addNewSection();
if ( !newSection ) return;
- if ( intersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_POLYLINE )
+ if ( ( intersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_POLYLINE ) ||
+ ( intersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_POLYGON ) )
{
newSection->setSectionType( RiaDefines::SeismicSectionType::SS_POLYLINE );
newSection->setUserDescription( intersection->name() );
diff --git a/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp b/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp
index e8b7d53233..b7f465dfc0 100644
--- a/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp
+++ b/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp
@@ -56,6 +56,7 @@
#include "cafProgressInfo.h"
#include "cafSelectionManager.h"
#include "cvfAssert.h"
+#include "cvfColor3.h"
#include "cvfMath.h"
#include
@@ -63,6 +64,7 @@
#include
#include
+#include
CAF_CMD_SOURCE_INIT( RicNewWellBoreStabilityPlotFeature, "RicNewWellBoreStabilityPlotFeature" );
@@ -262,7 +264,7 @@ void RicNewWellBoreStabilityPlotFeature::createParametersTrack( RimWellBoreStabi
paramCurvesTrack->setFormationCase( geoMechCase );
paramCurvesTrack->setShowRegionLabels( true );
paramCurvesTrack->setShowWindow( false );
- std::set parameters = RigWbsParameter::allParameters();
+ std::set parameters = parametersForTrack();
caf::ColorTable colors = RiaColorTables::contrastCategoryPaletteColors();
std::vector lineStyles = { RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID,
@@ -321,6 +323,15 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
std::vector lineStyles( resultNames.size(), RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID );
lineStyles.back() = RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH;
+ std::set defaultOffResults = {
+ RiaResultNames::wbsSHMkResult(),
+ RiaResultNames::wbsSHMkExpResult(),
+ RiaResultNames::wbsSHMkMinResult(),
+ RiaResultNames::wbsSHMkMaxResult(),
+ RiaResultNames::wbsFGMkExpResult(),
+ RiaResultNames::wbsFGMkMinResult(),
+ };
+
for ( size_t i = 0; i < resultNames.size(); ++i )
{
const QString& resultName = resultNames[i];
@@ -330,13 +341,14 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
curve->setGeoMechResultAddress( resAddr );
curve->setCurrentTimeStep( timeStep );
curve->setAutoNameComponents( false, true, false, false, false );
- curve->setColor( colors[i % colors.size()] );
- curve->setLineStyle( lineStyles[i] );
+ auto [color, lineStyle] = getColorAndLineStyle( resultName, i, colors );
+ curve->setColor( color );
+ curve->setLineStyle( lineStyle );
curve->setLineThickness( 2 );
curve->loadDataAndUpdate( false );
curve->setSmoothCurve( true );
curve->setSmoothingThreshold( 0.002 );
- if ( resultNames[i] == RiaResultNames::wbsSHMkResult() )
+ if ( defaultOffResults.count( resultNames[i] ) )
{
curve->setCheckState( false );
}
@@ -361,6 +373,34 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
stabilityCurvesTrack->setAutoScalePropertyValuesEnabled( true );
}
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+std::pair
+ RicNewWellBoreStabilityPlotFeature::getColorAndLineStyle( const QString& resultName, size_t i, const std::vector& colors )
+{
+ if ( resultName == RiaResultNames::wbsSHMkResult() ) return { cvf::Color3f::GREEN, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID };
+ if ( resultName == RiaResultNames::wbsSHMkExpResult() )
+ return { cvf::Color3f::GREEN, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH };
+ if ( resultName == RiaResultNames::wbsSHMkMinResult() )
+ return { cvf::Color3f::GREEN, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DOT };
+ if ( resultName == RiaResultNames::wbsSHMkMaxResult() )
+ return { cvf::Color3f::GREEN, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH_DOT };
+
+ if ( resultName == RiaResultNames::wbsFGMkExpResult() )
+ return { cvf::Color3f::BLUE, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH };
+ if ( resultName == RiaResultNames::wbsFGMkMinResult() ) return { cvf::Color3f::BLUE, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DOT };
+
+ if ( resultName == RiaResultNames::wbsPPInitialResult() )
+ return { cvf::Color3f::RED, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID };
+ if ( resultName == RiaResultNames::wbsPPExpResult() ) return { cvf::Color3f::RED, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH };
+ if ( resultName == RiaResultNames::wbsPPMinResult() ) return { cvf::Color3f::RED, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DOT };
+ if ( resultName == RiaResultNames::wbsPPMaxResult() )
+ return { cvf::Color3f::RED, RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_DASH_DOT };
+
+ return { colors[i % colors.size()], RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID };
+}
+
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -408,3 +448,22 @@ void RicNewWellBoreStabilityPlotFeature::createAnglesTrack( RimWellBoreStability
wellPathAnglesTrack->setAnnotationDisplay( RiaDefines::LIGHT_LINES );
wellPathAnglesTrack->setShowRegionLabels( false );
}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+std::set RicNewWellBoreStabilityPlotFeature::parametersForTrack()
+{
+ return { RigWbsParameter::PP_Reservoir(),
+ RigWbsParameter::PP_NonReservoir(),
+ RigWbsParameter::poissonRatio(),
+ RigWbsParameter::UCS(),
+ RigWbsParameter::OBG(),
+ RigWbsParameter::OBG0(),
+ RigWbsParameter::SH(),
+ RigWbsParameter::DF(),
+ RigWbsParameter::K0_FG(),
+ RigWbsParameter::K0_SH(),
+ RigWbsParameter::FG_Shale(),
+ RigWbsParameter::waterDensity() };
+}
diff --git a/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.h b/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.h
index e9fd749ae0..9fc6dd4162 100644
--- a/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.h
+++ b/ApplicationLibCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.h
@@ -20,6 +20,14 @@
#include "cafCmdFeature.h"
+#include "RigWbsParameter.h"
+
+#include "RimPlotCurveAppearance.h"
+
+#include "cvfColor3.h"
+
+#include
+
class RimGeoMechCase;
class RimGeoMechView;
class RimWbsParameters;
@@ -48,4 +56,8 @@ private:
static void createParametersTrack( RimWellBoreStabilityPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase, int timeStep );
static void createStabilityCurvesTrack( RimWellBoreStabilityPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase, int timeStep );
static void createAnglesTrack( RimWellBoreStabilityPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase, int timeStep );
+
+ static std::set parametersForTrack();
+ static std::pair
+ getColorAndLineStyle( const QString& resultName, size_t i, const std::vector& colors );
};
diff --git a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake
index 57cb2f675e..e8720d49b1 100644
--- a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake
+++ b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake
@@ -30,7 +30,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulatorPartMgr.h
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolyline3dEditor.h
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolylineTarget3dEditor.h
- ${CMAKE_CURRENT_LIST_DIR}/RicAppendPointsToPolygonFilterFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicDuplicateWellPathFeature.h
)
@@ -66,7 +65,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulatorPartMgr.cpp
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolyline3dEditor.cpp
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolylineTarget3dEditor.cpp
- ${CMAKE_CURRENT_LIST_DIR}/RicAppendPointsToPolygonFilterFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicDuplicateWellPathFeature.cpp
)
diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPolyline3dEditor.cpp b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPolyline3dEditor.cpp
index f67db7f3ff..2c0c094dd0 100644
--- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPolyline3dEditor.cpp
+++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPolyline3dEditor.cpp
@@ -62,7 +62,7 @@ void RicPolyline3dEditor::configureAndUpdateUi( const QString& uiConfigName )
}
m_targetEditors.clear();
- if ( !pickerInterface ) return;
+ if ( !pickerInterface || !pickerInterface->pickEventHandler() ) return;
if ( pickerInterface->pickingEnabled() )
{
diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPolylineTarget3dEditor.cpp b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPolylineTarget3dEditor.cpp
index 4c1860e278..6bf4a98b48 100644
--- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPolylineTarget3dEditor.cpp
+++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPolylineTarget3dEditor.cpp
@@ -21,10 +21,8 @@
#include "RicPointTangentManipulator.h"
#include "Rim3dView.h"
-#include "RimAnnotationCollectionBase.h"
-#include "RimCase.h"
+#include "RimPolylinePickerInterface.h"
#include "RimPolylineTarget.h"
-#include "RimUserDefinedPolylinesAnnotation.h"
#include "RiuViewer.h"
@@ -57,7 +55,7 @@ RicPolylineTarget3dEditor::~RicPolylineTarget3dEditor()
ownerRiuViewer->removeStaticModel( m_cvfModel.p() );
}
- RimPolylineTarget* oldTarget = dynamic_cast( pdmObject() );
+ auto* oldTarget = dynamic_cast( pdmObject() );
if ( oldTarget )
{
oldTarget->targetPointUiCapability()->removeFieldEditor( this );
@@ -71,11 +69,11 @@ RicPolylineTarget3dEditor::~RicPolylineTarget3dEditor()
//--------------------------------------------------------------------------------------------------
void RicPolylineTarget3dEditor::configureAndUpdateUi( const QString& uiConfigName )
{
- RimPolylineTarget* target = dynamic_cast( pdmObject() );
- RiuViewer* ownerRiuViewer = dynamic_cast( ownerViewer() );
- Rim3dView* view = mainOrComparisonView();
+ auto* target = dynamic_cast( pdmObject() );
+ RiuViewer* ownerRiuViewer = dynamic_cast( ownerViewer() );
+ Rim3dView* view = mainOrComparisonView();
- if ( !target || !target->isEnabled() || !view )
+ if ( !target || !view )
{
if ( m_cvfModel.notNull() ) m_cvfModel->removeAllParts();
@@ -97,11 +95,17 @@ void RicPolylineTarget3dEditor::configureAndUpdateUi( const QString& uiConfigNam
ownerRiuViewer->addStaticModelOnce( m_cvfModel.p(), isInComparisonView() );
}
- cvf::ref dispXf = view->displayCoordTransform();
- double handleSize = 0.7 * view->characteristicCellSize();
+ cvf::ref dispXf = view->displayCoordTransform();
+
+ double scalingFactor = 0.7;
+ if ( auto pickerInterface = target->firstAncestorOrThisOfType() )
+ {
+ scalingFactor *= pickerInterface->scalingFactorForTarget();
+ }
+
+ const double handleSize = scalingFactor * view->characteristicCellSize();
m_manipulator->setOrigin( dispXf->transformToDisplayCoord( target->targetPointXYZ() ) );
- // m_manipulator->setTangent(target->tangent());
m_manipulator->setHandleSize( handleSize );
m_cvfModel->removeAllParts();
m_manipulator->appendPartsToModel( m_cvfModel.p() );
@@ -114,7 +118,7 @@ void RicPolylineTarget3dEditor::configureAndUpdateUi( const QString& uiConfigNam
//--------------------------------------------------------------------------------------------------
void RicPolylineTarget3dEditor::cleanupBeforeSettingPdmObject()
{
- RimPolylineTarget* oldTarget = dynamic_cast( pdmObject() );
+ auto* oldTarget = dynamic_cast( pdmObject() );
if ( oldTarget )
{
oldTarget->targetPointUiCapability()->removeFieldEditor( this );
@@ -126,8 +130,8 @@ void RicPolylineTarget3dEditor::cleanupBeforeSettingPdmObject()
//--------------------------------------------------------------------------------------------------
void RicPolylineTarget3dEditor::slotUpdated( const cvf::Vec3d& origin, const cvf::Vec3d& tangent )
{
- RimPolylineTarget* target = dynamic_cast( pdmObject() );
- Rim3dView* view = mainOrComparisonView();
+ auto* target = dynamic_cast( pdmObject() );
+ Rim3dView* view = mainOrComparisonView();
if ( !target || !view )
{
@@ -140,9 +144,7 @@ void RicPolylineTarget3dEditor::slotUpdated( const cvf::Vec3d& origin, const cvf
domainOrigin.z() = -domainOrigin.z();
QVariant originVariant = caf::PdmValueFieldSpecialization::convert( domainOrigin );
- target->enableFullUpdate( false );
caf::PdmUiCommandSystemProxy::instance()->setUiValueToField( target->targetPointUiCapability(), originVariant );
- target->enableFullUpdate( true );
}
//--------------------------------------------------------------------------------------------------
@@ -150,7 +152,7 @@ void RicPolylineTarget3dEditor::slotUpdated( const cvf::Vec3d& origin, const cvf
//--------------------------------------------------------------------------------------------------
void RicPolylineTarget3dEditor::slotSelectedIn3D()
{
- RimPolylineTarget* target = dynamic_cast( pdmObject() );
+ auto* target = dynamic_cast( pdmObject() );
if ( !target )
{
return;
@@ -164,7 +166,7 @@ void RicPolylineTarget3dEditor::slotSelectedIn3D()
//--------------------------------------------------------------------------------------------------
void RicPolylineTarget3dEditor::slotDragFinished()
{
- RimPolylineTarget* target = dynamic_cast( pdmObject() );
+ auto* target = dynamic_cast( pdmObject() );
if ( target )
{
target->triggerVisualizationUpdate();
diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPolylineTarget3dEditor.h b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPolylineTarget3dEditor.h
index 918d7a631e..3fe127d12d 100644
--- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPolylineTarget3dEditor.h
+++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPolylineTarget3dEditor.h
@@ -25,13 +25,14 @@ class RicPointTangentManipulator;
#include "cvfObject.h"
#include "cvfVector3.h"
+#include
+
namespace cvf
{
class ModelBasicList;
}
class QString;
-#include
class RicPolylineTarget3dEditor : public Ric3dObjectEditorHandle
{
diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicAppendPointsToPolygonFilterFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicAppendPointsToPolygonFilterFeature.cpp
deleted file mode 100644
index 05908fcacd..0000000000
--- a/ApplicationLibCode/Commands/WellPathCommands/RicAppendPointsToPolygonFilterFeature.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////////
-//
-// 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 "RicAppendPointsToPolygonFilterFeature.h"
-
-#include "RiaTextStringTools.h"
-
-#include "RimPolygonFilter.h"
-#include "RimPolylineTarget.h"
-
-#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h"
-
-#include "cafSelectionManager.h"
-#include "cafSelectionManagerTools.h"
-
-#include
-#include
-
-CAF_CMD_SOURCE_INIT( RicAppendPointsToPolygonFilterFeature, "RicAppendPointsToPolygonFilterFeature" );
-
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-bool RicAppendPointsToPolygonFilterFeature::isCommandEnabled() const
-{
- auto obj = caf::firstAncestorOfTypeFromSelectedObject();
- return obj != nullptr;
-}
-
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-void RicAppendPointsToPolygonFilterFeature::onActionTriggered( bool isChecked )
-{
- auto polygonFilter = caf::firstAncestorOfTypeFromSelectedObject();
- if ( !polygonFilter ) return;
-
- QStringList listOfThreeDoubles;
-
- QClipboard* clipboard = QApplication::clipboard();
- if ( clipboard )
- {
- QString content = clipboard->text();
- listOfThreeDoubles = RiaTextStringTools::splitSkipEmptyParts( content, "\n" );
- }
-
- std::vector points;
- caf::PdmValueFieldSpecialization>::setFromVariant( listOfThreeDoubles, points );
-
- for ( const auto& p : points )
- {
- auto newTarget = new RimPolylineTarget;
- newTarget->setAsPointTargetXYD( p );
- polygonFilter->insertTarget( nullptr, newTarget );
- }
-
- polygonFilter->updateEditorsAndVisualization();
-}
-
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-void RicAppendPointsToPolygonFilterFeature::setupActionLook( QAction* actionToSetup )
-{
- actionToSetup->setText( "Append Points from Clipboard" );
-
- RicPasteFeatureImpl::setIconAndShortcuts( actionToSetup );
-}
diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.cpp
index 6925f3e03e..69b73bd1cd 100644
--- a/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.cpp
+++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.cpp
@@ -18,9 +18,6 @@
#include "RicCreateWellTargetsPickEventHandler.h"
-#include "RiaGuiApplication.h"
-#include "RiaOffshoreSphericalCoords.h"
-
#include "RigFemPart.h"
#include "RigFemPartCollection.h"
#include "RigFemPartGrid.h"
@@ -30,6 +27,7 @@
#include "RigWellPathGeometryTools.h"
#include "Rim3dView.h"
+#include "RimCase.h"
#include "RimEclipseView.h"
#include "RimGeoMechView.h"
#include "RimModeledWellPath.h"
@@ -47,10 +45,6 @@
#include "cafDisplayCoordTransform.h"
#include "cafSelectionManager.h"
-#include "cvfStructGridGeometryGenerator.h"
-
-#include
-
#include
//--------------------------------------------------------------------------------------------------
@@ -130,7 +124,14 @@ bool RicCreateWellTargetsPickEventHandler::handle3dPickEvent( const Ric3dPickEve
doSetAzimuthAndInclination = false;
cvf::Vec3d domainRayOrigin = rimView->displayCoordTransform()->transformToDomainCoord( firstPickItem.globalRayOrigin() );
- cvf::Vec3d domainRayEnd = targetPointInDomain + ( targetPointInDomain - domainRayOrigin );
+
+ auto rayVector = ( targetPointInDomain - domainRayOrigin );
+ const double minimumRayLength = rimView->ownerCase()->characteristicCellSize() * 2;
+ if ( rayVector.length() < minimumRayLength )
+ {
+ rayVector = rayVector.getNormalized() * minimumRayLength;
+ }
+ cvf::Vec3d domainRayEnd = targetPointInDomain + rayVector;
cvf::Vec3d hexElementIntersection = findHexElementIntersection( rimView, firstPickItem, domainRayOrigin, domainRayEnd );
CVF_TIGHT_ASSERT( !hexElementIntersection.isUndefined() );
@@ -255,22 +256,27 @@ cvf::Vec3d RicCreateWellTargetsPickEventHandler::findHexElementIntersection( gsl
{
std::vector intersectionInfo;
RigHexIntersectionTools::lineHexCellIntersection( domainRayOrigin, domainRayEnd, cornerVertices.data(), cellIndex, &intersectionInfo );
- if ( !intersectionInfo.empty() )
+
+ if ( intersectionInfo.empty() ) return cvf::Vec3d::UNDEFINED;
+
+ if ( intersectionInfo.size() == 1 )
{
- // Sort intersection on distance to ray origin
- CVF_ASSERT( intersectionInfo.size() > 1 );
- std::sort( intersectionInfo.begin(),
- intersectionInfo.end(),
- [&domainRayOrigin]( const HexIntersectionInfo& lhs, const HexIntersectionInfo& rhs ) {
- return ( lhs.m_intersectionPoint - domainRayOrigin ).lengthSquared() <
- ( rhs.m_intersectionPoint - domainRayOrigin ).lengthSquared();
- } );
- const double eps = 1.0e-2;
- cvf::Vec3d intersectionRay = intersectionInfo.back().m_intersectionPoint - intersectionInfo.front().m_intersectionPoint;
- cvf::Vec3d newPoint = intersectionInfo.front().m_intersectionPoint + intersectionRay * eps;
- CVF_ASSERT( RigHexIntersectionTools::isPointInCell( newPoint, cornerVertices.data() ) );
- return newPoint;
+ return intersectionInfo.front().m_intersectionPoint;
}
+
+ // Sort intersection on distance to ray origin
+ std::sort( intersectionInfo.begin(),
+ intersectionInfo.end(),
+ [&domainRayOrigin]( const HexIntersectionInfo& lhs, const HexIntersectionInfo& rhs ) {
+ return ( lhs.m_intersectionPoint - domainRayOrigin ).lengthSquared() <
+ ( rhs.m_intersectionPoint - domainRayOrigin ).lengthSquared();
+ } );
+ const double eps = 1.0e-2;
+ cvf::Vec3d intersectionRay = intersectionInfo.back().m_intersectionPoint - intersectionInfo.front().m_intersectionPoint;
+ cvf::Vec3d newPoint = intersectionInfo.front().m_intersectionPoint + intersectionRay * eps;
+ CVF_ASSERT( RigHexIntersectionTools::isPointInCell( newPoint, cornerVertices.data() ) );
+ return newPoint;
}
+
return cvf::Vec3d::UNDEFINED;
}
diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicIntersectionPickEventHandler.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicIntersectionPickEventHandler.cpp
index bcdb1233c1..b699df4383 100644
--- a/ApplicationLibCode/Commands/WellPathCommands/RicIntersectionPickEventHandler.cpp
+++ b/ApplicationLibCode/Commands/WellPathCommands/RicIntersectionPickEventHandler.cpp
@@ -44,44 +44,41 @@ bool RicIntersectionPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& e
std::vector selection;
caf::SelectionManager::instance()->objectsByType( &selection );
- if ( selection.size() == 1 )
+ if ( selection.size() != 1 ) return false;
+
+ RimExtrudedCurveIntersection* intersection = selection[0];
+
+ RimGridView* gridView = intersection->firstAncestorOrThisOfTypeAsserted();
+
+ if ( RiaApplication::instance()->activeMainOrComparisonGridView() != gridView )
{
- {
- RimExtrudedCurveIntersection* intersection = selection[0];
+ return false;
+ }
- RimGridView* gridView = intersection->firstAncestorOrThisOfTypeAsserted();
+ cvf::ref transForm = gridView->displayCoordTransform();
- if ( RiaApplication::instance()->activeMainOrComparisonGridView() != gridView )
- {
- return false;
- }
+ cvf::Vec3d domainCoord = transForm->transformToDomainCoord( eventObject.m_pickItemInfos.front().globalPickedPoint() );
- cvf::ref transForm = gridView->displayCoordTransform();
+ if ( intersection->inputPolyLineFromViewerEnabled() )
+ {
+ intersection->appendPointToPolyLine( domainCoord );
- cvf::Vec3d domainCoord = transForm->transformToDomainCoord( eventObject.m_pickItemInfos.front().globalPickedPoint() );
+ // Further Ui processing is stopped when true is returned
+ return true;
+ }
+ else if ( intersection->inputExtrusionPointsFromViewerEnabled() )
+ {
+ intersection->appendPointToExtrusionDirection( domainCoord );
- if ( intersection->inputPolyLineFromViewerEnabled() )
- {
- intersection->appendPointToPolyLine( domainCoord );
+ // Further Ui processing is stopped when true is returned
+ return true;
+ }
+ else if ( intersection->inputTwoAzimuthPointsFromViewerEnabled() )
+ {
+ intersection->appendPointToAzimuthLine( domainCoord );
- // Further Ui processing is stopped when true is returned
- return true;
- }
- else if ( intersection->inputExtrusionPointsFromViewerEnabled() )
- {
- intersection->appendPointToExtrusionDirection( domainCoord );
-
- // Further Ui processing is stopped when true is returned
- return true;
- }
- else if ( intersection->inputTwoAzimuthPointsFromViewerEnabled() )
- {
- intersection->appendPointToAzimuthLine( domainCoord );
-
- // Further Ui processing is stopped when true is returned
- return true;
- }
- }
+ // Further Ui processing is stopped when true is returned
+ return true;
}
return false;
diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicNewPolylineTargetFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicNewPolylineTargetFeature.cpp
index 013eadff30..eec85c6ce3 100644
--- a/ApplicationLibCode/Commands/WellPathCommands/RicNewPolylineTargetFeature.cpp
+++ b/ApplicationLibCode/Commands/WellPathCommands/RicNewPolylineTargetFeature.cpp
@@ -21,21 +21,23 @@ CAF_CMD_SOURCE_INIT( RicNewPolylineTargetFeature, "RicNewPolylineTargetFeature"
#include "RimCase.h"
#include "RimGridView.h"
+#include "RimPolylinePickerInterface.h"
#include "RimPolylineTarget.h"
#include "RimProject.h"
-#include "RimUserDefinedPolylinesAnnotation.h"
+
#include "cafSelectionManager.h"
-#include
#include "cvfBoundingBox.h"
+#include
+
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewPolylineTargetFeature::isCommandEnabled() const
{
{
- std::vector objects;
+ std::vector objects;
caf::SelectionManager::instance()->objectsByType( &objects );
if ( !objects.empty() )
@@ -66,7 +68,7 @@ void RicNewPolylineTargetFeature::onActionTriggered( bool isChecked )
if ( !selectedTargets.empty() )
{
auto firstTarget = selectedTargets.front();
- RimUserDefinedPolylinesAnnotation* polylineDef = firstTarget->firstAncestorOrThisOfTypeAsserted();
+ auto polylineDef = firstTarget->firstAncestorOrThisOfTypeAsserted();
auto afterBeforePair = polylineDef->findActiveTargetsAroundInsertionPoint( firstTarget );
@@ -109,49 +111,40 @@ void RicNewPolylineTargetFeature::onActionTriggered( bool isChecked )
return;
}
- std::vector polylineDefs;
+ std::vector polylineDefs;
caf::SelectionManager::instance()->objectsByType( &polylineDefs );
if ( !polylineDefs.empty() )
{
auto* polylineDef = polylineDefs[0];
std::vector activeTargets = polylineDef->activeTargets();
+ cvf::Vec3d newPos = cvf::Vec3d::ZERO;
+
size_t targetCount = activeTargets.size();
-
- if ( targetCount == 0 )
+ if ( targetCount > 1 )
+ {
+ newPos = activeTargets[targetCount - 1]->targetPointXYZ();
+ cvf::Vec3d nextLastToLast = newPos - activeTargets[targetCount - 2]->targetPointXYZ();
+ newPos += 0.5 * nextLastToLast;
+ }
+ else if ( targetCount > 0 )
+ {
+ newPos = activeTargets[targetCount - 1]->targetPointXYZ() + cvf::Vec3d( 0, 0, 200 );
+ }
+ else
{
- auto defaultPos = cvf::Vec3d::ZERO;
-
- // Set decent position
std::vector gridViews;
RimProject::current()->allVisibleGridViews( gridViews );
if ( !gridViews.empty() )
{
auto minPos = gridViews.front()->ownerCase()->allCellsBoundingBox().min();
- defaultPos = minPos;
+ newPos = minPos;
}
-
- polylineDef->appendTarget( defaultPos );
}
- else
- {
- cvf::Vec3d newPos = cvf::Vec3d::ZERO;
- if ( targetCount > 1 )
- {
- newPos = activeTargets[targetCount - 1]->targetPointXYZ();
- cvf::Vec3d nextLastToLast = newPos - activeTargets[targetCount - 2]->targetPointXYZ();
- newPos += 0.5 * nextLastToLast;
- }
- else if ( targetCount > 0 )
- {
- newPos = activeTargets[targetCount - 1]->targetPointXYZ() + cvf::Vec3d( 0, 0, 200 );
- }
-
- auto* newTarget = new RimPolylineTarget;
- newTarget->setAsPointTargetXYD( { newPos[0], newPos[1], -newPos[2] } );
- polylineDef->insertTarget( nullptr, newTarget );
- }
+ auto* newTarget = new RimPolylineTarget;
+ newTarget->setAsPointTargetXYD( { newPos[0], newPos[1], -newPos[2] } );
+ polylineDef->insertTarget( nullptr, newTarget );
polylineDef->updateEditorsAndVisualization();
}
diff --git a/ApplicationLibCode/FileInterface/RifEclEclipseSummary.h b/ApplicationLibCode/FileInterface/RifEclEclipseSummary.h
index d6d51ac789..da75646132 100644
--- a/ApplicationLibCode/FileInterface/RifEclEclipseSummary.h
+++ b/ApplicationLibCode/FileInterface/RifEclEclipseSummary.h
@@ -56,7 +56,7 @@ public:
private:
int indexFromAddress( const RifEclipseSummaryAddress& resultAddress ) const;
- void buildMetaData();
+ void buildMetaData() override;
private:
ecl_sum_type* m_ecl_sum;
diff --git a/ApplicationLibCode/FileInterface/RifFaultReactivationModelExporter.cpp b/ApplicationLibCode/FileInterface/RifFaultReactivationModelExporter.cpp
index a38541a9c4..3f97281136 100644
--- a/ApplicationLibCode/FileInterface/RifFaultReactivationModelExporter.cpp
+++ b/ApplicationLibCode/FileInterface/RifFaultReactivationModelExporter.cpp
@@ -62,13 +62,13 @@ std::pair RifFaultReactivationModelExporter::exportToStream(
// The two parts are "mirrored", so face number 4 of the two parts should face eachother.
using FaultGridPart = RimFaultReactivation::GridPart;
- std::map, int> faces = { { { FaultGridPart::FW, PartBorderSurface::FaultSurface }, 4 },
- { { FaultGridPart::FW, PartBorderSurface::UpperSurface }, 4 },
- { { FaultGridPart::FW, PartBorderSurface::LowerSurface }, 4 },
+ std::map, int> faces = { { { FaultGridPart::FW, PartBorderSurface::FaultSurface }, 5 },
+ { { FaultGridPart::FW, PartBorderSurface::UpperSurface }, 5 },
+ { { FaultGridPart::FW, PartBorderSurface::LowerSurface }, 5 },
{ { FaultGridPart::FW, PartBorderSurface::Seabed }, 2 },
- { { FaultGridPart::HW, PartBorderSurface::FaultSurface }, 4 },
- { { FaultGridPart::HW, PartBorderSurface::UpperSurface }, 4 },
- { { FaultGridPart::HW, PartBorderSurface::LowerSurface }, 4 },
+ { { FaultGridPart::HW, PartBorderSurface::FaultSurface }, 5 },
+ { { FaultGridPart::HW, PartBorderSurface::UpperSurface }, 5 },
+ { { FaultGridPart::HW, PartBorderSurface::LowerSurface }, 5 },
{ { FaultGridPart::HW, PartBorderSurface::Seabed }, 2 } };
std::map partNames = {
@@ -327,6 +327,7 @@ std::pair
double poissonNumber;
double permeability1;
double permeability2;
+ double expansion;
};
RifInpExportTools::printSectionComment( stream, "MATERIALS" );
@@ -334,7 +335,7 @@ std::pair
for ( auto [element, materialName] : materialNames )
{
- std::array parameters = rimModel.materialParameters( element );
+ std::array parameters = rimModel.materialParameters( element );
// Incoming unit for Young's Modulus is GPa: convert to Pa.
double youngsModulus = RiaEclipseUnitTools::gigaPascalToPascal( parameters[0] );
@@ -345,12 +346,15 @@ std::pair
// Unit is already kg/m^3
double density = parameters[2];
+ double expansion = parameters[3];
+
materials.push_back( Material{ .name = materialName,
.density = density,
.youngsModulus = youngsModulus,
.poissonNumber = poissonNumber,
.permeability1 = 1e-09,
- .permeability2 = 0.3 } );
+ .permeability2 = 0.3,
+ .expansion = expansion } );
}
for ( Material mat : materials )
@@ -378,6 +382,8 @@ std::pair
RifInpExportTools::printHeading( stream, "Permeability, specific=1." );
RifInpExportTools::printNumbers( stream, { mat.permeability1, mat.permeability2 } );
+ RifInpExportTools::printHeading( stream, "Expansion" );
+ RifInpExportTools::printNumbers( stream, { mat.expansion } );
}
if ( densityFromGrid )
diff --git a/ApplicationLibCode/FileInterface/RifMultipleSummaryReaders.cpp b/ApplicationLibCode/FileInterface/RifMultipleSummaryReaders.cpp
index 785220b1f2..98df37a642 100644
--- a/ApplicationLibCode/FileInterface/RifMultipleSummaryReaders.cpp
+++ b/ApplicationLibCode/FileInterface/RifMultipleSummaryReaders.cpp
@@ -36,7 +36,7 @@ void RifMultipleSummaryReaders::addReader( RifSummaryReaderInterface* reader )
m_readers.push_back( reader );
- rebuildMetaData();
+ buildMetaData();
}
//--------------------------------------------------------------------------------------------------
@@ -45,7 +45,7 @@ void RifMultipleSummaryReaders::addReader( RifSummaryReaderInterface* reader )
void RifMultipleSummaryReaders::removeReader( RifSummaryReaderInterface* reader )
{
m_readers.erase( reader );
- rebuildMetaData();
+ buildMetaData();
}
//--------------------------------------------------------------------------------------------------
@@ -100,7 +100,7 @@ RiaDefines::EclipseUnitSystem RifMultipleSummaryReaders::unitSystem() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
-void RifMultipleSummaryReaders::rebuildMetaData()
+void RifMultipleSummaryReaders::buildMetaData()
{
m_allErrorAddresses.clear();
m_allResultAddresses.clear();
diff --git a/ApplicationLibCode/FileInterface/RifMultipleSummaryReaders.h b/ApplicationLibCode/FileInterface/RifMultipleSummaryReaders.h
index a18d91fa09..996fa4e66a 100644
--- a/ApplicationLibCode/FileInterface/RifMultipleSummaryReaders.h
+++ b/ApplicationLibCode/FileInterface/RifMultipleSummaryReaders.h
@@ -40,7 +40,7 @@ public:
std::string unitName( const RifEclipseSummaryAddress& resultAddress ) const override;
RiaDefines::EclipseUnitSystem unitSystem() const override;
- void rebuildMetaData();
+ void buildMetaData() override;
private:
cvf::Collection m_readers;
diff --git a/ApplicationLibCode/FileInterface/RifOpmCommonSummary.h b/ApplicationLibCode/FileInterface/RifOpmCommonSummary.h
index 8dc0de8232..570e7e9d73 100644
--- a/ApplicationLibCode/FileInterface/RifOpmCommonSummary.h
+++ b/ApplicationLibCode/FileInterface/RifOpmCommonSummary.h
@@ -78,7 +78,7 @@ public:
RiaDefines::EclipseUnitSystem unitSystem() const override;
private:
- void buildMetaData();
+ void buildMetaData() override;
bool openFileReader( const QString& fileName, bool includeRestartFiles, RiaThreadSafeLogger* threadSafeLogger );
static void increaseEsmryFileCount();
diff --git a/ApplicationLibCode/FileInterface/RifOpmHdf5Summary.h b/ApplicationLibCode/FileInterface/RifOpmHdf5Summary.h
index 8c08ba11bf..dc2727171f 100644
--- a/ApplicationLibCode/FileInterface/RifOpmHdf5Summary.h
+++ b/ApplicationLibCode/FileInterface/RifOpmHdf5Summary.h
@@ -62,7 +62,7 @@ public:
RiaDefines::EclipseUnitSystem unitSystem() const override;
private:
- void buildMetaData();
+ void buildMetaData() override;
bool openESmryFile( const QString& headerFileName, bool includeRestartFiles, RiaThreadSafeLogger* threadSafeLogger );
private:
diff --git a/ApplicationLibCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationLibCode/FileInterface/RifReaderEclipseOutput.cpp
index b4ee519238..78621b4e02 100644
--- a/ApplicationLibCode/FileInterface/RifReaderEclipseOutput.cpp
+++ b/ApplicationLibCode/FileInterface/RifReaderEclipseOutput.cpp
@@ -379,14 +379,13 @@ bool RifReaderEclipseOutput::open( const QString& fileName, RigEclipseCaseData*
if ( !RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName( fileName, &fileSet ) ) return false;
- m_fileName = fileName;
+ m_fileName = fileName;
+ m_filesWithSameBaseName = fileSet;
}
ecl_grid_type* mainEclGrid = nullptr;
{
auto task = progress.task( "Open Init File and Load Main Grid", 19 );
- // Keep the set of files of interest
- m_filesWithSameBaseName = fileSet;
openInitFile();
@@ -608,39 +607,6 @@ const size_t* RifReaderEclipseOutput::eclipseCellIndexMapping()
return cellMappingECLRi;
}
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-void RifReaderEclipseOutput::importFaults( const QStringList& fileSet, cvf::Collection* faults )
-{
- if ( !filenamesWithFaults().empty() )
- {
- for ( size_t i = 0; i < filenamesWithFaults().size(); i++ )
- {
- QString faultFilename = filenamesWithFaults()[i];
-
- RifEclipseInputFileTools::parseAndReadFaults( faultFilename, faults );
- }
- }
- else
- {
- foreach ( QString fname, fileSet )
- {
- if ( fname.endsWith( ".DATA" ) )
- {
- std::vector filenamesWithFaults;
- RifEclipseInputFileTools::readFaultsInGridSection( fname, faults, &filenamesWithFaults, faultIncludeFileAbsolutePathPrefix() );
-
- std::sort( filenamesWithFaults.begin(), filenamesWithFaults.end() );
- std::vector::iterator last = std::unique( filenamesWithFaults.begin(), filenamesWithFaults.end() );
- filenamesWithFaults.erase( last, filenamesWithFaults.end() );
-
- setFilenamesWithFaults( filenamesWithFaults );
- }
- }
- }
-}
-
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
diff --git a/ApplicationLibCode/FileInterface/RifReaderEclipseOutput.h b/ApplicationLibCode/FileInterface/RifReaderEclipseOutput.h
index 7984fc88b7..39d976de4b 100644
--- a/ApplicationLibCode/FileInterface/RifReaderEclipseOutput.h
+++ b/ApplicationLibCode/FileInterface/RifReaderEclipseOutput.h
@@ -103,8 +103,6 @@ private:
const well_segment_type* segment,
const char* wellName );
- void importFaults( const QStringList& fileSet, cvf::Collection* faults );
-
void openInitFile();
void extractResultValuesBasedOnPorosityModel( RiaDefines::PorosityModelType matrixOrFracture,
diff --git a/ApplicationLibCode/FileInterface/RifReaderEclipseSummary.h b/ApplicationLibCode/FileInterface/RifReaderEclipseSummary.h
index 7028e384d3..769aaf1251 100644
--- a/ApplicationLibCode/FileInterface/RifReaderEclipseSummary.h
+++ b/ApplicationLibCode/FileInterface/RifReaderEclipseSummary.h
@@ -54,10 +54,9 @@ public:
std::pair> values( const RifEclipseSummaryAddress& resultAddress ) const override;
std::string unitName( const RifEclipseSummaryAddress& resultAddress ) const override;
RiaDefines::EclipseUnitSystem unitSystem() const override;
+ void buildMetaData() override;
private:
- void buildMetaData();
-
RifSummaryReaderInterface* currentSummaryReader() const;
private:
diff --git a/ApplicationLibCode/FileInterface/RifReaderInterface.cpp b/ApplicationLibCode/FileInterface/RifReaderInterface.cpp
index 9012df12ca..341f172dbb 100644
--- a/ApplicationLibCode/FileInterface/RifReaderInterface.cpp
+++ b/ApplicationLibCode/FileInterface/RifReaderInterface.cpp
@@ -21,6 +21,7 @@
#include "RiaPreferences.h"
+#include "RifEclipseInputFileTools.h"
#include "RifReaderSettings.h"
//--------------------------------------------------------------------------------------------------
@@ -144,3 +145,36 @@ void RifReaderInterface::setReaderSettings( std::shared_ptr r
{
m_readerSettings = readerSettings;
}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RifReaderInterface::importFaults( const QStringList& fileSet, cvf::Collection* faults )
+{
+ if ( !filenamesWithFaults().empty() )
+ {
+ for ( size_t i = 0; i < filenamesWithFaults().size(); i++ )
+ {
+ QString faultFilename = filenamesWithFaults()[i];
+
+ RifEclipseInputFileTools::parseAndReadFaults( faultFilename, faults );
+ }
+ }
+ else
+ {
+ foreach ( QString fname, fileSet )
+ {
+ if ( fname.endsWith( ".DATA" ) )
+ {
+ std::vector filenamesWithFaults;
+ RifEclipseInputFileTools::readFaultsInGridSection( fname, faults, &filenamesWithFaults, faultIncludeFileAbsolutePathPrefix() );
+
+ std::sort( filenamesWithFaults.begin(), filenamesWithFaults.end() );
+ std::vector::iterator last = std::unique( filenamesWithFaults.begin(), filenamesWithFaults.end() );
+ filenamesWithFaults.erase( last, filenamesWithFaults.end() );
+
+ setFilenamesWithFaults( filenamesWithFaults );
+ }
+ }
+ }
+}
diff --git a/ApplicationLibCode/FileInterface/RifReaderInterface.h b/ApplicationLibCode/FileInterface/RifReaderInterface.h
index 9bd4e4477b..7619b392e3 100644
--- a/ApplicationLibCode/FileInterface/RifReaderInterface.h
+++ b/ApplicationLibCode/FileInterface/RifReaderInterface.h
@@ -23,6 +23,7 @@
#include "RiaDefines.h"
#include "RiaPorosityModel.h"
+#include "cvfCollection.h"
#include "cvfObject.h"
#include "cafPdmPointer.h"
@@ -36,6 +37,7 @@
class RigEclipseCaseData;
class RifReaderSettings;
+class RigFault;
//==================================================================================================
//
@@ -77,6 +79,7 @@ public:
protected:
bool isTimeStepIncludedByFilter( size_t timeStepIndex ) const;
size_t timeStepIndexOnFile( size_t timeStepIndex ) const;
+ void importFaults( const QStringList& fileSet, cvf::Collection* faults );
private:
const RifReaderSettings* readerSettings() const;
diff --git a/ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp b/ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp
index 3c8fd09394..a71d9b4a04 100644
--- a/ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp
+++ b/ApplicationLibCode/FileInterface/RifReaderOpmCommon.cpp
@@ -31,6 +31,8 @@
#include "RigSimWellData.h"
#include "RigWellResultFrame.h"
+#include "cafProgressInfo.h"
+
#include "opm/input/eclipse/Deck/Deck.hpp"
#include "opm/input/eclipse/EclipseState/Runspec.hpp"
#include "opm/input/eclipse/Parser/Parser.hpp"
@@ -65,6 +67,8 @@ RifReaderOpmCommon::~RifReaderOpmCommon()
//--------------------------------------------------------------------------------------------------
bool RifReaderOpmCommon::open( const QString& fileName, RigEclipseCaseData* eclipseCase )
{
+ caf::ProgressInfo progress( 100, "Reading Grid" );
+
QStringList fileSet;
if ( !RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName( fileName, &fileSet ) ) return false;
@@ -79,7 +83,24 @@ bool RifReaderOpmCommon::open( const QString& fileName, RigEclipseCaseData* ecli
return false;
}
- buildMetaData( eclipseCase );
+ {
+ auto task = progress.task( "Reading faults", 25 );
+
+ if ( isFaultImportEnabled() )
+ {
+ cvf::Collection faults;
+
+ importFaults( fileSet, &faults );
+
+ RigMainGrid* mainGrid = eclipseCase->mainGrid();
+ mainGrid->setFaults( faults );
+ }
+ }
+
+ {
+ auto task = progress.task( "Reading Results Meta data", 50 );
+ buildMetaData( eclipseCase );
+ }
return true;
}
diff --git a/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.cpp b/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.cpp
index 599ab33b0e..01ee289adb 100644
--- a/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.cpp
+++ b/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.cpp
@@ -49,6 +49,13 @@ RifEclipseSummaryAddress RifSummaryReaderInterface::errorAddress( const RifEclip
return m_allErrorAddresses.find( errAddr ) != m_allErrorAddresses.end() ? errAddr : RifEclipseSummaryAddress();
}
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RifSummaryReaderInterface::buildMetaData()
+{
+}
+
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
diff --git a/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.h b/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.h
index 1c7c3b32a4..efdd2973c6 100644
--- a/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.h
+++ b/ApplicationLibCode/FileInterface/RifSummaryReaderInterface.h
@@ -51,6 +51,8 @@ public:
virtual std::string unitName( const RifEclipseSummaryAddress& resultAddress ) const = 0;
virtual RiaDefines::EclipseUnitSystem unitSystem() const = 0;
+ virtual void buildMetaData();
+
protected:
std::set m_allResultAddresses; // Result and error addresses
std::set m_allErrorAddresses; // Error addresses
diff --git a/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake
index 36c5f0a7b6..83fa8fa67f 100644
--- a/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake
+++ b/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake
@@ -54,7 +54,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RivWellDiskPartMgr.h
${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.h
${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.h
- ${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.h
${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.h
${CMAKE_CURRENT_LIST_DIR}/RivBoxGeometryGenerator.h
${CMAKE_CURRENT_LIST_DIR}/RivAnnotationTools.h
@@ -112,7 +111,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RivWellDiskPartMgr.cpp
${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.cpp
${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.cpp
- ${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.cpp
${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.cpp
${CMAKE_CURRENT_LIST_DIR}/RivBoxGeometryGenerator.cpp
${CMAKE_CURRENT_LIST_DIR}/RivAnnotationTools.cpp
diff --git a/ApplicationLibCode/ModelVisualization/RivCellFilterPartMgr.h b/ApplicationLibCode/ModelVisualization/RivCellFilterPartMgr.h
deleted file mode 100644
index a58d0d1916..0000000000
--- a/ApplicationLibCode/ModelVisualization/RivCellFilterPartMgr.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////////
-//
-// 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.
-//
-/////////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-#include "cafPdmPointer.h"
-#include "cvfAssert.h"
-#include "cvfCollection.h"
-#include "cvfObject.h"
-
-namespace cvf
-{
-class BoundingBox;
-class Part;
-class ModelBasicList;
-class Transform;
-class Font;
-} // namespace cvf
-namespace caf
-{
-class DisplayCoordTransform;
-}
-
-class Rim3dView;
-class RivPolylinePartMgr;
-
-class RivCellFilterPartMgr : public cvf::Object
-{
-public:
- RivCellFilterPartMgr( Rim3dView* view );
- ~RivCellFilterPartMgr() override;
-
- void appendGeometryPartsToModel( cvf::ModelBasicList* model,
- const caf::DisplayCoordTransform* displayCoordTransform,
- const cvf::BoundingBox& boundingBox );
-
- void clearGeometryCache();
-
-private:
- void createCellFilterPartManagers();
-
-private:
- caf::PdmPointer m_rimView;
- cvf::Collection m_cellFilterPartMgrs;
-};
diff --git a/ApplicationLibCode/ModelVisualization/RivPolylinePartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivPolylinePartMgr.cpp
index 12ba78f953..d7c15ced50 100644
--- a/ApplicationLibCode/ModelVisualization/RivPolylinePartMgr.cpp
+++ b/ApplicationLibCode/ModelVisualization/RivPolylinePartMgr.cpp
@@ -82,7 +82,7 @@ bool RivPolylinePartMgr::isPolylinesInBoundingBox( std::vectorpolyLinesData();
- if ( polylineDef.isNull() || polylineDef->polyLines().empty() )
+ if ( polylineDef.isNull() || polylineDef->rawPolyLines().empty() )
{
clearAllGeometry();
return;
@@ -107,6 +107,7 @@ void RivPolylinePartMgr::buildPolylineParts( const caf::DisplayCoordTransform* d
cvf::ref part = new cvf::Part;
part->setName( "RivPolylinePartMgr" );
part->setDrawable( drawableGeo.p() );
+ part->updateBoundingBox();
caf::MeshEffectGenerator effgen( polylineDef->lineColor() );
effgen.setLineWidth( polylineDef->lineThickness() );
@@ -177,6 +178,7 @@ void RivPolylinePartMgr::buildPolylineParts( const caf::DisplayCoordTransform* d
cvf::ref part = new cvf::Part;
part->setName( "RivPolylinePartMgr" );
part->setDrawable( vectorDrawable.p() );
+ part->updateBoundingBox();
part->setEffect( new cvf::Effect() );
part->setPriority( RivPartPriority::PartType::MeshLines );
@@ -190,7 +192,7 @@ void RivPolylinePartMgr::buildPolylineParts( const caf::DisplayCoordTransform* d
//--------------------------------------------------------------------------------------------------
std::vector> RivPolylinePartMgr::getPolylinesPointsInDomain( RigPolyLinesData* lineDef )
{
- auto polylines = lineDef->polyLines();
+ auto polylines = lineDef->rawPolyLines();
if ( !lineDef->lockToZPlane() ) return polylines;
const double planeZ = lineDef->lockedZValue();
diff --git a/ApplicationLibCode/ProjectDataModel/Annotations/RimPolylineTarget.cpp b/ApplicationLibCode/ProjectDataModel/Annotations/RimPolylineTarget.cpp
index 009b87bc3e..b2c48b8ffc 100644
--- a/ApplicationLibCode/ProjectDataModel/Annotations/RimPolylineTarget.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Annotations/RimPolylineTarget.cpp
@@ -29,9 +29,7 @@ CAF_PDM_SOURCE_INIT( RimPolylineTarget, "PolylineTarget" );
///
//--------------------------------------------------------------------------------------------------
RimPolylineTarget::RimPolylineTarget()
- : m_isFullUpdateEnabled( true )
{
- CAF_PDM_InitField( &m_isEnabled, "IsEnabled", true, "" );
CAF_PDM_InitFieldNoDefault( &m_targetPointXyd, "TargetPointXyd", "Point" );
}
@@ -42,14 +40,6 @@ RimPolylineTarget::~RimPolylineTarget()
{
}
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-bool RimPolylineTarget::isEnabled() const
-{
- return m_isEnabled;
-}
-
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -84,14 +74,6 @@ caf::PdmUiFieldHandle* RimPolylineTarget::targetPointUiCapability()
return m_targetPointXyd.uiCapability();
}
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-void RimPolylineTarget::enableFullUpdate( bool enable )
-{
- m_isFullUpdateEnabled = enable;
-}
-
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
diff --git a/ApplicationLibCode/ProjectDataModel/Annotations/RimPolylineTarget.h b/ApplicationLibCode/ProjectDataModel/Annotations/RimPolylineTarget.h
index 272362deb4..799c983b58 100644
--- a/ApplicationLibCode/ProjectDataModel/Annotations/RimPolylineTarget.h
+++ b/ApplicationLibCode/ProjectDataModel/Annotations/RimPolylineTarget.h
@@ -38,14 +38,11 @@ public:
RimPolylineTarget();
~RimPolylineTarget() override;
- bool isEnabled() const;
-
void setAsPointTargetXYD( const cvf::Vec3d& point );
void setAsPointXYZ( const cvf::Vec3d& point );
cvf::Vec3d targetPointXYZ() const;
caf::PdmUiFieldHandle* targetPointUiCapability();
- void enableFullUpdate( bool enable );
void triggerVisualizationUpdate() const;
@@ -54,7 +51,5 @@ private:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
private:
- bool m_isFullUpdateEnabled;
- caf::PdmField m_isEnabled;
caf::PdmField m_targetPointXyd;
};
diff --git a/ApplicationLibCode/ProjectDataModel/Annotations/RimPolylinesFromFileAnnotation.cpp b/ApplicationLibCode/ProjectDataModel/Annotations/RimPolylinesFromFileAnnotation.cpp
index a78843ddd0..ca7a0c6efc 100644
--- a/ApplicationLibCode/ProjectDataModel/Annotations/RimPolylinesFromFileAnnotation.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Annotations/RimPolylinesFromFileAnnotation.cpp
@@ -158,7 +158,7 @@ bool RimPolylinesFromFileAnnotation::isEmpty()
{
if ( m_polyLinesData.isNull() ) return true;
- for ( const std::vector& line : m_polyLinesData->polyLines() )
+ for ( const std::vector& line : m_polyLinesData->rawPolyLines() )
{
if ( !line.empty() ) return false;
}
diff --git a/ApplicationLibCode/ProjectDataModel/Annotations/RimReachCircleAnnotation.cpp b/ApplicationLibCode/ProjectDataModel/Annotations/RimReachCircleAnnotation.cpp
index db573a91d7..005b771caf 100644
--- a/ApplicationLibCode/ProjectDataModel/Annotations/RimReachCircleAnnotation.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Annotations/RimReachCircleAnnotation.cpp
@@ -44,8 +44,7 @@ RimReachCircleAnnotation::RimReachCircleAnnotation()
CAF_PDM_InitField( &m_centerPointXyd, "CenterPointXyd", Vec3d::ZERO, "Center Point" );
m_centerPointXyd.uiCapability()->setUiEditorTypeName( caf::PdmUiPickableLineEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_centerPointPickEnabled, "AnchorPointPick", false, "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_centerPointPickEnabled );
- m_centerPointPickEnabled.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::LabelPosType::HIDDEN );
+ caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_centerPointPickEnabled );
CAF_PDM_InitField( &m_radius, "Radius", 100.0, "Radius" );
CAF_PDM_InitField( &m_name, "Name", QString( "Circle Annotation" ), "Name" );
diff --git a/ApplicationLibCode/ProjectDataModel/Annotations/RimTextAnnotation.cpp b/ApplicationLibCode/ProjectDataModel/Annotations/RimTextAnnotation.cpp
index cbdd9e99b5..5c18975bce 100644
--- a/ApplicationLibCode/ProjectDataModel/Annotations/RimTextAnnotation.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Annotations/RimTextAnnotation.cpp
@@ -51,14 +51,12 @@ RimTextAnnotation::RimTextAnnotation()
CAF_PDM_InitField( &m_anchorPointXyd, "AnchorPointXyd", Vec3d::ZERO, "Anchor Point" );
m_anchorPointXyd.uiCapability()->setUiEditorTypeName( caf::PdmUiPickableLineEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_anchorPointPickEnabledButtonField, "AnchorPointPick", false, "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_anchorPointPickEnabledButtonField );
- m_anchorPointPickEnabledButtonField.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::LabelPosType::HIDDEN );
+ caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_anchorPointPickEnabledButtonField );
CAF_PDM_InitField( &m_labelPointXyd, "LabelPointXyd", Vec3d::ZERO, "Label Point" );
m_labelPointXyd.uiCapability()->setUiEditorTypeName( caf::PdmUiPickableLineEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_labelPointPickEnabledButtonField, "LabelPointPick", false, "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_labelPointPickEnabledButtonField );
- m_labelPointPickEnabledButtonField.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::LabelPosType::HIDDEN );
+ caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_labelPointPickEnabledButtonField );
CAF_PDM_InitField( &m_text, "Text", QString( "(New text)" ), "Text" );
m_text.uiCapability()->setUiEditorTypeName( caf::PdmUiTextEditor::uiEditorTypeName() );
diff --git a/ApplicationLibCode/ProjectDataModel/Annotations/RimUserDefinedPolylinesAnnotation.cpp b/ApplicationLibCode/ProjectDataModel/Annotations/RimUserDefinedPolylinesAnnotation.cpp
index 82916de56c..d86ab4b699 100644
--- a/ApplicationLibCode/ProjectDataModel/Annotations/RimUserDefinedPolylinesAnnotation.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Annotations/RimUserDefinedPolylinesAnnotation.cpp
@@ -49,7 +49,7 @@ RimUserDefinedPolylinesAnnotation::RimUserDefinedPolylinesAnnotation()
CAF_PDM_InitField( &m_name, "Name", QString( "User Defined Polyline" ), "Name" );
CAF_PDM_InitField( &m_enablePicking, "EnablePicking", false, "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_enablePicking );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_enablePicking );
m_enablePicking.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::LabelPosType::HIDDEN );
CAF_PDM_InitFieldNoDefault( &m_targets, "Targets", "Targets" );
@@ -152,31 +152,6 @@ void RimUserDefinedPolylinesAnnotation::deleteTarget( RimPolylineTarget* targetT
delete targetToDelete;
}
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-std::pair
- RimUserDefinedPolylinesAnnotation::findActiveTargetsAroundInsertionPoint( const RimPolylineTarget* targetToInsertBefore )
-{
- RimPolylineTarget* before = nullptr;
- RimPolylineTarget* after = nullptr;
-
- bool foundTarget = false;
- for ( const auto& wt : m_targets )
- {
- if ( wt == targetToInsertBefore )
- {
- foundTarget = true;
- }
-
- if ( wt->isEnabled() && !after && foundTarget ) after = wt;
-
- if ( wt->isEnabled() && !foundTarget ) before = wt;
- }
-
- return { before, after };
-}
-
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
diff --git a/ApplicationLibCode/ProjectDataModel/Annotations/RimUserDefinedPolylinesAnnotation.h b/ApplicationLibCode/ProjectDataModel/Annotations/RimUserDefinedPolylinesAnnotation.h
index 9afb83e562..000a2492e2 100644
--- a/ApplicationLibCode/ProjectDataModel/Annotations/RimUserDefinedPolylinesAnnotation.h
+++ b/ApplicationLibCode/ProjectDataModel/Annotations/RimUserDefinedPolylinesAnnotation.h
@@ -60,8 +60,6 @@ public:
void appendTarget( const cvf::Vec3d& defaultPos = cvf::Vec3d::ZERO );
- std::pair findActiveTargetsAroundInsertionPoint( const RimPolylineTarget* targetToInsertBefore );
-
void enablePicking( bool enable );
protected:
diff --git a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake
index 6b50a735aa..d3366768f1 100644
--- a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake
+++ b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake
@@ -267,6 +267,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimResultSelectionUi.cpp
${CMAKE_CURRENT_LIST_DIR}/RimPlotRectAnnotation.cpp
${CMAKE_CURRENT_LIST_DIR}/RimEmCase.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/RimPolylinePickerInterface.cpp
)
if(RESINSIGHT_USE_QT_CHARTS)
diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.cpp b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.cpp
index debe2ba6f7..c6b0c38d64 100644
--- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.cpp
+++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.cpp
@@ -145,6 +145,12 @@ void RimCellFilterCollection::fieldChangedByUi( const caf::PdmFieldHandle* chang
uiCapability()->updateConnectedEditors();
onFilterUpdated( nullptr );
+
+ for ( const auto& filter : m_cellFilters )
+ {
+ // Update the filters to make sure the 3D polygon targets are removed if the filter collection is disabled
+ filter->updateConnectedEditors();
+ }
}
//--------------------------------------------------------------------------------------------------
@@ -255,12 +261,22 @@ bool RimCellFilterCollection::hasActiveIncludeRangeFilters() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
-RimPolygonFilter* RimCellFilterCollection::addNewPolygonFilter( RimCase* srcCase )
+RimPolygonFilter* RimCellFilterCollection::addNewPolygonFilter( RimCase* srcCase, RimPolygon* polygon )
{
RimPolygonFilter* pFilter = new RimPolygonFilter();
pFilter->setCase( srcCase );
+ pFilter->setPolygon( polygon );
addFilter( pFilter );
- pFilter->enablePicking( true );
+ pFilter->configurePolygonEditor();
+ if ( polygon )
+ {
+ pFilter->enableFilter( true );
+ }
+ else
+ {
+ pFilter->enablePicking( true );
+ }
+
onFilterUpdated( pFilter );
return pFilter;
}
@@ -485,3 +501,23 @@ void RimCellFilterCollection::updateCellVisibilityByIndex( cvf::UByteArray* incl
}
}
}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+std::vector RimCellFilterCollection::enabledCellFilterPolygons() const
+{
+ std::vector polyInView;
+
+ for ( const auto& filter : m_cellFilters )
+ {
+ if ( !filter->isActive() ) continue;
+
+ if ( auto polygonFilter = dynamic_cast( filter.p() ) )
+ {
+ polyInView.push_back( polygonFilter->polygonInView() );
+ }
+ }
+
+ return polyInView;
+}
diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.h b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.h
index 87a7d808ba..7184a32541 100644
--- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.h
+++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.h
@@ -32,6 +32,8 @@ class RimPolygonFilter;
class RimUserDefinedFilter;
class RimUserDefinedIndexFilter;
class RimCase;
+class RimPolygonInView;
+class RimPolygon;
namespace cvf
{
@@ -52,7 +54,7 @@ public:
caf::Signal<> filtersChanged;
- RimPolygonFilter* addNewPolygonFilter( RimCase* srcCase );
+ RimPolygonFilter* addNewPolygonFilter( RimCase* srcCase, RimPolygon* polygon );
RimCellRangeFilter* addNewCellRangeFilter( RimCase* srcCase, int gridIndex, int sliceDirection = -1, int defaultSlice = -1 );
RimCellIndexFilter* addNewCellIndexFilter( RimCase* srcCase );
RimUserDefinedFilter* addNewUserDefinedFilter( RimCase* srcCase );
@@ -69,7 +71,8 @@ public:
void compoundCellRangeFilter( cvf::CellRangeFilter* cellRangeFilter, size_t gridIndex ) const;
void updateCellVisibilityByIndex( cvf::UByteArray* cellsIncluded, cvf::UByteArray* cellsExcluded, size_t gridIndex ) const;
- std::vector filters() const;
+ std::vector enabledCellFilterPolygons() const;
+ std::vector filters() const;
bool hasActiveFilters() const;
bool hasActiveIncludeIndexFilters() const;
diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimEclipsePropertyFilter.cpp b/ApplicationLibCode/ProjectDataModel/CellFilters/RimEclipsePropertyFilter.cpp
index 6722a70070..81d2479bfe 100644
--- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimEclipsePropertyFilter.cpp
+++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimEclipsePropertyFilter.cpp
@@ -389,7 +389,7 @@ void RimEclipsePropertyFilter::defineObjectEditorAttribute( QString uiConfigName
if ( treeItemAttribute )
{
treeItemAttribute->tags.clear();
- auto tag = caf::PdmUiTreeViewItemAttribute::Tag::create();
+ auto tag = caf::PdmUiTreeViewItemAttribute::createTag();
tag->icon = caf::IconProvider( ":/chain.png" );
treeItemAttribute->tags.push_back( std::move( tag ) );
diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.cpp b/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.cpp
index 7267dff235..54614df48c 100644
--- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.cpp
+++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.cpp
@@ -20,39 +20,29 @@
#include "RigCellGeometryTools.h"
#include "RigEclipseCaseData.h"
-#include "RigFemPart.h"
#include "RigFemPartCollection.h"
#include "RigFemPartGrid.h"
#include "RigGeoMechCaseData.h"
#include "RigMainGrid.h"
-#include "RigPolyLinesData.h"
#include "RigReservoirGridTools.h"
-#include "Rim3dView.h"
-#include "RimCase.h"
#include "RimCellFilterCollection.h"
#include "RimEclipseCase.h"
#include "RimGeoMechCase.h"
#include "RimPolylineTarget.h"
+#include "RimTools.h"
+
+#include "Polygons/RimPolygon.h"
+#include "Polygons/RimPolygonCollection.h"
+#include "Polygons/RimPolygonInView.h"
+#include "Polygons/RimPolygonTools.h"
+
+#include "Riu3DMainWindowTools.h"
#include "WellPathCommands/PointTangentManipulator/RicPolyline3dEditor.h"
#include "WellPathCommands/RicPolylineTargetsPickEventHandler.h"
-#include "RiuViewerCommands.h"
-
-#include "RiaStdStringTools.h"
-
-#include "cafCmdFeatureMenuBuilder.h"
-#include "cafPdmUiLineEditor.h"
#include "cafPdmUiPushButtonEditor.h"
-#include "cafPdmUiTableViewEditor.h"
-#include "cafPdmUiTreeOrdering.h"
-#include
-
-#include "cvfBoundingBox.h"
-#include "cvfStructGrid.h"
-
-#include
#include
@@ -75,44 +65,24 @@ void caf::AppEnum::setUp()
setDefault( RimPolygonFilter::PolygonIncludeType::CENTER );
}
+template <>
+void caf::AppEnum::setUp()
+{
+ addItem( RimPolygonFilter::GeometricalShape::AREA, "AREA", "Area Filter" );
+ addItem( RimPolygonFilter::GeometricalShape::LINE, "LINE", "Line Filter" );
+ setDefault( RimPolygonFilter::GeometricalShape::AREA );
+}
+
+template <>
+void caf::AppEnum::setUp()
+{
+ addItem( RimPolygonFilter::PolygonDataSource::DEFINED_IN_FILTER, "DEFINED_IN_FILTER", "Defined in Filter" );
+ addItem( RimPolygonFilter::PolygonDataSource::GLOBAL_POLYGON, "GLOBAL_POLYGON", "Polygon in Project" );
+ setDefault( RimPolygonFilter::PolygonDataSource::DEFINED_IN_FILTER );
+}
+
} // namespace caf
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-class ThicknessValidator : public QValidator
-{
-public:
- State validate( QString& input, int& pos ) const override
- {
- if ( input.isEmpty() ) return State::Intermediate;
-
- int val = RiaStdStringTools::toInt( input.toStdString() );
- if ( val > 0 && val < 8 )
- return State::Acceptable;
- else
- return State::Invalid;
- }
-};
-
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-class RadiusValidator : public QValidator
-{
-public:
- State validate( QString& input, int& pos ) const override
- {
- if ( input.isEmpty() ) return State::Intermediate;
-
- double val = RiaStdStringTools::toDouble( input.toStdString() );
- if ( val > 0.001 && val <= 2.0 )
- return State::Acceptable;
- else
- return State::Invalid;
- }
-};
-
CAF_PDM_SOURCE_INIT( RimPolygonFilter, "PolygonFilter", "PolyLineFilter" );
//--------------------------------------------------------------------------------------------------
@@ -128,70 +98,44 @@ RimPolygonFilter::RimPolygonFilter()
CAF_PDM_InitFieldNoDefault( &m_polyFilterMode, "PolygonFilterType", "Vertical Filter" );
CAF_PDM_InitFieldNoDefault( &m_polyIncludeType, "PolyIncludeType", "Cells to include" );
+ CAF_PDM_InitFieldNoDefault( &m_polygonDataSource, "PolygonDataSource", "Data Source" );
- CAF_PDM_InitField( &m_enablePicking, "EnablePicking", false, "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_enablePicking );
- m_enablePicking.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::LabelPosType::HIDDEN );
+ CAF_PDM_InitFieldNoDefault( &m_geometricalShape, "GeometricalShape", "" );
+ m_geometricalShape.registerGetMethod( this, &RimPolygonFilter::geometricalShape );
+ m_geometricalShape.registerSetMethod( this, &RimPolygonFilter::setGeometricalShape );
- CAF_PDM_InitFieldNoDefault( &m_targets, "Targets", "Targets" );
- m_targets.uiCapability()->setUiEditorTypeName( caf::PdmUiTableViewEditor::uiEditorTypeName() );
- m_targets.uiCapability()->setUiTreeChildrenHidden( true );
- m_targets.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
- m_targets.uiCapability()->setCustomContextMenuEnabled( true );
+ CAF_PDM_InitFieldNoDefault( &m_internalPolygon, "InternalPolygon", "Polygon For Filter" );
+ m_internalPolygon = new RimPolygon;
+ m_internalPolygon->setName( "Polygon For Filter" );
+ m_internalPolygon->uiCapability()->setUiTreeHidden( true );
- CAF_PDM_InitField( &m_showLines, "ShowLines", true, "Show Lines" );
- CAF_PDM_InitField( &m_showSpheres, "ShowSpheres", false, "Show Spheres" );
- CAF_PDM_InitField( &m_closePolygon, "ClosePolygon", true, "Closed Polygon" );
+ CAF_PDM_InitFieldNoDefault( &m_cellFilterPolygon, "Polygon", "Polygon" );
- CAF_PDM_InitField( &m_lineThickness, "LineThickness", 3, "Line Thickness" );
- CAF_PDM_InitField( &m_sphereRadiusFactor, "SphereRadiusFactor", 0.15, "Sphere Radius Factor" );
-
- CAF_PDM_InitField( &m_lineColor, "LineColor", cvf::Color3f( cvf::Color3f::WHITE ), "Line Color" );
- CAF_PDM_InitField( &m_sphereColor, "SphereColor", cvf::Color3f( cvf::Color3f::WHITE ), "Sphere Color" );
+ CAF_PDM_InitFieldNoDefault( &m_polygonEditor, "PolygonEditor", "Polygon Editor" );
+ m_polygonEditor = new RimPolygonInView;
+ m_polygonEditor->uiCapability()->setUiTreeHidden( true );
+ m_polygonEditor.xmlCapability()->disableIO();
CAF_PDM_InitField( &m_enableFiltering, "EnableFiltering", false, "Enable Filter" );
CAF_PDM_InitField( &m_enableKFilter, "EnableKFilter", false, "Enable K Range Filter" );
CAF_PDM_InitFieldNoDefault( &m_kFilterStr, "KRangeFilter", "K Range Filter", "", "Example: 2,4-6,10-20:2", "" );
- CAF_PDM_InitField( &m_polygonPlaneDepth, "PolygonPlaneDepth", 0.0, "Polygon Plane Depth" );
- CAF_PDM_InitField( &m_lockPolygonToPlane, "LockPolygon", false, "Lock Polygon to Plane" );
+ CAF_PDM_InitField( &m_editPolygonButton, "EditPolygonButton", false, "Edit" );
+ caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_editPolygonButton );
- m_polygonPlaneDepth.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
- m_polygonPlaneDepth.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::LabelPosType::TOP );
-
- setUi3dEditorTypeName( RicPolyline3dEditor::uiEditorTypeName() );
- uiCapability()->setUiTreeChildrenHidden( true );
+ CAF_PDM_InitFieldNoDefault( &m_OBSOLETE_targets, "Targets", "Targets" );
+ m_OBSOLETE_targets.uiCapability()->setUiTreeChildrenHidden( true );
+ m_OBSOLETE_targets.uiCapability()->setUiTreeHidden( true );
+ m_OBSOLETE_targets.uiCapability()->setUiHidden( true );
+ m_OBSOLETE_targets.xmlCapability()->setIOWritable( false );
m_propagateToSubGrids = false;
updateIconState();
setDeletable( true );
-}
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-RimPolygonFilter::~RimPolygonFilter()
-{
-}
-
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-void RimPolygonFilter::updateVisualization()
-{
- updateCells();
- filterChanged.send();
-}
-
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-void RimPolygonFilter::updateEditorsAndVisualization()
-{
- updateConnectedEditors();
- updateVisualization();
+ setUi3dEditorTypeName( RicPolyline3dEditor::uiEditorTypeName() );
}
//--------------------------------------------------------------------------------------------------
@@ -210,6 +154,18 @@ void RimPolygonFilter::enableKFilter( bool bEnable )
m_enableKFilter = bEnable;
}
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimPolygonFilter::setPolygon( RimPolygon* polygon )
+{
+ if ( polygon )
+ {
+ m_polygonDataSource = PolygonDataSource::GLOBAL_POLYGON;
+ m_cellFilterPolygon = polygon;
+ }
+}
+
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -238,32 +194,23 @@ QString RimPolygonFilter::fullName() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
-std::vector RimPolygonFilter::activeTargets() const
+void RimPolygonFilter::initAfterRead()
{
- return m_targets.childrenByType();
-}
+ RimCellFilter::initAfterRead();
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-void RimPolygonFilter::insertTarget( const RimPolylineTarget* targetToInsertBefore, RimPolylineTarget* targetToInsert )
-{
- size_t index = m_targets.indexOf( targetToInsertBefore );
- if ( index < m_targets.size() )
- m_targets.insert( index, targetToInsert );
- else
- m_targets.push_back( targetToInsert );
+ // Move existing polygons to global polygon
+ if ( !m_OBSOLETE_targets.empty() )
+ {
+ std::vector points;
+ for ( const auto& target : m_OBSOLETE_targets )
+ {
+ points.push_back( target->targetPointXYZ() );
+ }
- updateCells();
-}
+ m_internalPolygon->setPointsInDomainCoords( points );
+ }
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-void RimPolygonFilter::deleteTarget( RimPolylineTarget* targetToDelete )
-{
- m_targets.removeChild( targetToDelete );
- delete targetToDelete;
+ configurePolygonEditor();
}
//--------------------------------------------------------------------------------------------------
@@ -271,68 +218,17 @@ void RimPolygonFilter::deleteTarget( RimPolylineTarget* targetToDelete )
//--------------------------------------------------------------------------------------------------
void RimPolygonFilter::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
{
- if ( field == &m_enablePicking )
+ if ( auto attrib = dynamic_cast( attribute ) )
{
- auto* pbAttribute = dynamic_cast( attribute );
- if ( pbAttribute )
- {
- if ( !m_enablePicking )
- {
- pbAttribute->m_buttonText = "Start Picking Points";
- }
- else
- {
- pbAttribute->m_buttonText = "Stop Picking Points";
- }
- }
+ attrib->pickEventHandler = m_pickTargetsEventHandler;
+ attrib->enablePicking = m_polygonEditor->pickingEnabled();
}
- else if ( field == &m_targets )
- {
- auto tvAttribute = dynamic_cast( attribute );
- if ( tvAttribute )
- {
- tvAttribute->resizePolicy = caf::PdmUiTableViewEditorAttribute::RESIZE_TO_FIT_CONTENT;
- if ( m_enablePicking )
- {
- tvAttribute->baseColor.setRgb( 255, 220, 255 );
- tvAttribute->alwaysEnforceResizePolicy = true;
- }
- }
- }
- else if ( field == &m_lineThickness )
+ if ( field == &m_editPolygonButton )
{
- auto myAttr = dynamic_cast( attribute );
- if ( myAttr )
+ if ( auto attrib = dynamic_cast( attribute ) )
{
- myAttr->validator = new ThicknessValidator();
- }
- }
- else if ( field == &m_lineThickness )
- {
- auto myAttr = dynamic_cast( attribute );
- if ( myAttr )
- {
- myAttr->validator = new RadiusValidator();
- }
- }
- else if ( field == &m_polygonPlaneDepth )
- {
- auto* attr = dynamic_cast( attribute );
-
- if ( attr )
- {
- if ( m_srcCase )
- {
- auto bb = m_srcCase->allCellsBoundingBox();
- attr->m_minimum = -bb.max().z();
- attr->m_maximum = -bb.min().z();
- }
- else
- {
- attr->m_minimum = 0;
- attr->m_maximum = 10000;
- }
+ attrib->m_buttonText = "Edit";
}
}
}
@@ -340,14 +236,12 @@ void RimPolygonFilter::defineEditorAttribute( const caf::PdmFieldHandle* field,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
-void RimPolygonFilter::defineCustomContextMenu( const caf::PdmFieldHandle* fieldNeedingMenu, QMenu* menu, QWidget* fieldEditorWidget )
+void RimPolygonFilter::childFieldChangedByUi( const caf::PdmFieldHandle* changedChildField )
{
- caf::CmdFeatureMenuBuilder menuBuilder;
+ // When interactive edit of polyline coordinates in enabled in RimPolygonInView::m_enablePicking, the editors to RimPolygonFilter must
+ // be updated to trigger calls to RimPolylinePickerInterface
- menuBuilder << "RicDeletePolylineTargetFeature";
- menuBuilder << "RicAppendPointsToPolygonFilterFeature";
-
- menuBuilder.appendToMenu( menu );
+ updateConnectedEditors();
}
//--------------------------------------------------------------------------------------------------
@@ -359,34 +253,26 @@ void RimPolygonFilter::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
auto group = uiOrdering.addNewGroup( "General" );
group->add( &m_filterMode );
+ group->add( &m_geometricalShape );
group->add( &m_enableFiltering );
- group->add( &m_closePolygon );
+ group->add( &m_polygonDataSource );
+ if ( !isPolygonDefinedLocally() )
+ {
+ group->add( &m_cellFilterPolygon );
+ group->add( &m_editPolygonButton, { .newRow = false } );
+ }
auto group1 = uiOrdering.addNewGroup( "Polygon Selection" );
group1->add( &m_polyFilterMode );
- if ( m_closePolygon() ) group1->add( &m_polyIncludeType );
- group1->add( &m_targets );
- group1->add( &m_enablePicking );
+
+ bool isPolygonClosed = m_cellFilterPolygon() ? m_cellFilterPolygon->isClosed() : false;
+ if ( isPolygonClosed )
+ {
+ group1->add( &m_polyIncludeType );
+ }
m_polyIncludeType.uiCapability()->setUiName( "Cells to " + modeString() );
- auto group2 = uiOrdering.addNewGroup( "Appearance" );
- group2->add( &m_showLines );
- group2->add( &m_showSpheres );
- if ( m_showLines )
- {
- group2->add( &m_lineThickness );
- group2->add( &m_lineColor );
- }
- if ( m_showSpheres )
- {
- group2->add( &m_sphereRadiusFactor );
- group2->add( &m_sphereColor );
- }
- group2->add( &m_lockPolygonToPlane );
- if ( m_lockPolygonToPlane ) group2->add( &m_polygonPlaneDepth );
- group2->setCollapsedByDefault();
-
auto group3 = uiOrdering.addNewGroup( "Advanced Filter Settings" );
group3->add( &m_enableKFilter );
group3->add( &m_kFilterStr );
@@ -402,7 +288,7 @@ void RimPolygonFilter::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
objField->uiCapability()->setUiReadOnly( readOnlyState );
}
- if ( !m_closePolygon() )
+ if ( !isPolygonClosed )
{
m_polyFilterMode = RimPolygonFilter::PolygonFilterModeType::INDEX_K;
m_polyFilterMode.uiCapability()->setUiReadOnly( true );
@@ -411,6 +297,30 @@ void RimPolygonFilter::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
{
m_polyFilterMode.uiCapability()->setUiReadOnly( readOnlyState );
}
+
+ if ( isPolygonDefinedLocally() )
+ {
+ caf::PdmUiGroup* polyDefinitionGroup = uiOrdering.addNewGroup( "Polygon Definition" );
+ m_polygonEditor()->uiOrderingForLocalPolygon( uiConfigName, *polyDefinitionGroup );
+
+ caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Appearance" );
+ appearanceGroup->setCollapsedByDefault();
+ m_internalPolygon->uiOrderingForLocalPolygon( uiConfigName, *appearanceGroup );
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+QList RimPolygonFilter::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
+{
+ QList options;
+ if ( fieldNeedingOptions == &m_cellFilterPolygon )
+ {
+ RimTools::polygonOptionItems( &options );
+ }
+
+ return options;
}
//--------------------------------------------------------------------------------------------------
@@ -418,20 +328,39 @@ void RimPolygonFilter::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
//--------------------------------------------------------------------------------------------------
void RimPolygonFilter::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
- if ( changedField == &m_enablePicking )
+ if ( changedField == &m_editPolygonButton )
{
- updateConnectedEditors();
+ RimPolygonTools::selectAndActivatePolygonInView( m_cellFilterPolygon(), this );
- enableFilter( !m_enablePicking() );
- filterChanged.send();
+ m_editPolygonButton = false;
+
+ return;
}
- else if ( ( changedField == &m_showLines ) || ( changedField == &m_showSpheres ) || ( changedField == &m_sphereColor ) ||
- ( changedField == &m_sphereRadiusFactor ) || ( changedField == &m_lineThickness ) || ( changedField == &m_lineColor ) ||
- ( changedField == &m_lockPolygonToPlane ) || ( changedField == &m_polygonPlaneDepth ) )
+
+ if ( changedField == &m_polygonDataSource )
{
- filterChanged.send();
+ if ( !isPolygonDefinedLocally() )
+ {
+ if ( m_cellFilterPolygon() == nullptr || m_cellFilterPolygon() == m_internalPolygon )
+ {
+ auto polygonCollection = RimTools::polygonCollection();
+ if ( polygonCollection && !polygonCollection->allPolygons().empty() )
+ {
+ m_cellFilterPolygon = polygonCollection->allPolygons().front();
+ }
+ }
+ }
+ configurePolygonEditor();
+ updateAllRequiredEditors();
}
- else if ( changedField != &m_name )
+
+ if ( changedField == &m_cellFilterPolygon )
+ {
+ configurePolygonEditor();
+ updateAllRequiredEditors();
+ }
+
+ if ( changedField != &m_name )
{
updateCells();
filterChanged.send();
@@ -444,26 +373,10 @@ void RimPolygonFilter::fieldChangedByUi( const caf::PdmFieldHandle* changedField
//--------------------------------------------------------------------------------------------------
void RimPolygonFilter::enablePicking( bool enable )
{
- m_enablePicking = enable;
+ m_polygonEditor->enablePicking( enable );
updateConnectedEditors();
}
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-bool RimPolygonFilter::pickingEnabled() const
-{
- return m_enablePicking();
-}
-
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-caf::PickEventHandler* RimPolygonFilter::pickEventHandler() const
-{
- return m_pickTargetsEventHandler.get();
-}
-
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -583,7 +496,7 @@ void RimPolygonFilter::updateCellsKIndexEclipse( const std::vector&
const int gIdx = static_cast( grid->gridIndex() );
std::list foundCells;
- const bool closedPolygon = m_closePolygon();
+ const bool closedPolygon = isPolygonClosed();
// find all cells in the K layer that matches the polygon
#pragma omp parallel for
@@ -591,8 +504,8 @@ void RimPolygonFilter::updateCellsKIndexEclipse( const std::vector&
{
for ( size_t j = 0; j < grid->cellCountJ(); j++ )
{
- size_t cellIdx = grid->cellIndexFromIJK( i, j, K );
- RigCell cell = grid->cell( cellIdx );
+ size_t cellIdx = grid->cellIndexFromIJK( i, j, K );
+ const RigCell& cell = grid->cell( cellIdx );
// valid cell?
if ( cell.isInvalid() ) continue;
@@ -634,7 +547,7 @@ void RimPolygonFilter::updateCellsKIndexEclipse( const std::vector&
// get the cell index
size_t newIdx = grid->cellIndexFromIJK( ci, cj, k );
// valid cell?
- RigCell cell = grid->cell( newIdx );
+ const RigCell& cell = grid->cell( newIdx );
if ( cell.isInvalid() ) continue;
m_cells[gIdx].push_back( newIdx );
@@ -652,7 +565,7 @@ void RimPolygonFilter::updateCellsForEclipse( const std::vector& poi
if ( m_polyFilterMode == PolygonFilterModeType::DEPTH_Z )
{
- if ( !m_closePolygon() ) return;
+ if ( !isPolygonClosed() ) return;
for ( size_t gridIndex = 0; gridIndex < data->gridCount(); gridIndex++ )
{
@@ -720,7 +633,7 @@ void RimPolygonFilter::updateCellsDepthGeoMech( const std::vector& p
//--------------------------------------------------------------------------------------------------
void RimPolygonFilter::updateCellsKIndexGeoMech( const std::vector& points, const RigFemPartGrid* grid, int partId )
{
- const bool closedPolygon = m_closePolygon();
+ const bool closedPolygon = isPolygonClosed();
// we need to find the K layer we hit with the first point
size_t nk;
@@ -839,7 +752,7 @@ void RimPolygonFilter::updateCellsForGeoMech( const std::vector& poi
if ( m_polyFilterMode == PolygonFilterModeType::DEPTH_Z )
{
- if ( m_closePolygon() )
+ if ( isPolygonClosed() )
{
updateCellsDepthGeoMech( points, grid, i );
}
@@ -865,16 +778,17 @@ void RimPolygonFilter::updateCells()
// get polyline as vector
std::vector points;
- for ( auto& target : m_targets )
+
+ if ( m_polygonEditor && m_polygonEditor->polygon() )
{
- if ( target->isEnabled() ) points.push_back( target->targetPointXYZ() );
+ points = m_polygonEditor->polygon()->pointsInDomainCoords();
}
// We need at least three points to make a closed polygon, or just 2 for a polyline
- if ( ( !m_closePolygon() && ( points.size() < 2 ) ) || ( m_closePolygon() && ( points.size() < 3 ) ) ) return;
+ if ( ( !isPolygonClosed() && ( points.size() < 2 ) ) || ( isPolygonClosed() && ( points.size() < 3 ) ) ) return;
// make sure first and last point is the same (req. by closed polygon methods used later)
- if ( m_closePolygon() ) points.push_back( points.front() );
+ if ( isPolygonClosed() ) points.push_back( points.front() );
RimEclipseCase* eCase = eclipseCase();
RimGeoMechCase* gCase = geoMechCase();
@@ -892,30 +806,119 @@ void RimPolygonFilter::updateCells()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
-cvf::ref RimPolygonFilter::polyLinesData() const
+void RimPolygonFilter::configurePolygonEditor()
{
- cvf::ref pld = new RigPolyLinesData;
- std::vector line;
- for ( const RimPolylineTarget* target : m_targets )
- {
- if ( target->isEnabled() ) line.push_back( target->targetPointXYZ() );
- }
- pld->setPolyLine( line );
+ RimPolygon* polygon = nullptr;
+ if ( isPolygonDefinedLocally() )
+ polygon = m_internalPolygon();
+ else
+ polygon = m_cellFilterPolygon();
- pld->setLineAppearance( m_lineThickness, m_lineColor, m_closePolygon );
- pld->setSphereAppearance( m_sphereRadiusFactor, m_sphereColor );
- pld->setZPlaneLock( m_lockPolygonToPlane, -m_polygonPlaneDepth );
+ m_polygonEditor->setPolygon( polygon );
- if ( isActive() )
+ // Must connect the signals after polygon is assigned to the polygon editor
+ // When assigning an object to a ptr field, all signals are disconnected
+ connectObjectSignals( polygon );
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+RimPolygonInView* RimPolygonFilter::polygonInView() const
+{
+ return m_polygonEditor();
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimPolygonFilter::insertTarget( const RimPolylineTarget* targetToInsertBefore, RimPolylineTarget* targetToInsert )
+{
+ m_polygonEditor->insertTarget( targetToInsertBefore, targetToInsert );
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimPolygonFilter::deleteTarget( RimPolylineTarget* targetToDelete )
+{
+ m_polygonEditor->deleteTarget( targetToDelete );
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimPolygonFilter::updateEditorsAndVisualization()
+{
+ updateConnectedEditors();
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimPolygonFilter::updateVisualization()
+{
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+std::vector RimPolygonFilter::activeTargets() const
+{
+ return m_polygonEditor->activeTargets();
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+bool RimPolygonFilter::pickingEnabled() const
+{
+ return m_polygonEditor->pickingEnabled();
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+caf::PickEventHandler* RimPolygonFilter::pickEventHandler() const
+{
+ auto filterColl = firstAncestorOfType();
+ if ( filterColl && !filterColl->isActive() ) return nullptr;
+
+ if ( !isActive() ) return nullptr;
+
+ return m_pickTargetsEventHandler.get();
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+caf::AppEnum RimPolygonFilter::geometricalShape() const
+{
+ if ( isPolygonDefinedLocally() )
{
- pld->setVisibility( m_showLines, m_showSpheres );
+ if ( !m_internalPolygon->isClosed() ) return GeometricalShape::LINE;
}
else
{
- pld->setVisibility( false, false );
+ if ( m_cellFilterPolygon && !m_cellFilterPolygon->isClosed() ) return GeometricalShape::LINE;
}
- return pld;
+ return GeometricalShape::AREA;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimPolygonFilter::setGeometricalShape( const caf::AppEnum& shape )
+{
+ if ( isPolygonDefinedLocally() )
+ {
+ m_internalPolygon->setIsClosed( shape == GeometricalShape::AREA );
+ }
+ else if ( m_cellFilterPolygon() )
+ {
+ m_cellFilterPolygon->setIsClosed( shape == GeometricalShape::AREA );
+ }
}
//--------------------------------------------------------------------------------------------------
@@ -932,6 +935,53 @@ void RimPolygonFilter::initializeCellList()
}
}
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+bool RimPolygonFilter::isPolygonClosed() const
+{
+ if ( isPolygonDefinedLocally() ) return m_internalPolygon->isClosed();
+
+ if ( m_cellFilterPolygon() ) return m_cellFilterPolygon->isClosed();
+
+ return true;
+}
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+bool RimPolygonFilter::isPolygonDefinedLocally() const
+{
+ return m_polygonDataSource() == PolygonDataSource::DEFINED_IN_FILTER;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimPolygonFilter::connectObjectSignals( RimPolygon* polygon )
+{
+ if ( m_cellFilterPolygon() )
+ {
+ m_cellFilterPolygon()->objectChanged.disconnect( this );
+ }
+
+ if ( polygon )
+ {
+ m_cellFilterPolygon = polygon;
+
+ polygon->objectChanged.connect( this, &RimPolygonFilter::onObjectChanged );
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimPolygonFilter::onObjectChanged( const caf::SignalEmitter* emitter )
+{
+ updateCells();
+ filterChanged.send();
+ updateIconState();
+}
+
//--------------------------------------------------------------------------------------------------
/// Find which K layer we hit, in any of the grids, for any of the selected points
//--------------------------------------------------------------------------------------------------
diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.h b/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.h
index 94018cf843..52e82a064f 100644
--- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.h
+++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.h
@@ -21,42 +21,42 @@
#include "RimCellFilter.h"
#include "RimCellFilterIntervalTool.h"
#include "RimPolylinePickerInterface.h"
-#include "RimPolylinesDataInterface.h"
#include "cafAppEnum.h"
#include "cafPdmChildArrayField.h"
-#include "cafPdmField.h"
-#include "cafPdmFieldCvfColor.h"
-#include "cafPdmFieldCvfVec3d.h"
+#include "cafPdmChildField.h"
#include "cafPdmObject.h"
#include "cafPdmPtrField.h"
-#include "cafPickEventHandler.h"
-#include "cvfColor3.h"
-
-#include
-#include
-
-class RicPolylineTargetsPickEventHandler;
+class RimPolygon;
class RimPolylineTarget;
-class RimCase;
-class RimEclipseCase;
-class RimGeoMechCase;
class RigGridBase;
-class RigMainGrid;
class RigFemPartGrid;
-class RigPolylinesData;
+class RimPolygonInView;
class RigEclipseCaseData;
+class RicPolylineTargetsPickEventHandler;
//==================================================================================================
///
///
//==================================================================================================
-class RimPolygonFilter : public RimCellFilter, public RimPolylinePickerInterface, public RimPolylinesDataInterface
+class RimPolygonFilter : public RimCellFilter, public RimPolylinePickerInterface
{
CAF_PDM_HEADER_INIT;
public:
+ enum class PolygonDataSource
+ {
+ DEFINED_IN_FILTER,
+ GLOBAL_POLYGON
+ };
+
+ enum class GeometricalShape
+ {
+ AREA,
+ LINE
+ };
+
enum class PolygonFilterModeType
{
DEPTH_Z,
@@ -71,38 +71,32 @@ public:
};
RimPolygonFilter();
- ~RimPolygonFilter() override;
void enableFilter( bool bEnable );
void enableKFilter( bool bEnable );
+ void setPolygon( RimPolygon* polygon );
bool isFilterEnabled() const override;
- void updateVisualization() override;
- void updateEditorsAndVisualization() override;
- void insertTarget( const RimPolylineTarget* targetToInsertBefore, RimPolylineTarget* targetToInsert ) override;
- void deleteTarget( RimPolylineTarget* targetToDelete ) override;
void enablePicking( bool enable );
- std::vector activeTargets() const override;
- bool pickingEnabled() const override;
- caf::PickEventHandler* pickEventHandler() const override;
-
void updateCellIndexFilter( cvf::UByteArray* includeVisibility, cvf::UByteArray* excludeVisibility, int gridIndex ) override;
void onGridChanged() override;
- cvf::ref polyLinesData() const override;
+ void configurePolygonEditor();
+ RimPolygonInView* polygonInView() const;
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
+ QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
+ void initAfterRead() override;
+ void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
+ void childFieldChangedByUi( const caf::PdmFieldHandle* changedChildField ) override;
QString fullName() const override;
private:
- void defineCustomContextMenu( const caf::PdmFieldHandle* fieldNeedingMenu, QMenu* menu, QWidget* fieldEditorWidget ) override;
- void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
-
void updateCells();
void updateCellsForEclipse( const std::vector& points, RimEclipseCase* eCase );
void updateCellsForGeoMech( const std::vector& points, RimGeoMechCase* gCase );
@@ -118,26 +112,45 @@ private:
void initializeCellList();
- caf::PdmField m_enablePicking;
- caf::PdmChildArrayField m_targets;
- caf::PdmField> m_polyFilterMode;
- caf::PdmField> m_polyIncludeType;
- caf::PdmField m_enableFiltering;
- caf::PdmField m_showLines;
- caf::PdmField m_showSpheres;
- caf::PdmField m_lineThickness;
- caf::PdmField m_sphereRadiusFactor;
- caf::PdmField m_lineColor;
- caf::PdmField m_sphereColor;
- caf::PdmField m_polygonPlaneDepth;
- caf::PdmField m_lockPolygonToPlane;
- caf::PdmField m_enableKFilter;
- caf::PdmField m_kFilterStr;
- caf::PdmField m_closePolygon;
+ bool isPolygonClosed() const;
+ bool isPolygonDefinedLocally() const;
- std::shared_ptr m_pickTargetsEventHandler;
+ void connectObjectSignals( RimPolygon* polygon );
+ void onObjectChanged( const caf::SignalEmitter* emitter );
+
+ // RimPolylinePickerInterface used to forward events to m_polygonEditor
+ void insertTarget( const RimPolylineTarget* targetToInsertBefore, RimPolylineTarget* targetToInsert ) override;
+ void deleteTarget( RimPolylineTarget* targetToDelete ) override;
+ void updateEditorsAndVisualization() override;
+ void updateVisualization() override;
+ std::vector activeTargets() const override;
+ bool pickingEnabled() const override;
+ caf::PickEventHandler* pickEventHandler() const override;
+
+ caf::AppEnum geometricalShape() const;
+ void setGeometricalShape( const caf::AppEnum& shape );
+
+private:
+ caf::PdmField> m_polyFilterMode;
+ caf::PdmField> m_polyIncludeType;
+ caf::PdmField> m_polygonDataSource;
+ caf::PdmProxyValueField> m_geometricalShape;
+
+ caf::PdmField m_enableFiltering;
+ caf::PdmField m_enableKFilter;
+ caf::PdmField m_kFilterStr;
std::vector> m_cells;
RimCellFilterIntervalTool m_intervalTool;
+
+ // Local polygon and polygon editor
+ caf::PdmPtrField m_cellFilterPolygon;
+ caf::PdmChildField m_internalPolygon;
+ caf::PdmChildField m_polygonEditor;
+ caf::PdmField m_editPolygonButton;
+
+ std::shared_ptr m_pickTargetsEventHandler;
+
+ caf::PdmChildArrayField m_OBSOLETE_targets;
};
diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplate.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplate.cpp
index 763837ea6c..2083b5811e 100644
--- a/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplate.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplate.cpp
@@ -210,9 +210,7 @@ RimFractureTemplate::RimFractureTemplate()
"" );
CAF_PDM_InitField( &m_scaleApplyButton, "ScaleApplyButton", false, "Apply" );
- m_scaleApplyButton.xmlCapability()->disableIO();
- m_scaleApplyButton.uiCapability()->setUiEditorTypeName( caf::PdmUiPushButtonEditor::uiEditorTypeName() );
- m_scaleApplyButton.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
+ caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_scaleApplyButton );
}
//--------------------------------------------------------------------------------------------------
diff --git a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.cpp b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.cpp
index a4b69ec1a4..fbea61f87b 100644
--- a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.cpp
+++ b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.cpp
@@ -66,8 +66,7 @@ RimAbstractCorrelationPlot::RimAbstractCorrelationPlot()
m_dataSources.uiCapability()->setUiTreeChildrenHidden( true );
CAF_PDM_InitFieldNoDefault( &m_pushButtonSelectSummaryAddress, "SelectAddress", "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_pushButtonSelectSummaryAddress );
- m_pushButtonSelectSummaryAddress.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
+ caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_pushButtonSelectSummaryAddress );
m_pushButtonSelectSummaryAddress = false;
CAF_PDM_InitFieldNoDefault( &m_timeStepFilter, "TimeStepFilter", "Available Time Steps" );
diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorTemperature.cpp b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorTemperature.cpp
index 7dbbdf3525..be16499b68 100644
--- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorTemperature.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorTemperature.cpp
@@ -17,6 +17,7 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RimFaultReactivationDataAccessorTemperature.h"
+#include "RigFaultReactivationModel.h"
#include "RimFaultReactivationEnums.h"
#include "RiaDefines.h"
@@ -74,10 +75,55 @@ void RimFaultReactivationDataAccessorTemperature::updateResultAccessor()
m_resultAccessor =
RigResultAccessorFactory::createFromResultAddress( m_caseData, 0, RiaDefines::PorosityModelType::MATRIX_MODEL, m_timeStep, resVarAddress );
- auto [wellPaths, extractors] =
- RimFaultReactivationDataAccessorWellLogExtraction::createEclipseWellPathExtractors( *m_model, *m_caseData, m_seabedDepth );
- m_wellPaths = wellPaths;
- m_extractors = extractors;
+ if ( m_resultAccessor.notNull() )
+ {
+ auto [wellPaths, extractors] =
+ RimFaultReactivationDataAccessorWellLogExtraction::createEclipseWellPathExtractors( *m_model, *m_caseData, m_seabedDepth );
+ m_wellPaths = wellPaths;
+ m_extractors = extractors;
+
+ m_gradient = computeGradient();
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+/// Find the top encounter with reservoir (of the two well paths), and create gradient from that point
+//--------------------------------------------------------------------------------------------------
+double RimFaultReactivationDataAccessorTemperature::computeGradient() const
+{
+ double gradient = std::numeric_limits::infinity();
+ double minDepth = -std::numeric_limits::max();
+ for ( auto gridPart : m_model->allGridParts() )
+ {
+ auto extractor = m_extractors.find( gridPart )->second;
+ auto wellPath = m_wellPaths.find( gridPart )->second;
+
+ auto [values, intersections] =
+ RimFaultReactivationDataAccessorWellLogExtraction::extractValuesAndIntersections( *m_resultAccessor.p(), *extractor.p(), *wellPath );
+
+ int lastOverburdenIndex = RimFaultReactivationDataAccessorWellLogExtraction::findLastOverburdenIndex( values );
+ if ( lastOverburdenIndex != -1 )
+ {
+ double depth = intersections[lastOverburdenIndex].z();
+ double value = values[lastOverburdenIndex];
+
+ if ( !std::isinf( value ) )
+ {
+ double currentGradient =
+ RimFaultReactivationDataAccessorWellLogExtraction::computeGradient( intersections[0].z(),
+ m_seabedTemperature,
+ intersections[lastOverburdenIndex].z(),
+ values[lastOverburdenIndex] );
+ if ( !std::isinf( value ) && !std::isnan( currentGradient ) && depth > minDepth )
+ {
+ gradient = currentGradient;
+ minDepth = depth;
+ }
+ }
+ }
+ }
+
+ return gradient;
}
//--------------------------------------------------------------------------------------------------
@@ -100,6 +146,13 @@ double RimFaultReactivationDataAccessorTemperature::valueAtPosition( const cvf::
{
if ( ( m_mainGrid != nullptr ) && m_resultAccessor.notNull() )
{
+ auto cellIdx = m_mainGrid->findReservoirCellIndexFromPoint( position );
+ if ( cellIdx != cvf::UNDEFINED_SIZE_T )
+ {
+ double tempFromEclipse = m_resultAccessor->cellScalar( cellIdx );
+ if ( !std::isinf( tempFromEclipse ) ) return tempFromEclipse;
+ }
+
CAF_ASSERT( m_extractors.find( gridPart ) != m_extractors.end() );
auto extractor = m_extractors.find( gridPart )->second;
@@ -110,16 +163,7 @@ double RimFaultReactivationDataAccessorTemperature::valueAtPosition( const cvf::
RimFaultReactivationDataAccessorWellLogExtraction::extractValuesAndIntersections( *m_resultAccessor.p(), *extractor.p(), *wellPath );
auto [value, pos] =
- RimFaultReactivationDataAccessorWellLogExtraction::calculateTemperature( intersections, values, position, m_seabedTemperature );
- if ( pos.isUndefined() )
- {
- auto cellIdx = m_mainGrid->findReservoirCellIndexFromPoint( position );
- if ( cellIdx != cvf::UNDEFINED_SIZE_T )
- {
- double tempFromEclipse = m_resultAccessor->cellScalar( cellIdx );
- if ( !std::isinf( tempFromEclipse ) ) return tempFromEclipse;
- }
- }
+ RimFaultReactivationDataAccessorWellLogExtraction::calculateTemperature( intersections, position, m_seabedTemperature, m_gradient );
return value;
}
diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorTemperature.h b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorTemperature.h
index 058d23cdba..d8b5b1fce0 100644
--- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorTemperature.h
+++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorTemperature.h
@@ -51,13 +51,15 @@ public:
size_t elementIndex = std::numeric_limits::max() ) const override;
private:
- void updateResultAccessor() override;
+ void updateResultAccessor() override;
+ double computeGradient() const;
RimEclipseCase* m_eclipseCase;
RigEclipseCaseData* m_caseData;
const RigMainGrid* m_mainGrid;
double m_seabedTemperature;
double m_seabedDepth;
+ double m_gradient;
cvf::ref m_resultAccessor;
diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorWellLogExtraction.cpp b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorWellLogExtraction.cpp
index b9779af1d4..a126f1087b 100644
--- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorWellLogExtraction.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorWellLogExtraction.cpp
@@ -96,23 +96,11 @@ std::pair RimFaultReactivationDataAccessorWellLogExtraction:
//--------------------------------------------------------------------------------------------------
std::pair
RimFaultReactivationDataAccessorWellLogExtraction::calculateTemperature( const std::vector& intersections,
- std::vector& values,
const cvf::Vec3d& position,
- double seabedTemperature )
+ double seabedTemperature,
+ double gradient )
{
- // Fill in missing values
- fillInMissingValuesWithTopValue( intersections, values, seabedTemperature );
- auto [value, extractionPosition] = findValueAndPosition( intersections, values, position );
-
- double minDistance = computeMinimumDistance( position, intersections );
- if ( minDistance < 1.0 )
- {
- return { value, extractionPosition };
- }
- else
- {
- return { value, cvf::Vec3d::UNDEFINED };
- }
+ return { calculateTemperature( seabedTemperature, intersections[0].z(), std::abs( position.z() ), gradient ), position };
}
//--------------------------------------------------------------------------------------------------
@@ -182,16 +170,6 @@ std::pair RimFaultReactivationDataAccessorWellLogExtraction::findInter
//--------------------------------------------------------------------------------------------------
std::pair RimFaultReactivationDataAccessorWellLogExtraction::findOverburdenAndUnderburdenIndex( const std::vector& values )
{
- auto findLastOverburdenIndex = []( const std::vector& values )
- {
- for ( size_t i = 0; i < values.size(); i++ )
- {
- if ( !std::isinf( values[i] ) ) return static_cast( i );
- }
-
- return -1;
- };
-
auto findFirstUnderburdenIndex = []( const std::vector& values )
{
for ( size_t i = values.size() - 1; i > 0; i-- )
@@ -207,6 +185,19 @@ std::pair RimFaultReactivationDataAccessorWellLogExtraction::findOverb
return { lastOverburdenIndex, firstUnderburdenIndex };
}
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+int RimFaultReactivationDataAccessorWellLogExtraction::findLastOverburdenIndex( const std::vector& values )
+{
+ for ( size_t i = 0; i < values.size(); i++ )
+ {
+ if ( !std::isinf( values[i] ) ) return static_cast( i );
+ }
+
+ return -1;
+}
+
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -481,3 +472,12 @@ double RimFaultReactivationDataAccessorWellLogExtraction::calculatePorePressure(
{
return RiaEclipseUnitTools::pascalToBar( gradient * 9.81 * depth * 1000.0 );
}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+double RimFaultReactivationDataAccessorWellLogExtraction::calculateTemperature( double topValue, double topDepth, double depth, double gradient )
+{
+ double tvdDiff = topDepth - depth;
+ return tvdDiff * gradient + topValue;
+}
diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorWellLogExtraction.h b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorWellLogExtraction.h
index 4d840b492d..489309cb68 100644
--- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorWellLogExtraction.h
+++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorWellLogExtraction.h
@@ -51,9 +51,9 @@ public:
double gradient );
static std::pair calculateTemperature( const std::vector& intersections,
- std::vector& values,
const cvf::Vec3d& position,
- double seabedTemperature );
+ double seabedTemperature,
+ double gradient );
static std::pair>,
std::map>>
createEclipseWellPathExtractors( const RigFaultReactivationModel& model, RigEclipseCaseData& eclipseCaseData, double seabedDepth );
@@ -76,6 +76,10 @@ public:
const cvf::Vec3d& point,
const std::map>& elementSets );
+ static int findLastOverburdenIndex( const std::vector& values );
+
+ static double computeGradient( double depth1, double value1, double depth2, double value2 );
+
protected:
static std::pair findOverburdenAndUnderburdenIndex( const std::vector& values );
static double computeValueWithGradient( const std::vector& intersections,
@@ -89,7 +93,6 @@ protected:
static std::pair
findValueAndPosition( const std::vector& intersections, const std::vector& values, const cvf::Vec3d& position );
- static double computeGradient( double depth1, double value1, double depth2, double value2 );
static std::vector extractDepthValues( const std::vector& intersections );
static void insertUnderburdenValues( const std::vector& intersections,
@@ -103,4 +106,5 @@ protected:
static double computeMinimumDistance( const cvf::Vec3d& position, const std::vector& positions );
static double calculatePorePressure( double depth, double gradient );
+ static double calculateTemperature( double topValue, double topDepth, double depth, double gradient );
};
diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.cpp b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.cpp
index e0e552bc72..67c3427332 100644
--- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.cpp
@@ -99,8 +99,6 @@ RimFaultReactivationModel::RimFaultReactivationModel()
CAF_PDM_InitField( &m_faultZoneCells, "FaultZoneCells", 0, "Fault Zone Width [cells]" );
CAF_PDM_InitField( &m_showModelPlane, "ShowModelPlane", true, "Show 2D Model" );
- CAF_PDM_InitField( &m_flipNodeOrderFW, "FlipNodeOrderFW", false, "FW: Flip Node Order" );
- CAF_PDM_InitField( &m_flipNodeOrderHW, "FlipNodeOrderHW", false, "HW: Flip Node Order" );
CAF_PDM_InitFieldNoDefault( &m_fault, "Fault", "Fault" );
m_fault.uiCapability()->setUiReadOnly( true );
@@ -344,7 +342,6 @@ void RimFaultReactivationModel::updateVisualization()
m_2Dmodel->setGenerator( generator );
m_2Dmodel->updateGeometry( m_startCellIndex, (cvf::StructGridInterface::FaceType)m_startCellFace() );
m_2Dmodel->postProcessElementSets( eclipseCase() );
- m_2Dmodel->flipNodeOrder( m_flipNodeOrderFW, m_flipNodeOrderHW );
view->scheduleCreateDisplayModelAndRedraw();
}
@@ -475,9 +472,6 @@ void RimFaultReactivationModel::defineUiOrdering( QString uiConfigName, caf::Pdm
gridModelGrp->add( &m_modelThickness );
- gridModelGrp->add( &m_flipNodeOrderFW );
- gridModelGrp->add( &m_flipNodeOrderHW );
-
auto appModelGrp = modelGrp->addNewGroup( "Appearance" );
appModelGrp->setCollapsedByDefault();
appModelGrp->add( &m_modelPart1Color );
@@ -741,9 +735,9 @@ std::string RimFaultReactivationModel::baseFilePath() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
-std::array RimFaultReactivationModel::materialParameters( ElementSets elementSet ) const
+std::array RimFaultReactivationModel::materialParameters( ElementSets elementSet ) const
{
- std::array retVal = { 0.0, 0.0, 0.0 };
+ std::array retVal = { 0.0, 0.0, 0.0, 0.0 };
static std::map groupMap = { { ElementSets::OverBurden, "material_overburden" },
{ ElementSets::Reservoir, "material_reservoir" },
{ ElementSets::IntraReservoir, "material_intrareservoir" },
@@ -759,6 +753,7 @@ std::array RimFaultReactivationModel::materialParameters( ElementSets
retVal[0] = grp->parameterDoubleValue( "youngs_modulus", 0.0 );
retVal[1] = grp->parameterDoubleValue( "poissons_number", 0.0 );
retVal[2] = grp->parameterDoubleValue( "density", 0.0 );
+ retVal[3] = grp->parameterDoubleValue( "expansion", 0.0 );
break;
}
diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.h b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.h
index 846e6d666f..00de04def1 100644
--- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.h
+++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.h
@@ -107,7 +107,7 @@ public:
std::vector selectedTimeSteps() const;
std::vector selectedTimeStepIndexes() const;
- std::array materialParameters( ElementSets elementSet ) const;
+ std::array materialParameters( ElementSets elementSet ) const;
QStringList commandParameters() const;
@@ -162,8 +162,6 @@ private:
caf::PdmField m_modelPart2Color;
caf::PdmField m_showModelPlane;
- caf::PdmField m_flipNodeOrderFW;
- caf::PdmField m_flipNodeOrderHW;
caf::PdmField m_modelExtentFromAnchor;
caf::PdmField m_modelMinZ;
diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp
index 0313cd03a2..805a5dde6e 100644
--- a/ApplicationLibCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp
@@ -78,7 +78,7 @@ RimFlowCharacteristicsPlot::RimFlowCharacteristicsPlot()
m_selectedTimeSteps.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_selectedTimeStepsUi, "SelectedTimeStepsUi", "" );
CAF_PDM_InitFieldNoDefault( &m_applyTimeSteps, "ApplyTimeSteps", "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_applyTimeSteps );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_applyTimeSteps );
CAF_PDM_InitField( &m_maxPvFraction,
"CellPVThreshold",
@@ -97,7 +97,7 @@ RimFlowCharacteristicsPlot::RimFlowCharacteristicsPlot()
CAF_PDM_InitField( &m_tracerFilter, "TracerFilter", QString(), "Tracer Filter" );
CAF_PDM_InitFieldNoDefault( &m_selectedTracerNames, "SelectedTracerNames", " " );
CAF_PDM_InitFieldNoDefault( &m_showRegion, "ShowRegion", "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_showRegion );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_showRegion );
CAF_PDM_InitField( &m_minCommunication, "MinCommunication", 0.0, "Min Communication" );
CAF_PDM_InitField( &m_maxTof, "MaxTof", 146000, "Max Time of Flight [days]" );
diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.cpp
index 39d18ae5d4..9d2669b88a 100644
--- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.cpp
@@ -116,7 +116,7 @@ RimWellAllocationOverTimePlot::RimWellAllocationOverTimePlot()
CAF_PDM_InitFieldNoDefault( &m_excludeTimeSteps, "ExcludeTimeSteps", "" );
m_excludeTimeSteps.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
CAF_PDM_InitFieldNoDefault( &m_applyTimeStepSelections, "ApplyTimeStepSelections", "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_applyTimeStepSelections );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_applyTimeStepSelections );
CAF_PDM_InitFieldNoDefault( &m_flowDiagSolution, "FlowDiagSolution", "Plot Type" );
CAF_PDM_InitFieldNoDefault( &m_flowValueType, "FlowValueType", "Value Type" );
diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellConnectivityTable.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellConnectivityTable.cpp
index 12bbbbe8be..2788a18535 100644
--- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellConnectivityTable.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellConnectivityTable.cpp
@@ -157,7 +157,7 @@ RimWellConnectivityTable::RimWellConnectivityTable()
CAF_PDM_InitFieldNoDefault( &m_excludeTimeSteps, "ExcludeTimeSteps", "" );
m_excludeTimeSteps.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
CAF_PDM_InitFieldNoDefault( &m_applyTimeStepSelections, "ApplyTimeStepSelections", "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_applyTimeStepSelections );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_applyTimeStepSelections );
// Producer/Injector tracer configuration
CAF_PDM_InitFieldNoDefault( &m_selectedProducerTracersUiField, "SelectedProducerTracers", "Producer Tracers" );
@@ -169,7 +169,7 @@ RimWellConnectivityTable::RimWellConnectivityTable()
CAF_PDM_InitField( &m_syncSelectedProducersFromInjectorSelection, "SyncSelectedInjProd", false, "<- Synch Communicators" );
m_syncSelectedProducersFromInjectorSelection.uiCapability()->setUiEditorTypeName( caf::PdmUiToolButtonEditor::uiEditorTypeName() );
CAF_PDM_InitFieldNoDefault( &m_applySelectedInectorProducerTracers, "ApplySelectedInectorProducerTracers", "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_applySelectedInectorProducerTracers );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_applySelectedInectorProducerTracers );
// Table settings
CAF_PDM_InitField( &m_showValueLabels, "ShowValueLabels", false, "Show Value Labels" );
diff --git a/ApplicationLibCode/ProjectDataModel/GeoMech/RimGeoMechCase.cpp b/ApplicationLibCode/ProjectDataModel/GeoMech/RimGeoMechCase.cpp
index 3f68d3f34e..8c75cd8aa2 100644
--- a/ApplicationLibCode/ProjectDataModel/GeoMech/RimGeoMechCase.cpp
+++ b/ApplicationLibCode/ProjectDataModel/GeoMech/RimGeoMechCase.cpp
@@ -116,13 +116,13 @@ RimGeoMechCase::RimGeoMechCase()
m_elementPropertyFileNameIndexUiSelection.xmlCapability()->disableIO();
CAF_PDM_InitField( &m_importElementPropertyFileCommand, "importElementPropertyFileCommad", false, "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_importElementPropertyFileCommand );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_importElementPropertyFileCommand );
CAF_PDM_InitField( &m_closeElementPropertyFileCommand, "closeElementPropertyFileCommad", false, "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_closeElementPropertyFileCommand );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_closeElementPropertyFileCommand );
CAF_PDM_InitField( &m_reloadElementPropertyFileCommand, "reloadElementPropertyFileCommand", false, "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_reloadElementPropertyFileCommand );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_reloadElementPropertyFileCommand );
caf::AppEnum defaultBiotCoefficientType = RimGeoMechCase::BiotCoefficientType::BIOT_NONE;
CAF_PDM_InitField( &m_biotCoefficientType, "BiotCoefficientType", defaultBiotCoefficientType, "Biot Coefficient" );
diff --git a/ApplicationLibCode/ProjectDataModel/GeoMech/RimGeoMechFaultReactivationResult.cpp b/ApplicationLibCode/ProjectDataModel/GeoMech/RimGeoMechFaultReactivationResult.cpp
index e4e6570253..511c115e5c 100644
--- a/ApplicationLibCode/ProjectDataModel/GeoMech/RimGeoMechFaultReactivationResult.cpp
+++ b/ApplicationLibCode/ProjectDataModel/GeoMech/RimGeoMechFaultReactivationResult.cpp
@@ -74,7 +74,7 @@ RimGeoMechFaultReactivationResult::RimGeoMechFaultReactivationResult()
CAF_PDM_InitField( &m_distanceFromFault, "DistanceFromFault", 5.0, "Distance From Fault" );
CAF_PDM_InitFieldNoDefault( &m_createFaultReactivationPlot, "CreateReactivationPlot", "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_createFaultReactivationPlot );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_createFaultReactivationPlot );
CAF_PDM_InitFieldNoDefault( &m_faultNormal, "FaultNormal", "" );
CAF_PDM_InitFieldNoDefault( &m_faultTopPosition, "FaultTopPosition", "" );
diff --git a/ApplicationLibCode/ProjectDataModel/GeoMech/RimGeoMechView.cpp b/ApplicationLibCode/ProjectDataModel/GeoMech/RimGeoMechView.cpp
index 7ff399e36a..d94b027858 100644
--- a/ApplicationLibCode/ProjectDataModel/GeoMech/RimGeoMechView.cpp
+++ b/ApplicationLibCode/ProjectDataModel/GeoMech/RimGeoMechView.cpp
@@ -19,6 +19,7 @@
#include "RimGeoMechView.h"
+#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiaRegressionTestRunner.h"
@@ -31,6 +32,7 @@
#include "RigFormationNames.h"
#include "RigGeoMechCaseData.h"
+#include "Polygons/RimPolygonInViewCollection.h"
#include "Rim3dOverlayInfoConfig.h"
#include "RimCellFilterCollection.h"
#include "RimEclipseResultDefinition.h"
@@ -153,7 +155,7 @@ void RimGeoMechView::onLoadDataAndUpdate()
onUpdateScaleTransform();
- updateSurfacesInViewTreeItems();
+ updateViewTreeItems( RiaDefines::ItemIn3dView::ALL );
if ( m_geomechCase )
{
@@ -319,6 +321,9 @@ void RimGeoMechView::onCreateDisplayModel()
m_seismicSectionCollection->appendPartsToModel( this, m_seismicVizModel.p(), transform.p(), femBBox );
nativeOrOverrideViewer()->addStaticModelOnce( m_seismicVizModel.p(), isUsingOverrideViewer() );
+ // Polygons
+ appendPolygonPartsToModel( transform.p(), ownerCase()->allCellsBoundingBox() );
+
// Surfaces
m_surfaceVizModel->removeAllParts();
@@ -1043,6 +1048,11 @@ void RimGeoMechView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin
if ( surfaceInViewCollection() ) uiTreeOrdering.add( surfaceInViewCollection() );
if ( seismicSectionCollection()->shouldBeVisibleInTree() ) uiTreeOrdering.add( seismicSectionCollection() );
+ if ( RiaApplication::enableDevelopmentFeatures() )
+ {
+ uiTreeOrdering.add( m_polygonInViewCollection );
+ }
+
uiTreeOrdering.skipRemainingChildren( true );
}
diff --git a/ApplicationLibCode/ProjectDataModel/Intersections/RimBoxIntersection.cpp b/ApplicationLibCode/ProjectDataModel/Intersections/RimBoxIntersection.cpp
index 6cc32f71c3..3633f6a7f1 100644
--- a/ApplicationLibCode/ProjectDataModel/Intersections/RimBoxIntersection.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Intersections/RimBoxIntersection.cpp
@@ -91,7 +91,7 @@ RimBoxIntersection::RimBoxIntersection()
CAF_PDM_InitField( &m_depthSliderStepSize, "DepthSliderStepSize", 0.5, "Depth Slider Step Size" );
CAF_PDM_InitFieldNoDefault( &m_show3DManipulator, "show3DManipulator", "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_show3DManipulator );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_show3DManipulator );
m_show3DManipulator = false;
setDeletable( true );
diff --git a/ApplicationLibCode/ProjectDataModel/Intersections/RimExtrudedCurveIntersection.cpp b/ApplicationLibCode/ProjectDataModel/Intersections/RimExtrudedCurveIntersection.cpp
index bd3faab8f0..42fd132f98 100644
--- a/ApplicationLibCode/ProjectDataModel/Intersections/RimExtrudedCurveIntersection.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Intersections/RimExtrudedCurveIntersection.cpp
@@ -21,23 +21,20 @@
#include "RiaVec3Tools.h"
-#include "RigEclipseCaseData.h"
#include "RigMainGrid.h"
+#include "RigPolyLinesData.h"
#include "RigSimulationWellCenterLineCalculator.h"
#include "RigWellPath.h"
+#include "Polygons/RimPolygon.h"
+#include "Polygons/RimPolygonCollection.h"
+#include "Polygons/RimPolygonTools.h"
+
#include "Rim2dIntersectionView.h"
#include "Rim3dView.h"
#include "RimCase.h"
-#include "RimEclipseCase.h"
#include "RimEclipseView.h"
-#include "RimEnsembleSurface.h"
#include "RimGeoMechView.h"
-#include "RimGridView.h"
-#include "RimIntersectionResultDefinition.h"
-#include "RimIntersectionResultsDefinitionCollection.h"
-#include "RimOilField.h"
-#include "RimProject.h"
#include "RimSimWellInView.h"
#include "RimSimWellInViewCollection.h"
#include "RimSurface.h"
@@ -48,12 +45,8 @@
#include "RimTools.h"
#include "RimWellPath.h"
-#include "RiuViewer.h"
-
#include "RivExtrudedCurveIntersectionPartMgr.h"
-#include "cafCmdFeature.h"
-#include "cafCmdFeatureManager.h"
#include "cafPdmFieldScriptingCapability.h"
#include "cafPdmFieldScriptingCapabilityCvfVec3d.h"
#include "cafPdmObjectScriptingCapability.h"
@@ -61,12 +54,9 @@
#include "cafPdmUiDoubleSliderEditor.h"
#include "cafPdmUiListEditor.h"
#include "cafPdmUiPushButtonEditor.h"
-#include "cafPdmUiSliderEditor.h"
#include "cafPdmUiTreeOrdering.h"
-#include "cafPdmUiTreeSelectionEditor.h"
#include "cvfBoundingBox.h"
#include "cvfGeometryTools.h"
-#include "cvfPlane.h"
namespace caf
{
@@ -77,6 +67,7 @@ void caf::AppEnum::setUp()
addItem( RimExtrudedCurveIntersection::CrossSectionEnum::CS_SIMULATION_WELL, "CS_SIMULATION_WELL", "Simulation Well" );
addItem( RimExtrudedCurveIntersection::CrossSectionEnum::CS_POLYLINE, "CS_POLYLINE", "Polyline" );
addItem( RimExtrudedCurveIntersection::CrossSectionEnum::CS_AZIMUTHLINE, "CS_AZIMUTHLINE", "Azimuth and Dip" );
+ addItem( RimExtrudedCurveIntersection::CrossSectionEnum::CS_POLYGON, "CS_POLYGON", "Project Polygon" );
setDefault( RimExtrudedCurveIntersection::CrossSectionEnum::CS_POLYLINE );
}
@@ -186,6 +177,17 @@ void RimExtrudedCurveIntersection::configureForPolyLine()
m_inputPolylineFromViewerEnabled = true;
}
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimExtrudedCurveIntersection::configureForProjectPolyLine( RimPolygon* polygon )
+{
+ m_type = CrossSectionEnum::CS_POLYGON;
+ m_projectPolygon = polygon;
+
+ updateName();
+}
+
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -207,6 +209,11 @@ RimExtrudedCurveIntersection::RimExtrudedCurveIntersection()
CAF_PDM_InitFieldNoDefault( &m_direction, "Direction", "Direction" );
CAF_PDM_InitScriptableFieldNoDefault( &m_wellPath, "WellPath", "Well Path " );
CAF_PDM_InitScriptableFieldNoDefault( &m_simulationWell, "SimulationWell", "Simulation Well" );
+
+ CAF_PDM_InitFieldNoDefault( &m_projectPolygon, "ProjectPolygon", "Project Polygon" );
+ CAF_PDM_InitField( &m_editPolygonButton, "EditPolygonButton", false, "Edit" );
+ caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_editPolygonButton );
+
CAF_PDM_InitScriptableFieldNoDefault( &m_userPolylineXyz, "Points", "Points", "", "Use Ctrl-C for copy and Ctrl-V for paste", "" );
CAF_PDM_InitFieldNoDefault( &m_userPolylineXydForUi, "PointsUi", "Points", "", "Use Ctrl-C for copy and Ctrl-V for paste", "" );
@@ -233,15 +240,15 @@ RimExtrudedCurveIntersection::RimExtrudedCurveIntersection()
CAF_PDM_InitField( &m_lengthDown, "lengthDown", 1000.0, "Length Down" );
CAF_PDM_InitFieldNoDefault( &m_inputPolylineFromViewerEnabled, "m_activateUiAppendPointsCommand", "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_inputPolylineFromViewerEnabled );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_inputPolylineFromViewerEnabled );
m_inputPolylineFromViewerEnabled = false;
CAF_PDM_InitFieldNoDefault( &m_inputExtrusionPointsFromViewerEnabled, "inputExtrusionPointsFromViewerEnabled", "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_inputExtrusionPointsFromViewerEnabled );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_inputExtrusionPointsFromViewerEnabled );
m_inputExtrusionPointsFromViewerEnabled = false;
CAF_PDM_InitFieldNoDefault( &m_inputTwoAzimuthPointsFromViewerEnabled, "inputTwoAzimuthPointsFromViewerEnabled", "" );
- caf::PdmUiPushButtonEditor::configureEditorForField( &m_inputTwoAzimuthPointsFromViewerEnabled );
+ caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_inputTwoAzimuthPointsFromViewerEnabled );
m_inputTwoAzimuthPointsFromViewerEnabled = false;
CAF_PDM_InitFieldNoDefault( &m_surfaceIntersections, "SurfaceIntersections", "Surface Intersections" );
@@ -439,11 +446,11 @@ void RimExtrudedCurveIntersection::setKFilterOverride( bool collectionOverride,
void RimExtrudedCurveIntersection::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( changedField == &m_isActive || changedField == &m_type || changedField == &m_direction || changedField == &m_wellPath ||
- changedField == &m_simulationWell || changedField == &m_branchIndex || changedField == &m_extentLength ||
- changedField == &m_lengthUp || changedField == &m_lengthDown || changedField == &m_showInactiveCells ||
- changedField == &m_useSeparateDataSource || changedField == &m_separateDataSource || changedField == &m_depthUpperThreshold ||
- changedField == &m_depthLowerThreshold || changedField == &m_depthThresholdOverridden || changedField == &m_depthFilterType ||
- changedField == &m_enableKFilter || changedField == &m_kFilterText || changedField == &m_kFilterCollectionOverride )
+ changedField == &m_simulationWell || changedField == &m_branchIndex || changedField == &m_extentLength || changedField == &m_lengthUp ||
+ changedField == &m_lengthDown || changedField == &m_showInactiveCells || changedField == &m_useSeparateDataSource ||
+ changedField == &m_separateDataSource || changedField == &m_depthUpperThreshold || changedField == &m_depthLowerThreshold ||
+ changedField == &m_depthThresholdOverridden || changedField == &m_depthFilterType || changedField == &m_enableKFilter ||
+ changedField == &m_kFilterText || changedField == &m_kFilterCollectionOverride || changedField == &m_projectPolygon )
{
rebuildGeometryAndScheduleCreateDisplayModel();
}
@@ -453,7 +460,8 @@ void RimExtrudedCurveIntersection::fieldChangedByUi( const caf::PdmFieldHandle*
recomputeSimulationWellBranchData();
}
- if ( changedField == &m_simulationWell || changedField == &m_wellPath || changedField == &m_branchIndex )
+ if ( changedField == &m_simulationWell || changedField == &m_wellPath || changedField == &m_branchIndex ||
+ changedField == &m_projectPolygon || changedField == &m_type )
{
updateName();
}
@@ -511,6 +519,15 @@ void RimExtrudedCurveIntersection::fieldChangedByUi( const caf::PdmFieldHandle*
{
rebuildGeometryAndScheduleCreateDisplayModel();
}
+
+ if ( changedField == &m_editPolygonButton )
+ {
+ RimPolygonTools::selectAndActivatePolygonInView( m_projectPolygon(), this );
+
+ m_editPolygonButton = false;
+
+ return;
+ }
}
//--------------------------------------------------------------------------------------------------
@@ -540,6 +557,11 @@ void RimExtrudedCurveIntersection::defineUiOrdering( QString uiConfigName, caf::
geometryGroup->add( &m_userPolylineXydForUi );
geometryGroup->add( &m_inputPolylineFromViewerEnabled );
}
+ else if ( type() == CrossSectionEnum::CS_POLYGON )
+ {
+ geometryGroup->add( &m_projectPolygon );
+ geometryGroup->add( &m_editPolygonButton, { .newRow = false } );
+ }
else if ( type() == CrossSectionEnum::CS_AZIMUTHLINE )
{
geometryGroup->add( &m_twoAzimuthPoints );
@@ -668,6 +690,19 @@ QList RimExtrudedCurveIntersection::calculateValueOption
options.push_front( caf::PdmOptionItemInfo( "None", nullptr ) );
}
}
+ else if ( fieldNeedingOptions == &m_projectPolygon )
+ {
+ options.push_back( caf::PdmOptionItemInfo( "None", nullptr ) );
+
+ RimTools::polygonOptionItems( &options );
+
+ if ( m_projectPolygon() == nullptr )
+ {
+ auto polygonCollection = RimTools::polygonCollection();
+ auto polygons = polygonCollection->allPolygons();
+ if ( !polygons.empty() ) m_projectPolygon = polygons.front();
+ }
+ }
else if ( fieldNeedingOptions == &m_branchIndex )
{
updateSimulationWellCenterline();
@@ -775,8 +810,6 @@ std::vector> RimExtrudedCurveIntersection::polyLines( cv
{
if ( m_simulationWell() )
{
- updateSimulationWellCenterline();
-
int branchIndexToUse = branchIndex();
if ( 0 <= branchIndexToUse && branchIndexToUse < static_cast( m_simulationWellBranchCenterlines.size() ) )
@@ -794,6 +827,13 @@ std::vector