From ffb3d3e235f2d50b963a698b8e368634bae49ede Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 8 Aug 2013 08:57:23 +0200 Subject: [PATCH] Rebuild inactive geometry when invalid state changes Show inactive/invalid cells also when using property filter, relevant for exclude filters p4#: 22124 --- .../ProjectDataModel/RimReservoirView.cpp | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp index 6402bce527..266795d45a 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp @@ -435,6 +435,9 @@ void RimReservoirView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, } else if ( changedField == &showInactiveCells ) { + m_reservoirGridPartManager->scheduleGeometryRegen(RivReservoirViewPartMgr::INACTIVE); + m_reservoirGridPartManager->scheduleGeometryRegen(RivReservoirViewPartMgr::RANGE_FILTERED_INACTIVE); + createDisplayModelAndRedraw(); } else if ( changedField == &showMainGrid ) @@ -557,7 +560,7 @@ void RimReservoirView::createDisplayModel() if (! this->propertyFilterCollection()->hasActiveFilters()) { std::vector geometryTypesToAdd; - + if (this->rangeFilterCollection()->hasActiveFilters() || this->wellCollection()->hasVisibleWellCells()) { geometryTypesToAdd.push_back(RivReservoirViewPartMgr::RANGE_FILTERED); @@ -579,7 +582,7 @@ void RimReservoirView::createDisplayModel() geometryTypesToAdd.push_back(RivReservoirViewPartMgr::INACTIVE); } } - + size_t frameIdx; for (frameIdx = 0; frameIdx < frameModels.size(); ++frameIdx) { @@ -675,6 +678,22 @@ void RimReservoirView::updateCurrentTimeStep() float opacity = static_cast< float> (1 - cvf::Math::clamp(this->wellCollection()->wellCellTransparencyLevel(), 0.0, 1.0)); m_reservoirGridPartManager->updateCellColor(RivReservoirViewPartMgr::PROPERTY_FILTERED_WELL_CELLS, m_currentTimeStep, cvf::Color4f(cvf::Color3f(cvf::Color3::WHITE), opacity)); + + if (this->showInactiveCells()) + { + std::vector gridIndices; + this->indicesToVisibleGrids(&gridIndices); + + if (this->rangeFilterCollection()->hasActiveFilters() || this->wellCollection()->hasVisibleWellCells()) + { + m_reservoirGridPartManager->appendStaticGeometryPartsToModel(frameParts.p(), RivReservoirViewPartMgr::RANGE_FILTERED_INACTIVE, gridIndices); + } + else + { + m_reservoirGridPartManager->appendStaticGeometryPartsToModel(frameParts.p(), RivReservoirViewPartMgr::INACTIVE, gridIndices); + } + } + if (m_viewer) { cvf::Scene* frameScene = m_viewer->frame(m_currentTimeStep);