#4157 Grid Cross Plot: Make categorisation legend more like ensemble legend

This commit is contained in:
Gaute Lindkvist
2019-03-04 15:35:48 +01:00
parent be95eefd69
commit ac7eccee88
19 changed files with 623 additions and 192 deletions

View File

@@ -48,7 +48,6 @@ CAF_PDM_SOURCE_INIT(RimGridCrossPlotCurve, "GridCrossPlotCurve");
RimGridCrossPlotCurve::RimGridCrossPlotCurve()
: m_curveSetIndex(0)
, m_categoryIndex(0)
, m_categoryCount(0)
{
CAF_PDM_InitObject("Cross Plot Points", ":/WellLogCurve16x16.png", "", "");
@@ -60,19 +59,10 @@ RimGridCrossPlotCurve::RimGridCrossPlotCurve()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurve::setCategoryInformation(int curveSetIndex, int categoryIndex, int categoryCount)
void RimGridCrossPlotCurve::setCategoryInformation(int curveSetIndex, int categoryIndex)
{
m_curveSetIndex = curveSetIndex;
m_categoryIndex = categoryIndex;
m_categoryCount = categoryCount;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurve::setUseContrastColors(bool useContrastColors)
{
m_useContrastColors = useContrastColors;
m_categoryIndex = categoryIndex;
}
//--------------------------------------------------------------------------------------------------
@@ -90,7 +80,7 @@ void RimGridCrossPlotCurve::setSamples(const std::vector<double>& xValues, const
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurve::updateCurveAppearance()
{
determineColorAndSymbol();
determineSymbol();
RimPlotCurve::updateCurveAppearance();
}
@@ -105,30 +95,10 @@ int RimGridCrossPlotCurve::categoryIndex() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurve::determineColorAndSymbol()
void RimGridCrossPlotCurve::determineSymbol()
{
if (m_useContrastColors)
{
const caf::ColorTable& colors = RiaColorTables::categoryPaletteColors();
int colorIndex = m_categoryIndex + m_curveSetIndex; // Offset cycle for each curve set
setColor(colors.cycledColor3f(colorIndex));
int numColors = (int)colors.size();
// Retain same symbol until we've gone full cycle in colors
int symbolIndex = m_categoryIndex / numColors;
RiuQwtSymbol::PointSymbolEnum symbol = RiuQwtSymbol::cycledSymbolStyle(m_curveSetIndex, symbolIndex);
setSymbol(symbol);
}
else
{
const caf::ColorTable& colors = RiaColorTables::contrastCategoryPaletteColors();
cvf::Color3ub cycledBaseColor = colors.cycledColor3ub(m_curveSetIndex);
caf::ColorTable hueConstColTable = RiaColorTables::createBrightnessBasedColorTable(cycledBaseColor, m_categoryCount);
setColor(hueConstColTable.cycledColor3f(m_categoryIndex));
RiuQwtSymbol::PointSymbolEnum symbol = RiuQwtSymbol::cycledFilledSymbolStyle(m_curveSetIndex);
setSymbol(symbol);
}
RiuQwtSymbol::PointSymbolEnum symbol = RiuQwtSymbol::cycledFilledSymbolStyle(m_curveSetIndex);
setSymbol(symbol);
}
//--------------------------------------------------------------------------------------------------