mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 22:13:25 -06:00
#5874 Use color legend in WellLogTrack result coloring.
This commit is contained in:
parent
5295dbe299
commit
044ab55eea
@ -2520,19 +2520,10 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot()
|
||||
m_formationCase == nullptr )
|
||||
return;
|
||||
|
||||
RimProject* proj = RimProject::current();
|
||||
RimColorLegendCollection* colorLegendCollection = proj->colorLegendCollection;
|
||||
std::vector<RimColorLegend*> legends = colorLegendCollection->customColorLegends();
|
||||
if ( legends.empty() )
|
||||
{
|
||||
RiaLogging::error( "No color legend found." );
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: let the user select the color legend instead of just picking the first one...
|
||||
std::vector<cvf::Color3ub> colors;
|
||||
std::vector<QString> namesVector;
|
||||
for ( RimColorLegendItem* legendItem : legends[0]->colorLegendItems() )
|
||||
for ( RimColorLegendItem* legendItem : m_colorShadingLegend()->colorLegendItems() )
|
||||
{
|
||||
namesVector.push_back( legendItem->categoryName() );
|
||||
}
|
||||
@ -2545,7 +2536,7 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot()
|
||||
// Need to map colors to names (since a category can be used several times)
|
||||
for ( QString nameToPlot : namesToPlot )
|
||||
{
|
||||
for ( RimColorLegendItem* legendItem : legends[0]->colorLegendItems() )
|
||||
for ( RimColorLegendItem* legendItem : m_colorShadingLegend()->colorLegendItems() )
|
||||
{
|
||||
if ( legendItem->categoryName() == nameToPlot )
|
||||
colors.push_back( cvf::Color3ub( legendItem->color() ) );
|
||||
|
Loading…
Reference in New Issue
Block a user