mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-30 09:00:20 -05:00
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:
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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user