From cb20cc0bd0a01e91ff4c7ca347353b79095959cb Mon Sep 17 00:00:00 2001 From: djairoh Date: Wed, 29 May 2024 21:05:31 +0200 Subject: [PATCH] fix: slight tweak to lGlyph colour maps --- particle-track-and-trace/src/layers/luts.cpp | 29 ++++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/particle-track-and-trace/src/layers/luts.cpp b/particle-track-and-trace/src/layers/luts.cpp index eac57e1..56b1745 100644 --- a/particle-track-and-trace/src/layers/luts.cpp +++ b/particle-track-and-trace/src/layers/luts.cpp @@ -14,7 +14,8 @@ vtkSmartPointer buildComplementary() { vtkNew colorTransferFunction; colorTransferFunction->AddRGBPoint(0, 0.317647, 0.52549, 0.329412); - colorTransferFunction->AddRGBPoint(49, 0.584, 0.584, 0.584); + colorTransferFunction->AddRGBPoint(49, 0.082, 0.129, 0.082); + double c[3]; int idx=0; @@ -43,8 +44,8 @@ vtkSmartPointer buildDesaturated() { lut->Build(); vtkNew colorTransferFunction; - colorTransferFunction->AddRGBPoint(0, 0.313725, 0.313725, 0.313725); - colorTransferFunction->AddRGBPoint(49, 0.909804, 0.909804, 0.909804); + colorTransferFunction->AddRGBPoint(0, 0.909804, 0.909804, 0.909804); + colorTransferFunction->AddRGBPoint(49, 0.313725, 0.313725, 0.313725); double c[3]; int idx=0; @@ -265,7 +266,29 @@ vtkSmartPointer buildDensityMonochromatic() { vtkSmartPointer buildDensityDesaturated() { + // uses a modified grayC colour map. + // https://www.fabiocrameri.ch/colourmaps/ vtkNew lut; + lut->SetNumberOfColors(100); + lut->SetTableRange(0, 99); + lut->SetScaleToLinear(); + lut->Build(); + vtkNew colorTransferFunction; + colorTransferFunction->AddRGBPoint(0, 0.313725, 0.313725, 0.313725); + colorTransferFunction->AddRGBPoint(9, 0.909804, 0.909804, 0.909804); + double c[3]; + + int idx=0; + for (double opacity=0.5; opacity <= 1.0; opacity+=0.05) { + for (int i=0; i < 10; i++) { + colorTransferFunction->GetColor(i, c); + lut->SetTableValue(idx++, c[0], c[1], c[2], opacity); + } + } + + lut->UseBelowRangeColorOn(); + lut->SetBelowRangeColor(0,0,0,0); + lut->SetNanColor(0.0,0,0,0); return lut; }