#811 Setting default legend type for category results

This commit is contained in:
Jacob Støren
2016-09-06 14:03:02 +02:00
parent 3e8873c870
commit e4e3c37f89
6 changed files with 49 additions and 2 deletions

View File

@@ -75,3 +75,27 @@ void RimGeoMechCellColors::initAfterRead()
{
updateIconState();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechCellColors::updateLegendCategorySettings()
{
if(this->hasCategoryResult())
{
legendConfig->setMappingMode(RimLegendConfig::CATEGORY_INTEGER);
legendConfig->setColorRangeMode(RimLegendConfig::CATEGORY);
}
else
{
if(legendConfig->mappingMode() == RimLegendConfig::CATEGORY_INTEGER)
{
legendConfig->setMappingMode(RimLegendConfig::LINEAR_CONTINUOUS);
}
if(legendConfig->colorRangeMode() == RimLegendConfig::CATEGORY)
{
legendConfig->setColorRangeMode(RimLegendConfig::NORMAL);
}
}
}