#2496 Tensor vectors: Two new paletts

This commit is contained in:
Rebecca Cox 2018-02-27 09:39:47 +01:00
parent f4bae6f796
commit cbbc9c0f26
5 changed files with 43 additions and 20 deletions

View File

@ -197,7 +197,7 @@ const caf::ColorTable& RiaColorTables::tensorWhiteGrayBlackPaletteColors()
{
static std::vector<cvf::Color3ub> colors{
cvf::Color3ub::WHITE,
cvf::Color3ub::GRAY,
cvf::Color3ub::LIGHT_GRAY,
cvf::Color3ub::BLACK,
};
@ -208,12 +208,27 @@ const caf::ColorTable& RiaColorTables::tensorWhiteGrayBlackPaletteColors()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const caf::ColorTable& RiaColorTables::tensorMagentaBrownBlackPaletteColors()
const caf::ColorTable& RiaColorTables::tensorOrangeBlueWhitePaletteColors()
{
static std::vector<cvf::Color3ub> colors{
cvf::Color3ub::DARK_MAGENTA,
cvf::Color3ub(236, 118, 0), // Orange
cvf::Color3ub(56, 56, 255), // Vivid Blue
cvf::Color3ub(210, 248, 250), // White Turquoiseish
};
static caf::ColorTable colorTable = caf::ColorTable(colors);
return colorTable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const caf::ColorTable& RiaColorTables::tensorsMagentaBrownGrayPaletteColors()
{
static std::vector<cvf::Color3ub> colors{
cvf::Color3ub(248, 0, 170), // Magenta
cvf::Color3ub::BROWN,
cvf::Color3ub::BLACK,
cvf::Color3ub::LIGHT_GRAY,
};
static caf::ColorTable colorTable = caf::ColorTable(colors);

View File

@ -38,7 +38,8 @@ public:
static const caf::ColorTable& redWhiteBluePaletteColors();
static const caf::ColorTable& categoryPaletteColors();
static const caf::ColorTable& tensorWhiteGrayBlackPaletteColors();
static const caf::ColorTable& tensorMagentaBrownBlackPaletteColors();
static const caf::ColorTable& tensorOrangeBlueWhitePaletteColors();
static const caf::ColorTable& tensorsMagentaBrownGrayPaletteColors();
static const caf::ColorTable& angularPaletteColors();
static const caf::ColorTable& stimPlanPaletteColors();
static const caf::ColorTable& faultsPaletteColors();

View File

@ -338,19 +338,19 @@ cvf::ref<cvf::Part> RivTensorResultPartMgr::createPart(const std::vector<TensorV
cvf::ref<cvf::ScalarMapperDiscreteLinear> discreteScalarMapper = new cvf::ScalarMapperDiscreteLinear;
auto vectorColors = m_rimReservoirView->tensorResults()->vectorColors();
if (vectorColors == RimTensorResults::MAGENTA_BROWN_BLACK || vectorColors == RimTensorResults::WHITE_GRAY_BLACK)
{
activeScalerMapper = discreteScalarMapper.p();
createOneColorPerPrincipalScalarMapper(vectorColors, discreteScalarMapper.p());
createOneColorPerPrincipalTextureCoords(lineTexCoords.p(), tensorVisualizations, discreteScalarMapper.p());
}
else
if (vectorColors == RimTensorResults::RESULT_COLORS)
{
activeScalerMapper = m_rimReservoirView->tensorResults()->legendConfig()->scalarMapper();
createResultColorTextureCoords(lineTexCoords.p(), tensorVisualizations, activeScalerMapper);
}
else
{
activeScalerMapper = discreteScalarMapper.p();
createOneColorPerPrincipalScalarMapper(vectorColors, discreteScalarMapper.p());
createOneColorPerPrincipalTextureCoords(lineTexCoords.p(), tensorVisualizations, discreteScalarMapper.p());
}
caf::ScalarMapperEffectGenerator surfEffGen(activeScalerMapper, caf::PO_1);
@ -381,14 +381,19 @@ void RivTensorResultPartMgr::createOneColorPerPrincipalScalarMapper(const RimTen
cvf::Color3ubArray arrowColors;
arrowColors.resize(3);
if (colorSet == RimTensorResults::MAGENTA_BROWN_BLACK)
{
arrowColors = RiaColorTables::tensorMagentaBrownBlackPaletteColors().color3ubArray();
}
else if (colorSet == RimTensorResults::WHITE_GRAY_BLACK)
if (colorSet == RimTensorResults::WHITE_GRAY_BLACK)
{
arrowColors = RiaColorTables::tensorWhiteGrayBlackPaletteColors().color3ubArray();
}
else if (colorSet == RimTensorResults::ORANGE_BLUE_WHITE)
{
arrowColors = RiaColorTables::tensorOrangeBlueWhitePaletteColors().color3ubArray();
}
else if (colorSet == RimTensorResults::MAGENTA_BROWN_GRAY)
{
arrowColors = RiaColorTables::tensorsMagentaBrownGrayPaletteColors().color3ubArray();
}
scalarMapper->setColors(arrowColors);
scalarMapper->setRange(0.5, 3.5);

View File

@ -36,7 +36,8 @@ namespace caf
void AppEnum< RimTensorResults::TensorColors >::setUp()
{
addItem(RimTensorResults::WHITE_GRAY_BLACK , "WHITE_GRAY_BLACK", "White, Gray, Black");
addItem(RimTensorResults::MAGENTA_BROWN_BLACK, "MAGENTA_BROWN_BLACK", "Magenta, Brown, Black");
addItem(RimTensorResults::ORANGE_BLUE_WHITE, "ORANGE_BLUE_WHITE", "Orange, Blue, White");
addItem(RimTensorResults::MAGENTA_BROWN_GRAY, "MAGENTA_BROWN_GRAY", "Magenta, Brown, Gray");
addItem(RimTensorResults::RESULT_COLORS, "RESULT_COLORS", "Result Colors");
setDefault(RimTensorResults::WHITE_GRAY_BLACK);

View File

@ -43,7 +43,8 @@ public:
enum TensorColors
{
WHITE_GRAY_BLACK,
MAGENTA_BROWN_BLACK,
ORANGE_BLUE_WHITE,
MAGENTA_BROWN_GRAY,
RESULT_COLORS
};