mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1178 Use well colors for Max Fraction Tracer
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "RimFlowDiagSolution.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaColorTables.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
@@ -28,6 +29,7 @@
|
||||
#include "RigSingleWellResultsData.h"
|
||||
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimEclipseWell.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimFlowDiagSolution, "FlowDiagSolution");
|
||||
@@ -283,15 +285,29 @@ cvf::Color3f RimFlowDiagSolution::tracerColor(QString tracerName)
|
||||
|
||||
if ( eclCase )
|
||||
{
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->reservoirData()->wellResults();
|
||||
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
|
||||
|
||||
const caf::ColorTable& colorTable = RiaColorTables::wellsPaletteColors();
|
||||
|
||||
for ( size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx )
|
||||
if (activeView)
|
||||
{
|
||||
if ( wellResults[wIdx]->m_wellName == tracerName )
|
||||
RimEclipseWell* well = activeView->wellCollection->findWell(tracerName);
|
||||
if (well)
|
||||
{
|
||||
return colorTable.cycledColor3f(wIdx);
|
||||
return well->wellPipeColor();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we do not find a well color, use index in well result data to be able to get variation of tracer colors
|
||||
// This can be the case if we do not have any views at all
|
||||
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->reservoirData()->wellResults();
|
||||
|
||||
for ( size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx )
|
||||
{
|
||||
if ( wellResults[wIdx]->m_wellName == tracerName )
|
||||
{
|
||||
return RiaColorTables::wellsPaletteColors().cycledColor3f(wIdx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user