Renamed cell filter field from active to isActive

Removed the special handling of range filters when only exclude filters are active
p4#: 22123
This commit is contained in:
Magne Sjaastad
2013-08-08 08:49:29 +02:00
parent fea95940bf
commit 008842a1ee
8 changed files with 51 additions and 38 deletions

View File

@@ -75,14 +75,12 @@ 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++)
{
RimCellRangeFilter* rangeFilter = *it;
if (rangeFilter && rangeFilter->active() && static_cast<size_t>(rangeFilter->gridIndex()) == grid->gridIndex())
if (rangeFilter && rangeFilter->isActive() && static_cast<size_t>(rangeFilter->gridIndex()) == grid->gridIndex())
{
if (rangeFilter->filterMode == RimCellFilter::INCLUDE)
{
@@ -94,8 +92,6 @@ void RimCellRangeFilterCollection::compoundCellRangeFilter(cvf::CellRangeFilter*
rangeFilter->startIndexJ - 1 + rangeFilter->cellCountJ,
rangeFilter->startIndexK - 1 + rangeFilter->cellCountK,
rangeFilter->propagateToSubGrids());
onlyExcludeFiltersActive = false;
}
else
{
@@ -110,22 +106,6 @@ 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);
}
}
@@ -234,7 +214,7 @@ bool RimCellRangeFilterCollection::hasActiveFilters() const
std::list< caf::PdmPointer< RimCellRangeFilter > >::const_iterator it;
for (it = rangeFilters.v().begin(); it != rangeFilters.v().end(); ++it)
{
if ((*it)->active()) return true;
if ((*it)->isActive()) return true;
}
return false;
@@ -248,3 +228,20 @@ caf::PdmFieldHandle* RimCellRangeFilterCollection::objectToggleField()
return &active;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimCellRangeFilterCollection::hasActiveIncludeFilters() const
{
if (!active) return false;
std::list< caf::PdmPointer< RimCellRangeFilter > >::const_iterator it;
for (it = rangeFilters.v().begin(); it != rangeFilters.v().end(); ++it)
{
if ((*it)->isActive() && (*it)->filterMode() == RimCellFilter::INCLUDE) return true;
}
return false;
}