#5874 Remove direct accessor to obsoleted RimRegularLegendConfig::colorRange field.

This commit is contained in:
Kristian Bendiksen
2020-05-23 10:57:09 +02:00
committed by Magne Sjaastad
parent f578f1f954
commit 0b9577df71
11 changed files with 48 additions and 34 deletions

View File

@@ -56,7 +56,8 @@ RimWellRftEnsembleCurveSet::RimWellRftEnsembleCurveSet()
CAF_PDM_InitFieldNoDefault( &m_ensembleLegendConfig, "LegendConfig", "", "", "", "" );
m_ensembleLegendConfig = new RimRegularLegendConfig();
m_ensembleLegendConfig->setColorRange( RimEnsembleCurveSetColorManager::DEFAULT_ENSEMBLE_COLOR_RANGE );
m_ensembleLegendConfig->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimEnsembleCurveSetColorManager::DEFAULT_ENSEMBLE_COLOR_RANGE ) );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -171,7 +171,8 @@ void RimGridCrossPlotDataSet::setCellFilterView( RimGridView* cellFilterView )
if ( eclipseView->eclipseCase() && eclipseView->eclipseCase()->activeFormationNames() )
{
m_grouping = GROUP_BY_FORMATION;
m_groupingProperty->legendConfig()->setColorRange( RimRegularLegendConfig::CATEGORY );
m_groupingProperty->legendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) );
}
RimGridCrossPlot* parentPlot = nullptr;
@@ -867,17 +868,17 @@ void RimGridCrossPlotDataSet::fieldChangedByUi( const caf::PdmFieldHandle* chang
{
if ( m_grouping == GROUP_BY_TIME )
{
legendConfig()->setColorRange( RimRegularLegendConfig::NORMAL );
legendConfig()->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::NORMAL ) );
legendConfig()->setMappingMode( RimRegularLegendConfig::CATEGORY_INTEGER );
}
else if ( groupingByCategoryResult() )
{
legendConfig()->setColorRange( RimRegularLegendConfig::CATEGORY );
legendConfig()->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) );
legendConfig()->setMappingMode( RimRegularLegendConfig::CATEGORY_INTEGER );
}
else
{
legendConfig()->setColorRange( RimRegularLegendConfig::NORMAL );
legendConfig()->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::NORMAL ) );
legendConfig()->setMappingMode( RimRegularLegendConfig::LINEAR_DISCRETE );
}
@@ -1308,7 +1309,8 @@ void RimGridCrossPlotDataSet::setDefaults()
if ( eclipseCase->activeFormationNames() )
{
m_grouping = GROUP_BY_FORMATION;
m_groupingProperty->legendConfig()->setColorRange( RimRegularLegendConfig::CATEGORY );
m_groupingProperty->legendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) );
}
}
}

View File

@@ -250,7 +250,7 @@ void RimEclipseCellColors::updateLegendCategorySettings()
if ( this->hasCategoryResult() )
{
legendConfig()->setMappingMode( RimRegularLegendConfig::CATEGORY_INTEGER );
legendConfig()->setColorRange( RimRegularLegendConfig::CATEGORY );
legendConfig()->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) );
}
else
{
@@ -259,9 +259,9 @@ void RimEclipseCellColors::updateLegendCategorySettings()
legendConfig()->setMappingMode( RimRegularLegendConfig::LINEAR_CONTINUOUS );
}
if ( legendConfig()->colorRange() == RimRegularLegendConfig::CATEGORY )
if ( legendConfig()->colorLegend() == RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) )
{
legendConfig()->setColorRange( RimRegularLegendConfig::NORMAL );
legendConfig()->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::NORMAL ) );
}
}
}

View File

@@ -194,7 +194,8 @@ RimEclipseView::RimEclipseView()
this->cellResult()->setReservoirView( this );
this->cellEdgeResult()->setReservoirView( this );
this->cellEdgeResult()->legendConfig()->setColorRange( RimRegularLegendConfig::PINK_WHITE );
this->cellEdgeResult()->legendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::PINK_WHITE ) );
this->faultResultSettings()->setReservoirView( this );

View File

@@ -86,7 +86,7 @@ void RimGeoMechCellColors::updateLegendCategorySettings()
if ( this->hasCategoryResult() )
{
legendConfig->setMappingMode( RimRegularLegendConfig::CATEGORY_INTEGER );
legendConfig->setColorRange( RimRegularLegendConfig::CATEGORY );
legendConfig->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) );
}
else
{
@@ -95,9 +95,9 @@ void RimGeoMechCellColors::updateLegendCategorySettings()
legendConfig->setMappingMode( RimRegularLegendConfig::LINEAR_CONTINUOUS );
}
if ( legendConfig->colorRange() == RimRegularLegendConfig::CATEGORY )
if ( legendConfig->colorLegend() == RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) )
{
legendConfig->setColorRange( RimRegularLegendConfig::NORMAL );
legendConfig->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::NORMAL ) );
}
}
}

View File

@@ -240,7 +240,8 @@ void RimIntersectionResultDefinition::updateLegendRangesTextAndVisibility( const
( !this->isEclipseResultDefinition() && m_geomResultDefinition()->hasCategoryResult() ) )
{
regularLegendConfig()->setMappingMode( RimRegularLegendConfig::CATEGORY_INTEGER );
regularLegendConfig()->setColorRange( RimRegularLegendConfig::CATEGORY );
regularLegendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) );
}
else
{
@@ -249,9 +250,11 @@ void RimIntersectionResultDefinition::updateLegendRangesTextAndVisibility( const
regularLegendConfig()->setMappingMode( RimRegularLegendConfig::LINEAR_CONTINUOUS );
}
if ( regularLegendConfig()->colorRange() == RimRegularLegendConfig::CATEGORY )
if ( regularLegendConfig()->colorLegend() ==
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::CATEGORY ) )
{
regularLegendConfig()->setColorRange( RimRegularLegendConfig::NORMAL );
regularLegendConfig()->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::NORMAL ) );
}
}

View File

@@ -607,13 +607,20 @@ void RimRegularLegendConfig::updateFieldVisibility()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimRegularLegendConfig::setColorRange( ColorRangesType colorMode )
void RimRegularLegendConfig::setColorLegend( RimColorLegend* colorLegend )
{
m_colorRangeMode_OBSOLETE = colorMode;
m_colorLegend = mapToColorLegend( colorMode );
m_colorLegend = colorLegend;
updateLegend();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimColorLegend* RimRegularLegendConfig::colorLegend() const
{
return m_colorLegend();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -109,8 +109,6 @@ public:
typedef caf::AppEnum<MappingType> MappingEnum;
void recreateLegend();
void setColorRange( ColorRangesType colorMode );
ColorRangesType colorRange() { return m_colorRangeMode_OBSOLETE(); }
void setColorLegend( RimColorLegend* colorLegend );
RimColorLegend* colorLegend() const;
void setMappingMode( MappingType mappingType );

View File

@@ -148,7 +148,7 @@ void RimStimPlanColors::loadDataAndUpdate()
RimRegularLegendConfig* legendConfig = new RimRegularLegendConfig();
legendConfig->resultVariableName = resultNameUnitString;
legendConfig->setMappingMode( RimRegularLegendConfig::LINEAR_DISCRETE );
legendConfig->setColorRange( RimRegularLegendConfig::STIMPLAN );
legendConfig->setColorLegend( RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::STIMPLAN ) );
m_legendConfigurations.push_back( legendConfig );
}

View File

@@ -124,7 +124,8 @@ RimEnsembleCurveSet::RimEnsembleCurveSet()
CAF_PDM_InitFieldNoDefault( &m_legendConfig, "LegendConfig", "", "", "", "" );
m_legendConfig = new RimRegularLegendConfig();
m_legendConfig->setColorRange( RimEnsembleCurveSetColorManager::DEFAULT_ENSEMBLE_COLOR_RANGE );
m_legendConfig->setColorLegend(
RimRegularLegendConfig::mapToColorLegend( RimEnsembleCurveSetColorManager::DEFAULT_ENSEMBLE_COLOR_RANGE ) );
CAF_PDM_InitFieldNoDefault( &m_curveFilters, "CurveFilters", "Curve Filters", "", "", "" );
m_curveFilters = new RimEnsembleCurveFilterCollection();