Hello everyone,
I am trying to colour a 2D representation with a contour plot for which I am using vtkBandedPolyDataContourFilter. The available examples show very neat constant colouring within the bands, so I am a little confused by what I am getting here:
As you can see, I extract some bands as I can draw their lines, but the colouring inside the bands looks quite blurred. Here is the responsible section of code:
auto bf = vtkBandedPolyDataContourFilter::New();
bf->SetInputConnection(visualization);
bf->SetGenerateContourEdges(true);
bf->SetScalarModeToValue();
bf->GenerateValues(scalingData->GetColourResolution(), scalarRange);
bf->Update();
vtkNew<vtkLookupTable> lut;
lut->SetNumberOfTableValues(scalingData->GetColourResolution());
lut->SetTableRange(scalarRange);
lut->SetHueRange(.667, 0.0);
lut->SetAlphaRange(1., 1.);
lut->IndexedLookupOff();
lut->Build();
vtkNew<vtkPolyDataMapper> edgeMapper;
edgeMapper->SetInputData(bf->GetContourEdgesOutput());
edgeMapper->SetResolveCoincidentTopologyToPolygonOffset();
vtkNew<vtkActor> edgeActor;
edgeActor->SetMapper(edgeMapper);
edgeActor->GetProperty()->SetColor(0, 0, 0);
vtkNew<vtkPolyDataMapper> testAusgabe;
testAusgabe->SetInputConnection(bf->GetOutputPort());
testAusgabe->SetLookupTable(lut);
testAusgabe->SetScalarRange(scalarRange);
testAusgabe->SetScalarModeToUsePointData();
//testAusgabe->SetColorModeToMapScalars();
testAusgabe->Update();
vtkNew<vtkActor> testAktor;
testAktor->SetMapper(testAusgabe);
It seems I am stuck here, so I would appreciate any pointers in the right direction.
Kind regards,
Jan