Refactor: Change RigGridBase::cellCornerVertices to return std::array

Refactored RigGridBase::cellCornerVertices to return std::array<cvf::Vec3d, 8> by value instead of taking a reference to std::array as an output parameter. This change improves code readability and leverages modern C++ return value optimizations.

Updated all call sites across the codebase to reflect the new function signature.
This commit is contained in:
Kristian Bendiksen committed 2025-09-03 14:21:19 +02:00
1 parent da69eef72b
commit 10182e99a7
41 files changed
+148 -214

No files matched your search

@@ -156,26 +156,21 @@ size_t RigMainGrid::reservoirCellIndexByGridAndGridLocalCellIndex( size_t gridId
//--------------------------------------------------------------------------------------------------
size_t RigMainGrid::findReservoirCellIndexFromPoint( const cvf::Vec3d& point ) const
{
size_t cellContainingPoint = cvf::UNDEFINED_SIZE_T;
cvf::BoundingBox pointBBox;
pointBBox.add( point );
std::vector<size_t> cellIndices = m_mainGrid->findIntersectingCells( pointBBox );
std::array<cvf::Vec3d, 8> hexCorners;
for ( size_t cellIndex : cellIndices )
{
m_mainGrid->cellCornerVertices( cellIndex, hexCorners );
std::array<cvf::Vec3d, 8> hexCorners = m_mainGrid->cellCornerVertices( cellIndex );
if ( RigHexIntersectionTools::isPointInCell( point, hexCorners ) )
{
cellContainingPoint = cellIndex;
break;
return cellIndex;
}
}
return cellContainingPoint;
return cvf::UNDEFINED_SIZE_T;
}
//--------------------------------------------------------------------------------------------------