From 80fdd1da74e396d226b7265d4058569f2cf980d0 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sat, 20 Jan 2024 13:47:12 +0100 Subject: [PATCH] Return pair of vectors and rename --- .../Commands/ExportCommands/RicCellRangeUi.cpp | 6 ++---- .../ExportCommands/RicExportEclipseSectorModelUi.cpp | 3 +-- .../RicCreateMultipleFracturesFeature.cpp | 8 +++----- .../ProjectDataModel/CellFilters/RimCellRangeFilter.cpp | 6 ++---- .../RimAdvancedSnapshotExportDefinition.cpp | 3 +-- .../ReservoirDataModel/RigActiveCellInfo.cpp | 7 +++---- ApplicationLibCode/ReservoirDataModel/RigActiveCellInfo.h | 4 ++-- .../ReservoirDataModel/RigEclipseCaseData.cpp | 4 ++-- ThirdParty/custom-opm-common/opm-common | 2 +- 9 files changed, 17 insertions(+), 26 deletions(-) diff --git a/ApplicationLibCode/Commands/ExportCommands/RicCellRangeUi.cpp b/ApplicationLibCode/Commands/ExportCommands/RicCellRangeUi.cpp index 4b66a26310..d540878e3a 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicCellRangeUi.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicCellRangeUi.cpp @@ -218,8 +218,7 @@ void RicCellRangeUi::setDefaultValues() if ( grid == mainGrid && actCellInfo ) { - cvf::Vec3st min, max; - actCellInfo->IJKBoundingBox( min, max ); + auto [min, max] = actCellInfo->ijkBoundingBox(); // Adjust to Eclipse indexing min.x() = min.x() + 1; @@ -273,8 +272,7 @@ void RicCellRangeUi::updateLegendText() if ( grid == mainGrid && actCellInfo ) { - cvf::Vec3st min, max; - actCellInfo->IJKBoundingBox( min, max ); + auto [min, max] = actCellInfo->ijkBoundingBox(); // Adjust to Eclipse indexing min.x() = min.x() + 1; diff --git a/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelUi.cpp b/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelUi.cpp index 3a16a078e5..9629952ff4 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelUi.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicExportEclipseSectorModelUi.cpp @@ -516,8 +516,7 @@ void RicExportEclipseSectorModelUi::applyBoundaryDefaults() { if ( exportGridBox == ACTIVE_CELLS_BOX ) { - cvf::Vec3st minActive, maxActive; - m_caseData->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL )->IJKBoundingBox( minActive, maxActive ); + auto [minActive, maxActive] = m_caseData->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL )->ijkBoundingBox(); setMin( cvf::Vec3i( minActive ) ); setMax( cvf::Vec3i( maxActive ) ); } diff --git a/ApplicationLibCode/Commands/FractureCommands/RicCreateMultipleFracturesFeature.cpp b/ApplicationLibCode/Commands/FractureCommands/RicCreateMultipleFracturesFeature.cpp index a2c12c1c32..45786e161f 100644 --- a/ApplicationLibCode/Commands/FractureCommands/RicCreateMultipleFracturesFeature.cpp +++ b/ApplicationLibCode/Commands/FractureCommands/RicCreateMultipleFracturesFeature.cpp @@ -68,14 +68,12 @@ void RicCreateMultipleFracturesFeature::replaceFractures() //-------------------------------------------------------------------------------------------------- std::pair RicCreateMultipleFracturesFeature::ijkRangeForGrid( RimEclipseCase* gridCase ) const { - cvf::Vec3st minIJK; - cvf::Vec3st maxIJK; if ( gridCase && gridCase->eclipseCaseData() ) { - gridCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL )->IJKBoundingBox( minIJK, maxIJK ); - return std::make_pair( minIJK, maxIJK ); + return gridCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL )->ijkBoundingBox(); } - return std::make_pair( cvf::Vec3st(), cvf::Vec3st() ); + + return {}; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellRangeFilter.cpp b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellRangeFilter.cpp index f9142e3954..079b5a33e6 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellRangeFilter.cpp +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellRangeFilter.cpp @@ -184,8 +184,7 @@ void RimCellRangeFilter::setDefaultValues( int sliceDirection, int defaultSlice if ( grid == mainGrid && actCellInfo ) { - cvf::Vec3st min, max; - actCellInfo->IJKBoundingBox( min, max ); + auto [min, max] = actCellInfo->ijkBoundingBox(); // Adjust to Eclipse indexing min.x() = min.x() + 1; @@ -280,8 +279,7 @@ void RimCellRangeFilter::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder if ( grid == mainGrid && actCellInfo ) { - cvf::Vec3st min, max; - actCellInfo->IJKBoundingBox( min, max ); + auto [min, max] = actCellInfo->ijkBoundingBox(); // Adjust to Eclipse indexing min.x() = min.x() + 1; diff --git a/ApplicationLibCode/ProjectDataModel/RimAdvancedSnapshotExportDefinition.cpp b/ApplicationLibCode/ProjectDataModel/RimAdvancedSnapshotExportDefinition.cpp index 1efc9e70cf..046c5e7b7d 100644 --- a/ApplicationLibCode/ProjectDataModel/RimAdvancedSnapshotExportDefinition.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimAdvancedSnapshotExportDefinition.cpp @@ -197,8 +197,7 @@ void RimAdvancedSnapshotExportDefinition::fieldChangedByUi( const caf::PdmFieldH if ( mainGrid && actCellInfo ) { - cvf::Vec3st min, max; - actCellInfo->IJKBoundingBox( min, max ); + auto [min, max] = actCellInfo->ijkBoundingBox(); // Adjust to Eclipse indexing min.x() = min.x() + 1; diff --git a/ApplicationLibCode/ReservoirDataModel/RigActiveCellInfo.cpp b/ApplicationLibCode/ReservoirDataModel/RigActiveCellInfo.cpp index 2ecf32f6c7..92fd87fe97 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigActiveCellInfo.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigActiveCellInfo.cpp @@ -139,7 +139,7 @@ size_t RigActiveCellInfo::reservoirActiveCellCount() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigActiveCellInfo::setIJKBoundingBox( const cvf::Vec3st& min, const cvf::Vec3st& max ) +void RigActiveCellInfo::setIjkBoundingBox( const cvf::Vec3st& min, const cvf::Vec3st& max ) { m_activeCellPositionMin = min; m_activeCellPositionMax = max; @@ -148,10 +148,9 @@ void RigActiveCellInfo::setIJKBoundingBox( const cvf::Vec3st& min, const cvf::Ve //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigActiveCellInfo::IJKBoundingBox( cvf::Vec3st& min, cvf::Vec3st& max ) const +std::pair RigActiveCellInfo::ijkBoundingBox() const { - min = m_activeCellPositionMin; - max = m_activeCellPositionMax; + return std::make_pair( m_activeCellPositionMin, m_activeCellPositionMax ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ReservoirDataModel/RigActiveCellInfo.h b/ApplicationLibCode/ReservoirDataModel/RigActiveCellInfo.h index f016e2c2dd..2ebf272b98 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigActiveCellInfo.h +++ b/ApplicationLibCode/ReservoirDataModel/RigActiveCellInfo.h @@ -45,8 +45,8 @@ public: size_t gridActiveCellCounts( size_t gridIndex ) const; void computeDerivedData(); - void setIJKBoundingBox( const cvf::Vec3st& min, const cvf::Vec3st& max ); - void IJKBoundingBox( cvf::Vec3st& min, cvf::Vec3st& max ) const; + void setIjkBoundingBox( const cvf::Vec3st& min, const cvf::Vec3st& max ); + std::pair ijkBoundingBox() const; cvf::BoundingBox geometryBoundingBox() const; void setGeometryBoundingBox( cvf::BoundingBox bb ); diff --git a/ApplicationLibCode/ReservoirDataModel/RigEclipseCaseData.cpp b/ApplicationLibCode/ReservoirDataModel/RigEclipseCaseData.cpp index 9e254cd724..97a3b95cb0 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigEclipseCaseData.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigEclipseCaseData.cpp @@ -445,8 +445,8 @@ void RigEclipseCaseData::computeActiveCellIJKBBox() fractureModelActiveBB.add( i, j, k ); } } - m_activeCellInfo->setIJKBoundingBox( matrixModelActiveBB.m_min, matrixModelActiveBB.m_max ); - m_fractureActiveCellInfo->setIJKBoundingBox( fractureModelActiveBB.m_min, fractureModelActiveBB.m_max ); + m_activeCellInfo->setIjkBoundingBox( matrixModelActiveBB.m_min, matrixModelActiveBB.m_max ); + m_fractureActiveCellInfo->setIjkBoundingBox( fractureModelActiveBB.m_min, fractureModelActiveBB.m_max ); } } diff --git a/ThirdParty/custom-opm-common/opm-common b/ThirdParty/custom-opm-common/opm-common index a76421efff..f0c77de5d4 160000 --- a/ThirdParty/custom-opm-common/opm-common +++ b/ThirdParty/custom-opm-common/opm-common @@ -1 +1 @@ -Subproject commit a76421efffb45ae42831a5a5a8cc7e2bddbf5b8e +Subproject commit f0c77de5d4a0b04b989c90f9750b7f507326341b