#14596 Skip computing corner coordinates for cells excluded by the K filter

Move the call to cellCornerVertices below the K filter early out, so the corner coordinates are only computed for the cells that are actually tested against the polygon.
This commit is contained in:
Magne Sjaastad
2026-08-25 08:22:29 +02:00
parent 4a6ebedade
commit 7b11292839
@@ -486,14 +486,14 @@ void RimPolygonFilter::updateCellsDepthEclipse( const std::vector<cvf::Vec3d>& p
RigCell cell = grid->cell( n );
if ( cell.isInvalid() ) continue;
// get corner coordinates
std::array<cvf::Vec3d, 8> hexCorners = grid->cellCornerVertices( n );
// get cell ijk for k filter
size_t i, j, k;
grid->ijkFromCellIndex( n, &i, &j, &k );
if ( !m_intervalTool.isNumberIncluded( k ) ) continue;
// get corner coordinates
std::array<cvf::Vec3d, 8> hexCorners = grid->cellCornerVertices( n );
// check if the polygon includes the cell
if ( cellInsidePolygon2D( cell.center(), hexCorners, points ) )
{