[vtkusers] can vtkDiscretizableColorTransferFunction deal with non-contiguous dicrete values?

Luca Pallozzi Lavorante lplavorante at gmail.com
Mon Aug 15 09:35:19 EDT 2016


// This is an example

std::vetor<uint32> listIds = {3, 5, 6, 7, 8};

table = vtkSmartPointer<vtkDiscretizableColorTransferFunction>::New();
table->DiscretizeOn();

table->IndexedLookupOff();

table->SetNumberOfValues(listIds.size());

foreach (uint32 id, listaIds) {

QColor color(myFunctionTogetColorsFromIds(id)) double r = color.redF();
double g = color.greenF(); double b = color.blueF();
table->AddRGBPoint(static_cast<double>(id), r, g, b); } table->Build();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160815/46beef0b/attachment.html>


More information about the vtkusers mailing list