From 4bafefa2255c3dbc408edbe6123bcddf7d9a548b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Mon, 25 Nov 2019 13:02:35 +0100 Subject: [PATCH] #5019 2D Intersection views based on separate intersection results now respects the animation toolbar --- .../Intersections/RivIntersectionBoxPartMgr.cpp | 1 + .../Intersections/RivIntersectionPartMgr.cpp | 1 + .../Intersections/RivIntersectionResultsColoringTools.cpp | 6 +++++- .../Intersections/RivIntersectionResultsColoringTools.h | 5 +++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.cpp b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.cpp index 7b183e3c4c..81cfc89749 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.cpp @@ -85,6 +85,7 @@ void RivIntersectionBoxPartMgr::applySingleColorEffect() void RivIntersectionBoxPartMgr::updateCellResultColor( size_t timeStepIndex ) { RivIntersectionResultsColoringTools::updateCellResultColorStatic( timeStepIndex, + true, m_rimIntersectionBox, m_intersectionBoxGenerator.p(), nullptr, diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp index 20fee137b4..8159a26b12 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp @@ -154,6 +154,7 @@ void RivIntersectionPartMgr::updateCellResultColor( size_t const RivTernaryScalarMapper* ternaryColorMapper ) { RivIntersectionResultsColoringTools::updateCellResultColorStatic( timeStepIndex, + !m_isFlattened, m_rimCrossSection, m_crossSectionGenerator.p(), scalarColorMapper, diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionResultsColoringTools.cpp b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionResultsColoringTools.cpp index 3c89a30b12..41920abe4a 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionResultsColoringTools.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionResultsColoringTools.cpp @@ -50,6 +50,7 @@ //-------------------------------------------------------------------------------------------------- void RivIntersectionResultsColoringTools::updateCellResultColorStatic( size_t timeStepIndex, + bool useSeparateIntersectionResDefTimeStep, RimIntersectionHandle* rimIntersectionHandle, const RivIntersectionGeometryGeneratorIF* intersectionGeomGenIF, const cvf::ScalarMapper* explicitScalarColorMapper, @@ -87,7 +88,10 @@ void RivIntersectionResultsColoringTools::updateCellResultColorStatic( if ( !scalarColorMapper ) scalarColorMapper = sepResDef->regularLegendConfig()->scalarMapper(); if ( !ternaryColorMapper ) ternaryColorMapper = sepResDef->ternaryLegendConfig()->scalarMapper(); - timeStepIndex = sepResDef->timeStep(); + if ( useSeparateIntersectionResDefTimeStep ) + { + timeStepIndex = sepResDef->timeStep(); + } } // Ordinary result diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionResultsColoringTools.h b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionResultsColoringTools.h index ab4dee43cb..1bc08ef2a8 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionResultsColoringTools.h +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionResultsColoringTools.h @@ -43,8 +43,9 @@ class ScalarMapper; class RivIntersectionResultsColoringTools { public: - static void updateCellResultColorStatic( size_t timeStepIndex, - RimIntersectionHandle* rimIntersectionHandle, + static void updateCellResultColorStatic( size_t timeStepIndex, + bool useSeparateIntersectionResDefTimeStep, + RimIntersectionHandle* rimIntersectionHandle, const RivIntersectionGeometryGeneratorIF* intersectionGeomGenIF, const cvf::ScalarMapper* explicitScalarColorMapper, const RivTernaryScalarMapper* explicitTernaryColorMapper,