Return pair of vectors and rename

This commit is contained in:
Magne Sjaastad 2024-01-20 13:47:12 +01:00
parent 210f03752f
commit 80fdd1da74
9 changed files with 17 additions and 26 deletions

View File

@ -218,8 +218,7 @@ void RicCellRangeUi::setDefaultValues()
if ( grid == mainGrid && actCellInfo ) if ( grid == mainGrid && actCellInfo )
{ {
cvf::Vec3st min, max; auto [min, max] = actCellInfo->ijkBoundingBox();
actCellInfo->IJKBoundingBox( min, max );
// Adjust to Eclipse indexing // Adjust to Eclipse indexing
min.x() = min.x() + 1; min.x() = min.x() + 1;
@ -273,8 +272,7 @@ void RicCellRangeUi::updateLegendText()
if ( grid == mainGrid && actCellInfo ) if ( grid == mainGrid && actCellInfo )
{ {
cvf::Vec3st min, max; auto [min, max] = actCellInfo->ijkBoundingBox();
actCellInfo->IJKBoundingBox( min, max );
// Adjust to Eclipse indexing // Adjust to Eclipse indexing
min.x() = min.x() + 1; min.x() = min.x() + 1;

View File

@ -516,8 +516,7 @@ void RicExportEclipseSectorModelUi::applyBoundaryDefaults()
{ {
if ( exportGridBox == ACTIVE_CELLS_BOX ) if ( exportGridBox == ACTIVE_CELLS_BOX )
{ {
cvf::Vec3st minActive, maxActive; auto [minActive, maxActive] = m_caseData->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL )->ijkBoundingBox();
m_caseData->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL )->IJKBoundingBox( minActive, maxActive );
setMin( cvf::Vec3i( minActive ) ); setMin( cvf::Vec3i( minActive ) );
setMax( cvf::Vec3i( maxActive ) ); setMax( cvf::Vec3i( maxActive ) );
} }

View File

@ -68,14 +68,12 @@ void RicCreateMultipleFracturesFeature::replaceFractures()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::pair<cvf::Vec3st, cvf::Vec3st> RicCreateMultipleFracturesFeature::ijkRangeForGrid( RimEclipseCase* gridCase ) const std::pair<cvf::Vec3st, cvf::Vec3st> RicCreateMultipleFracturesFeature::ijkRangeForGrid( RimEclipseCase* gridCase ) const
{ {
cvf::Vec3st minIJK;
cvf::Vec3st maxIJK;
if ( gridCase && gridCase->eclipseCaseData() ) if ( gridCase && gridCase->eclipseCaseData() )
{ {
gridCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL )->IJKBoundingBox( minIJK, maxIJK ); return gridCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL )->ijkBoundingBox();
return std::make_pair( minIJK, maxIJK );
} }
return std::make_pair( cvf::Vec3st(), cvf::Vec3st() );
return {};
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -184,8 +184,7 @@ void RimCellRangeFilter::setDefaultValues( int sliceDirection, int defaultSlice
if ( grid == mainGrid && actCellInfo ) if ( grid == mainGrid && actCellInfo )
{ {
cvf::Vec3st min, max; auto [min, max] = actCellInfo->ijkBoundingBox();
actCellInfo->IJKBoundingBox( min, max );
// Adjust to Eclipse indexing // Adjust to Eclipse indexing
min.x() = min.x() + 1; min.x() = min.x() + 1;
@ -280,8 +279,7 @@ void RimCellRangeFilter::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
if ( grid == mainGrid && actCellInfo ) if ( grid == mainGrid && actCellInfo )
{ {
cvf::Vec3st min, max; auto [min, max] = actCellInfo->ijkBoundingBox();
actCellInfo->IJKBoundingBox( min, max );
// Adjust to Eclipse indexing // Adjust to Eclipse indexing
min.x() = min.x() + 1; min.x() = min.x() + 1;

View File

@ -197,8 +197,7 @@ void RimAdvancedSnapshotExportDefinition::fieldChangedByUi( const caf::PdmFieldH
if ( mainGrid && actCellInfo ) if ( mainGrid && actCellInfo )
{ {
cvf::Vec3st min, max; auto [min, max] = actCellInfo->ijkBoundingBox();
actCellInfo->IJKBoundingBox( min, max );
// Adjust to Eclipse indexing // Adjust to Eclipse indexing
min.x() = min.x() + 1; min.x() = min.x() + 1;

View File

@ -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_activeCellPositionMin = min;
m_activeCellPositionMax = max; 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<cvf::Vec3st, cvf::Vec3st> RigActiveCellInfo::ijkBoundingBox() const
{ {
min = m_activeCellPositionMin; return std::make_pair( m_activeCellPositionMin, m_activeCellPositionMax );
max = m_activeCellPositionMax;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -45,8 +45,8 @@ public:
size_t gridActiveCellCounts( size_t gridIndex ) const; size_t gridActiveCellCounts( size_t gridIndex ) const;
void computeDerivedData(); void computeDerivedData();
void setIJKBoundingBox( const cvf::Vec3st& min, const cvf::Vec3st& max ); void setIjkBoundingBox( const cvf::Vec3st& min, const cvf::Vec3st& max );
void IJKBoundingBox( cvf::Vec3st& min, cvf::Vec3st& max ) const; std::pair<cvf::Vec3st, cvf::Vec3st> ijkBoundingBox() const;
cvf::BoundingBox geometryBoundingBox() const; cvf::BoundingBox geometryBoundingBox() const;
void setGeometryBoundingBox( cvf::BoundingBox bb ); void setGeometryBoundingBox( cvf::BoundingBox bb );

View File

@ -445,8 +445,8 @@ void RigEclipseCaseData::computeActiveCellIJKBBox()
fractureModelActiveBB.add( i, j, k ); fractureModelActiveBB.add( i, j, k );
} }
} }
m_activeCellInfo->setIJKBoundingBox( matrixModelActiveBB.m_min, matrixModelActiveBB.m_max ); m_activeCellInfo->setIjkBoundingBox( matrixModelActiveBB.m_min, matrixModelActiveBB.m_max );
m_fractureActiveCellInfo->setIJKBoundingBox( fractureModelActiveBB.m_min, fractureModelActiveBB.m_max ); m_fractureActiveCellInfo->setIjkBoundingBox( fractureModelActiveBB.m_min, fractureModelActiveBB.m_max );
} }
} }

@ -1 +1 @@
Subproject commit a76421efffb45ae42831a5a5a8cc7e2bddbf5b8e Subproject commit f0c77de5d4a0b04b989c90f9750b7f507326341b