#829 Eclipse: Set default legend mapping and color range when selecting a category result

This commit is contained in:
Magne Sjaastad
2016-09-07 11:41:02 +02:00
parent f404299702
commit cf8190cbf1
4 changed files with 36 additions and 3 deletions

View File

@@ -191,6 +191,32 @@ void RimEclipseCellColors::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOr
uiTreeOrdering.setForgetRemainingFields(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseCellColors::updateLegendCategorySettings()
{
changeLegendConfig(this->resultVariable());
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);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------