#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

@@ -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);