mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix for range filter exclude behaviour
Use active cells as range include filter when there are range exclude filters present and no include filters p4#: 22095
This commit is contained in:
parent
ffbb0b6a46
commit
f2be4dedaf
@ -551,10 +551,11 @@ void RivReservoirViewPartMgr::computeRangeVisibility(ReservoirGeometryCacheType
|
||||
CVF_ASSERT(grid != NULL);
|
||||
CVF_ASSERT(nativeVisibility->size() == grid->cellCount());
|
||||
|
||||
// Initialize range filter with native visibility
|
||||
if (cellVisibility != nativeVisibility) (*cellVisibility) = (*nativeVisibility);
|
||||
|
||||
if (rangeFilterColl->hasActiveFilters())
|
||||
{
|
||||
if (cellVisibility != nativeVisibility) (*cellVisibility) = (*nativeVisibility);
|
||||
|
||||
// Build range filter for current grid
|
||||
cvf::CellRangeFilter gridCellRangeFilter;
|
||||
rangeFilterColl->compoundCellRangeFilter(&gridCellRangeFilter, grid);
|
||||
@ -604,11 +605,6 @@ void RivReservoirViewPartMgr::computeRangeVisibility(ReservoirGeometryCacheType
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cellVisibility->resize(grid->cellCount());
|
||||
cellVisibility->setAll(false);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -75,6 +75,8 @@ void RimCellRangeFilterCollection::compoundCellRangeFilter(cvf::CellRangeFilter*
|
||||
{
|
||||
CVF_ASSERT(cellRangeFilter);
|
||||
|
||||
bool onlyExcludeFiltersActive = true;
|
||||
|
||||
std::list< caf::PdmPointer<RimCellRangeFilter> >::const_iterator it;
|
||||
for (it = rangeFilters.v().begin(); it != rangeFilters.v().end(); it++)
|
||||
{
|
||||
@ -92,6 +94,8 @@ void RimCellRangeFilterCollection::compoundCellRangeFilter(cvf::CellRangeFilter*
|
||||
rangeFilter->startIndexJ - 1 + rangeFilter->cellCountJ,
|
||||
rangeFilter->startIndexK - 1 + rangeFilter->cellCountK,
|
||||
rangeFilter->propagateToSubGrids());
|
||||
|
||||
onlyExcludeFiltersActive = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -106,6 +110,22 @@ void RimCellRangeFilterCollection::compoundCellRangeFilter(cvf::CellRangeFilter*
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If there are only exclude filters present, add active cell bounding box as an include filter
|
||||
if (onlyExcludeFiltersActive && activeCellInfo())
|
||||
{
|
||||
cvf::Vec3st min, max;
|
||||
activeCellInfo()->IJKBoundingBox(min, max);
|
||||
|
||||
cellRangeFilter->addCellIncludeRange(
|
||||
min.x(),
|
||||
min.y(),
|
||||
min.z(),
|
||||
max.x(),
|
||||
max.y(),
|
||||
max.z(),
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user