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:
@@ -551,10 +551,11 @@ void RivReservoirViewPartMgr::computeRangeVisibility(ReservoirGeometryCacheType
|
|||||||
CVF_ASSERT(grid != NULL);
|
CVF_ASSERT(grid != NULL);
|
||||||
CVF_ASSERT(nativeVisibility->size() == grid->cellCount());
|
CVF_ASSERT(nativeVisibility->size() == grid->cellCount());
|
||||||
|
|
||||||
|
// Initialize range filter with native visibility
|
||||||
|
if (cellVisibility != nativeVisibility) (*cellVisibility) = (*nativeVisibility);
|
||||||
|
|
||||||
if (rangeFilterColl->hasActiveFilters())
|
if (rangeFilterColl->hasActiveFilters())
|
||||||
{
|
{
|
||||||
if (cellVisibility != nativeVisibility) (*cellVisibility) = (*nativeVisibility);
|
|
||||||
|
|
||||||
// Build range filter for current grid
|
// Build range filter for current grid
|
||||||
cvf::CellRangeFilter gridCellRangeFilter;
|
cvf::CellRangeFilter gridCellRangeFilter;
|
||||||
rangeFilterColl->compoundCellRangeFilter(&gridCellRangeFilter, grid);
|
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);
|
CVF_ASSERT(cellRangeFilter);
|
||||||
|
|
||||||
|
bool onlyExcludeFiltersActive = true;
|
||||||
|
|
||||||
std::list< caf::PdmPointer<RimCellRangeFilter> >::const_iterator it;
|
std::list< caf::PdmPointer<RimCellRangeFilter> >::const_iterator it;
|
||||||
for (it = rangeFilters.v().begin(); it != rangeFilters.v().end(); 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->startIndexJ - 1 + rangeFilter->cellCountJ,
|
||||||
rangeFilter->startIndexK - 1 + rangeFilter->cellCountK,
|
rangeFilter->startIndexK - 1 + rangeFilter->cellCountK,
|
||||||
rangeFilter->propagateToSubGrids());
|
rangeFilter->propagateToSubGrids());
|
||||||
|
|
||||||
|
onlyExcludeFiltersActive = false;
|
||||||
}
|
}
|
||||||
else
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user