3D Cross Plot: Improve colors and symbols in legend

This commit is contained in:
Gaute Lindkvist
2019-02-21 15:42:02 +01:00
parent 6b3808b696
commit 7e57ec39ea
10 changed files with 93 additions and 15 deletions

View File

@@ -43,18 +43,30 @@ CAF_PDM_SOURCE_INIT(RimGridCrossPlotCurve, "GridCrossPlotCurve");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurve::determineColorAndSymbol(int curveSetIndex, int categoryIndex, bool contrastColors)
void RimGridCrossPlotCurve::determineColorAndSymbol(int curveSetIndex, int categoryIndex, int nCategories, bool contrastColors)
{
const caf::ColorTable& colors = RiaColorTables::contrastCategoryPaletteColors();
int colorIndex = categoryIndex + curveSetIndex; // Offset cycle for each curve set
setColor(colors.cycledColor3f(colorIndex));
int numColors = (int) colors.size();
if (contrastColors)
{
const caf::ColorTable& colors = RiaColorTables::contrastCategoryPaletteColors();
int colorIndex = categoryIndex + 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 = categoryIndex / numColors;
RiuQwtSymbol::PointSymbolEnum symbol = RiuQwtSymbol::cycledSymbolStyle(curveSetIndex, symbolIndex);
setSymbol(symbol);
// Retain same symbol until we've gone full cycle in colors
int symbolIndex = categoryIndex / numColors;
RiuQwtSymbol::PointSymbolEnum symbol = RiuQwtSymbol::cycledSymbolStyle(curveSetIndex, symbolIndex);
setSymbol(symbol);
}
else
{
const caf::ColorTable& colors = RiaColorTables::contrastCategoryPaletteColors();
cvf::Color3ub cycledBaseColor = colors.cycledColor3ub(curveSetIndex);
caf::ColorTable hueConstColTable = RiaColorTables::createBrightnessBasedColorTable(cycledBaseColor, nCategories);
setColor(hueConstColTable.cycledColor3f(categoryIndex));
RiuQwtSymbol::PointSymbolEnum symbol = RiuQwtSymbol::cycledFilledSymbolStyle(curveSetIndex);
setSymbol(symbol);
}
}
//--------------------------------------------------------------------------------------------------
@@ -65,6 +77,8 @@ RimGridCrossPlotCurve::RimGridCrossPlotCurve()
CAF_PDM_InitObject("Cross Plot Points", ":/WellLogCurve16x16.png", "", "");
setLineStyle(RiuQwtPlotCurve::STYLE_NONE);
setLineThickness(0);
setSymbol(RiuQwtSymbol::SYMBOL_NONE);
setSymbolSize(6);
}