mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Make sure we don't override the color legend type chosen by the user when switching between results.
This commit is contained in:
committed by
Magne Sjaastad
parent
8a08d47ce2
commit
c0c0c2c4b8
@@ -173,6 +173,13 @@ void RimEclipseCellColors::changeLegendConfig( QString resultVarNameOfNewLegend
|
|||||||
newLegend->setTickNumberFormat( RimRegularLegendConfig::NumberFormatType::AUTO );
|
newLegend->setTickNumberFormat( RimRegularLegendConfig::NumberFormatType::AUTO );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( this->hasCategoryResult() )
|
||||||
|
{
|
||||||
|
newLegend->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER );
|
||||||
|
newLegend->setColorLegend(
|
||||||
|
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CATEGORY ) );
|
||||||
|
}
|
||||||
|
|
||||||
m_legendConfigData.push_back( newLegend );
|
m_legendConfigData.push_back( newLegend );
|
||||||
|
|
||||||
this->m_legendConfigPtrField = newLegend;
|
this->m_legendConfigPtrField = newLegend;
|
||||||
@@ -246,27 +253,6 @@ void RimEclipseCellColors::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeO
|
|||||||
void RimEclipseCellColors::updateLegendCategorySettings()
|
void RimEclipseCellColors::updateLegendCategorySettings()
|
||||||
{
|
{
|
||||||
changeLegendConfig( this->resultVariable() );
|
changeLegendConfig( this->resultVariable() );
|
||||||
|
|
||||||
if ( this->hasCategoryResult() )
|
|
||||||
{
|
|
||||||
legendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER );
|
|
||||||
legendConfig()->setColorLegend(
|
|
||||||
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CATEGORY ) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( legendConfig()->mappingMode() == RimRegularLegendConfig::MappingType::CATEGORY_INTEGER )
|
|
||||||
{
|
|
||||||
legendConfig()->setMappingMode( RimRegularLegendConfig::MappingType::LINEAR_CONTINUOUS );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( legendConfig()->colorLegend() ==
|
|
||||||
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::CATEGORY ) )
|
|
||||||
{
|
|
||||||
legendConfig()->setColorLegend(
|
|
||||||
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::NORMAL ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user