Surface: Check if cell is active when creating grid surface

The IJK bounding box of active cells was used to create grid surface. This created misleading geometry in some cases. Avoid geometry creation for inactive cells.
This commit is contained in:
Magne Sjaastad
2023-08-16 08:06:22 +02:00
parent 9434c335b8
commit 56ad4b1888

View File

@@ -302,12 +302,6 @@ void RimGridCaseSurface::extractGridDataUsingFourVerticesPerCell()
std::vector<unsigned> triangleIndices;
std::vector<cvf::Vec3d> vertices;
cvf::Vec3st min, max;
if ( activeCells )
{
activeCells->IJKBoundingBox( min, max );
}
for ( size_t i = minI; i <= maxI; i++ )
{
for ( size_t j = minJ; j <= maxJ; j++ )
@@ -316,14 +310,9 @@ void RimGridCaseSurface::extractGridDataUsingFourVerticesPerCell()
size_t currentCellIndex = grid->cellIndexFromIJK( i, j, zeroBasedLayerIndex );
const auto& cell = grid->cell( currentCellIndex );
if ( cell.isInvalid() ) continue;
if ( !m_includeInactiveCells() && activeCells )
{
if ( i < min.x() || i > max.x() ) continue;
if ( j < min.y() || j > max.y() ) continue;
if ( zeroBasedLayerIndex < min.z() || zeroBasedLayerIndex > max.z() ) continue;
}
if ( cell.isInvalid() ) continue;
if ( !m_includeInactiveCells() && activeCells && !activeCells->isActive( currentCellIndex ) ) continue;
cvf::Vec3d currentCornerVerts[8];