Missing updates of property filtered cells

1. When Rangefilters changed
2. When the rangefilter collection was turned off
This commit is contained in:
Jacob Støren 2015-06-24 11:59:39 +02:00
parent 2b881f2cb8
commit 4fabc509a0
2 changed files with 33 additions and 10 deletions

View File

@ -109,6 +109,8 @@ void RivGeoMechVizLogic::updateStaticCellColors(int timeStepIndex)
//--------------------------------------------------------------------------------------------------
void RivGeoMechVizLogic::scheduleGeometryRegen(RivCellSetEnum geometryType)
{
this->scheduleRegenOfDirectlyDependentGeometry(geometryType);
int frameCount = m_geomechView->geoMechCase()->geoMechData()->femPartResults()->frameCount();
for (int fIdx = -1; fIdx < frameCount; ++fIdx)
@ -118,6 +120,14 @@ void RivGeoMechVizLogic::scheduleGeometryRegen(RivCellSetEnum geometryType)
}
}
void RivGeoMechVizLogic::scheduleRegenOfDirectlyDependentGeometry(RivCellSetEnum geometryType)
{
if (geometryType == RANGE_FILTERED)
{
this->scheduleGeometryRegen(PROPERTY_FILTERED);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -175,19 +185,31 @@ RivGeoMechPartMgr* RivGeoMechVizLogic::getUpdatedPartMgr(RivGeoMechPartMgrCache:
}
else if (pMgrKey.geometryType() == PROPERTY_FILTERED)
{
RivGeoMechPartMgr* rangefiltered = getUpdatedPartMgr(RivGeoMechPartMgrCache::Key(RANGE_FILTERED, -1));
cvf::ref<cvf::UByteArray> rangeFiltVisibility = rangefiltered->cellVisibility(femPartIdx);
RivFemElmVisibilityCalculator::computePropertyVisibility(elmVisibility.p(),
caseData->femParts()->part(femPartIdx),
pMgrKey.frameIndex(),
rangeFiltVisibility.p(),
m_geomechView->propertyFilterCollection()
);
RivGeoMechPartMgr* rangefiltered = NULL;
if (m_geomechView->rangeFilterCollection()->hasActiveFilters())
{
rangefiltered = getUpdatedPartMgr(RivGeoMechPartMgrCache::Key(RANGE_FILTERED, -1));
}
else
{
rangefiltered = getUpdatedPartMgr(RivGeoMechPartMgrCache::Key(ALL_CELLS, -1));
}
cvf::ref<cvf::UByteArray> rangeFiltVisibility = rangefiltered->cellVisibility(femPartIdx);
RivFemElmVisibilityCalculator::computePropertyVisibility(elmVisibility.p(),
caseData->femParts()->part(femPartIdx),
pMgrKey.frameIndex(),
rangeFiltVisibility.p(),
m_geomechView->propertyFilterCollection()
);
}
else if (pMgrKey.geometryType() == ALL_CELLS)
{
RivFemElmVisibilityCalculator::computeAllVisible(elmVisibility.p(), caseData->femParts()->part(femPartIdx));
}
else
{
RivFemElmVisibilityCalculator::computeAllVisible(elmVisibility.p(), caseData->femParts()->part(femPartIdx));
CVF_ASSERT(false); // Unsupported CellSet Enum
}
partMgrToUpdate->setCellVisibility(femPartIdx, elmVisibility.p());

View File

@ -51,6 +51,7 @@ private:
std::vector<RivGeoMechPartMgrCache::Key> keysToVisiblePartMgrs(int timeStepIndex);
RivGeoMechPartMgr* getUpdatedPartMgr(RivGeoMechPartMgrCache::Key partMgrKey);
void scheduleRegenOfDirectlyDependentGeometry(RivCellSetEnum geometryType);
cvf::ref<RivGeoMechPartMgrCache> m_partMgrCache;
RimGeoMechView* m_geomechView;