From 6ac18d52ff7428bbf1452ede3e9bcfad03e4586f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Fri, 29 Nov 2019 10:25:23 +0100 Subject: [PATCH] #5117 Sep Inter Res: Fix missing use of cathegory legend --- .../RimIntersectionResultDefinition.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ApplicationCode/ProjectDataModel/RimIntersectionResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimIntersectionResultDefinition.cpp index 55b86e412a..8fa2f3a03a 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersectionResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimIntersectionResultDefinition.cpp @@ -231,6 +231,25 @@ void RimIntersectionResultDefinition::updateLegendRangesTextAndVisibility( RiuVi { if ( !this->isInAction() ) return; + if ( ( this->isEclipseResultDefinition() && m_eclipseResultDefinition()->hasCategoryResult() ) || + ( !this->isEclipseResultDefinition() && m_geomResultDefinition()->hasCategoryResult() ) ) + { + regularLegendConfig()->setMappingMode( RimRegularLegendConfig::CATEGORY_INTEGER ); + regularLegendConfig()->setColorRange( RimRegularLegendConfig::CATEGORY ); + } + else + { + if ( regularLegendConfig()->mappingMode() == RimRegularLegendConfig::CATEGORY_INTEGER ) + { + regularLegendConfig()->setMappingMode( RimRegularLegendConfig::LINEAR_CONTINUOUS ); + } + + if ( regularLegendConfig()->colorRange() == RimRegularLegendConfig::CATEGORY ) + { + regularLegendConfig()->setColorRange( RimRegularLegendConfig::NORMAL ); + } + } + if ( this->isEclipseResultDefinition() ) { RimEclipseResultDefinition* eclResultDef = this->eclipseResultDefinition();