[vtkusers] vtkViewTheme and vtkLookupTable

David Doria daviddoria+vtk at gmail.com
Tue Sep 14 10:26:19 EDT 2010


When using a vtkLookupTable with a vtkViewTheme, it seems to clamp the input
range of the table to the range of the array used.

(Based on this example:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Graphs/ColorVertices )

That example works correctly - a red, white, and blue vertex is displayed.
However, if I change it to:

// This is all the same
  vtkSmartPointer<vtkLookupTable> lookupTable =
    vtkSmartPointer<vtkLookupTable>::New();
  lookupTable->SetNumberOfTableValues(3);
  lookupTable->SetTableValue(0, 1.0, 0.0, 0.0); // red
  lookupTable->SetTableValue(1, 1.0, 1.0, 1.0); // white
  lookupTable->SetTableValue(2, 0.0, 0.0, 1.0); // blue
  lookupTable->SetTableRange(0,2);
  lookupTable->Build();

// This changed
*  vertexColors->InsertNextValue(1); // This changed from 0 to a 1*
  vertexColors->InsertNextValue(1);
  vertexColors->InsertNextValue(2);

I would expect the output to be two white vertices and a blue vertex.
Instead, I see two RED vertices (the lowest value in the table) and a blue
vertex.
<http://www.vtk.org/Wiki/VTK/Examples/Cxx/Graphs/ColorVertices>
Anyone know how to prevent this?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100914/2d8aa884/attachment.htm>


More information about the vtkusers mailing list