mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve ensemble curve colors
* Use unique_ptr * Improve default assignment of curve appearance * Improve display of color tags in tree view items * Select curve or ensemble instead of plot * Only change curves connected to a Rim-object * Improve color management for ensemble curves Use a base color for statistics curves and set realization curves transparent Make sure new curves are assigned a unique color Harmonize how dropped addresses are handled * Update all tags always The update of tags for a subset of tree nodes is currently broken. Always update all tags. * Add const
This commit is contained in:
@@ -535,14 +535,17 @@ RimSummaryMultiPlot* RicSummaryPlotBuilder::createAndAppendSummaryMultiPlot( con
|
||||
if ( !plots.empty() )
|
||||
{
|
||||
auto* plot = plots.front();
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plot );
|
||||
if ( !plot->curveSets().empty() )
|
||||
{
|
||||
RiuPlotMainWindowTools::setExpanded( plot->curveSets().front() );
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plot->curveSets().front() );
|
||||
}
|
||||
else if ( !plot->summaryCurves().empty() )
|
||||
{
|
||||
RiuPlotMainWindowTools::setExpanded( plot->summaryCurves().front() );
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plot->summaryCurves().front() );
|
||||
}
|
||||
else
|
||||
{
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( plot );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -509,10 +509,11 @@ void RicSummaryPlotEditorUi::updatePreviewCurvesFromCurveDefinitions( const std:
|
||||
|
||||
// Set single curve set color
|
||||
auto allCurveSets = m_previewPlot->ensembleCurveSetCollection()->curveSets();
|
||||
size_t colorIndex = std::count_if( allCurveSets.begin(),
|
||||
allCurveSets.end(),
|
||||
[]( RimEnsembleCurveSet* curveSet )
|
||||
{ return curveSet->colorMode() == RimEnsembleCurveSet::ColorMode::SINGLE_COLOR; } );
|
||||
size_t colorIndex =
|
||||
std::count_if( allCurveSets.begin(),
|
||||
allCurveSets.end(),
|
||||
[]( RimEnsembleCurveSet* curveSet )
|
||||
{ return RimEnsembleCurveSetColorManager::hasSameColorForAllRealizationCurves( curveSet->colorMode() ); } );
|
||||
curveSet->setColor( RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f( colorIndex ) );
|
||||
|
||||
// Add curve to plot
|
||||
@@ -831,8 +832,10 @@ void RicSummaryPlotEditorUi::applyAppearanceToAllPreviewCurves()
|
||||
int colorIndex = 0;
|
||||
for ( auto& curveSet : m_previewPlot->ensembleCurveSetCollection()->curveSets() )
|
||||
{
|
||||
if ( curveSet->colorMode() != RimEnsembleCurveSet::ColorMode::SINGLE_COLOR ) continue;
|
||||
curveSet->setColor( RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f( colorIndex++ ) );
|
||||
if ( RimEnsembleCurveSetColorManager::hasSameColorForAllRealizationCurves( curveSet->colorMode() ) )
|
||||
{
|
||||
curveSet->setColor( RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f( colorIndex++ ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user