#1113 Made tracer colors consistent, and son to be consistent with default well colors

This commit is contained in:
Jacob Støren 2017-02-02 09:56:39 +01:00
parent 8e4e7f098f
commit b26bd11674
4 changed files with 33 additions and 1 deletions

View File

@ -26,6 +26,7 @@
#include "RigFlowDiagResults.h"
#include "RigMainGrid.h"
#include "RigSingleWellResultsData.h"
#include "RimEclipseWellCollection.h"
CAF_PDM_SOURCE_INIT(RimFlowDiagSolution, "FlowDiagSolution");
@ -270,6 +271,31 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeSte
return UNDEFINED;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RimFlowDiagSolution::tracerColor(QString tracerName)
{
RimEclipseResultCase* eclCase;
this->firstAncestorOrThisOfType(eclCase);
if ( eclCase )
{
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->reservoirData()->wellResults();
for ( size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx )
{
if ( wellResults[wIdx]->m_wellName == tracerName )
{
return RimEclipseWellCollection::cycledPaletteColor(wIdx);
}
}
}
return cvf::Color3f::DARK_GRAY;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -25,6 +25,7 @@
#include "cvfBase.h"
#include "cvfObject.h"
#include "cvfColor3.h"
class RimEclipseWell;
class RigFlowDiagResults;
@ -57,6 +58,7 @@ public:
TracerStatusType tracerStatusOverall(QString tracerName);
TracerStatusType tracerStatusInTimeStep(QString tracerName, size_t timeStepIndex);
cvf::Color3f tracerColor(QString tracerName);
protected:

View File

@ -239,8 +239,10 @@ void RimWellAllocationPlot::updateFromWell()
RimWellFlowRateCurve* curve = new RimWellFlowRateCurve;
curve->setFlowValues(tracerName, connNumbers, accFlow);
curve->setColor( m_flowDiagSolution->tracerColor(tracerName));
plotTrack->addCurve(curve);
curve->loadDataAndUpdate();
}
}
@ -256,6 +258,7 @@ void RimWellAllocationPlot::updateFromWell()
RimWellFlowRateCurve* curve = new RimWellFlowRateCurve;
curve->setFlowValues("Total", connNumbers, accFlow);
curve->setColor( cvf::Color3f::DARK_GRAY);
plotTrack->addCurve(curve);

View File

@ -116,6 +116,8 @@ public:
const std::vector<cvf::ubyte>& resultWellGeometryVisibilities(size_t frameIndex);
void scheduleIsWellPipesVisibleRecalculation();
static cvf::Color3f cycledPaletteColor(size_t colorIndex);
protected:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
@ -128,7 +130,6 @@ protected:
private:
void calculateWellGeometryVisibility(size_t frameIndex);
static cvf::Color3f cycledPaletteColor(size_t colorIndex);
void updateStateForVisibilityCheckboxes();
void updateStateFromEnabledChildCount(size_t showLabelCount, caf::PdmField<caf::Tristate>* fieldToUpdate);