#2721 Ensemble curves. Color ranges, cyclic color range assignment. Minor refactoring

This commit is contained in:
Bjørn Erik Jensen
2018-05-04 13:06:48 +02:00
parent c400223bc6
commit 25dc96fb3b
6 changed files with 220 additions and 28 deletions

View File

@@ -19,6 +19,7 @@
#include "RimEnsembleCurveSet.h"
#include "RiaApplication.h"
#include "RiaColorTables.h"
#include "RifReaderEclipseSummary.h"
@@ -46,6 +47,14 @@
#include "qwt_symbol.h"
//--------------------------------------------------------------------------------------------------
/// Internal constants
//--------------------------------------------------------------------------------------------------
#define DOUBLE_INF std::numeric_limits<double>::infinity()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
namespace caf
{
template<>
@@ -57,11 +66,6 @@ namespace caf
}
}
//--------------------------------------------------------------------------------------------------
/// Internal constants
//--------------------------------------------------------------------------------------------------
#define DOUBLE_INF std::numeric_limits<double>::infinity()
CAF_PDM_SOURCE_INIT(RimEnsembleCurveSet, "RimEnsembleCurveSet");
@@ -208,6 +212,7 @@ void RimEnsembleCurveSet::loadDataAndUpdate(bool updateParentPlot)
}
}
m_legendConfig->initForEnsembleCurveSet(this);
updateCurveColors();
}
@@ -715,7 +720,7 @@ void RimEnsembleCurveSet::updateCurveColors()
}
else
{
curve->setColor(cvf::Color3f::GRAY);
curve->setColor(RiaColorTables::undefinedCellColor());
}
curve->updateCurveAppearance();
}
@@ -751,7 +756,7 @@ void RimEnsembleCurveSet::updateCurveColors()
rimCase->caseRealizationParameters()->parameterValue(parameterName).numericValue() :
DOUBLE_INF;
if(value != DOUBLE_INF) curve->setColor(cvf::Color3f(m_legendConfig->scalarMapper()->mapToColor(value)));
else curve->setColor(cvf::Color3f::GRAY);
else curve->setColor(RiaColorTables::undefinedCellColor());
curve->updateCurveAppearance();
}
}