diff --git a/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp b/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp index 9bb2544180..16a213cbe0 100644 --- a/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp @@ -404,6 +404,7 @@ void RivGridPartMgr::setResultsTransparentForWellCells(const std::vector(m_surfaceFaces->drawable()); @@ -424,6 +425,20 @@ void RivGridPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimResultSl m_surfaceFaces->setEffect(eff.p()); } } + */ + updateCellEdgeResultColorOnPart( + m_surfaceFaces.p(), + &m_surfaceGenerator, + timeStepIndex, cellResultSlot, cellEdgeResultSlot); + + if (m_faultFaces.notNull()) + { + updateCellEdgeResultColorOnPart( + m_faultFaces.p(), + &m_faultGenerator, + timeStepIndex, cellResultSlot, cellEdgeResultSlot); + } + /* if (m_faultFaces.notNull()) { cvf::DrawableGeo* dg = dynamic_cast(m_faultFaces->drawable()); @@ -444,6 +459,37 @@ void RivGridPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimResultSl m_faultFaces->setEffect(eff.p()); } } + */ +} +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivGridPartMgr::updateCellEdgeResultColorOnPart( cvf::Part* facePart, + cvf::StructGridGeometryGenerator* surfaceGenerator, + size_t timeStepIndex, + RimResultSlot* cellResultSlot, + RimCellEdgeResultSlot* cellEdgeResultSlot) +{ + if (facePart) + { + cvf::DrawableGeo* dg = dynamic_cast(facePart->drawable()); + if (dg) + { + RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(timeStepIndex, cellResultSlot, cellEdgeResultSlot, + surfaceGenerator, dg, m_grid->gridIndex(), m_opacityLevel ); + + cvf::ScalarMapper* cellScalarMapper = NULL; + if (cellResultSlot->hasResult()) cellScalarMapper = cellResultSlot->legendConfig()->scalarMapper(); + + CellEdgeEffectGenerator cellFaceEffectGen(cellEdgeResultSlot->legendConfig()->scalarMapper(), cellScalarMapper); + cellFaceEffectGen.setOpacityLevel(m_opacityLevel); + cellFaceEffectGen.setDefaultCellColor(m_defaultColor); + + cvf::ref eff = cellFaceEffectGen.generateEffect(); + + facePart->setEffect(eff.p()); + } + } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ModelVisualization/RivGridPartMgr.h b/ApplicationCode/ModelVisualization/RivGridPartMgr.h index eb656de4ab..4ef7bb7e13 100644 --- a/ApplicationCode/ModelVisualization/RivGridPartMgr.h +++ b/ApplicationCode/ModelVisualization/RivGridPartMgr.h @@ -96,6 +96,11 @@ private: const cvf::UIntArray* gridCellToWellIndexMap, const cvf::StructGridQuadToCellFaceMapper* quadsToCellFaceMapper, cvf::Vec2fArray* resultTextureCoords); + void updateCellEdgeResultColorOnPart(cvf::Part* facePart, + cvf::StructGridGeometryGenerator* surfaceGenerator, + size_t timeStepIndex, + RimResultSlot* cellResultSlot, + RimCellEdgeResultSlot* cellEdgeResultSlot); private: size_t m_gridIdx; cvf::cref m_grid; @@ -112,7 +117,7 @@ private: cvf::ref m_surfaceGridLines; - // Fault visualization + // Fault visualization: Dead ?? JJS cvf::StructGridGeometryGenerator m_faultGenerator; RigFaultFaceVisibilityFilter m_faultFaceFilter; cvf::ref m_faultFaces;