[vtk-developers] Propsosed new vtkPainter that enables/disables data using scalars

Stanton, Eric T etstant at sandia.gov
Sun Sep 21 21:00:31 EDT 2008


There is a need to be able to control the color saturatation, value, and alpha of a vtkPolyData using a different set of scalars than the ones used to color by. The use case is to be able to "enable" and "disable" edges and vertices of a graph using edge and vertex attributes that take on values of either 0 or 1. In this example, edges with scalar values of 1 would be fully saturated and opaque while those with a value of 0 would be grayed out and translucent. The "enabled" portion of the graph could then still be colored by a different attribute.

I've written a new painter to support this behavior (not committed yet) currently called vtkScalarsToHighlightPainter. It is similar to vtkScalarsToColorsPainter except that it overrides the saturation, value, and alpha of its input scalars (leaving the hue alone) using the mapped scalars from its own lookup table. I considered incorporating this functionality in to the existing vtkScalarsToColorsPainter but found that it would significantly complicate its api and implementation.

The question should be asked, though, why stop there? Why not be able to control hue, saturation, value, and alpha separately using (possibly) different lookup tables and scalars for each? That's perfectly valid. The result would be to break up vtkScalarsToColorsPainter into vtkScalarsToHuePainter, vtkScalarsToSaturationPainter, etc. The "enable/disable" behavior described above could still be produced in this case.

The major concern I have is how many VTK classes adding this new painter would affect. It would need to be added to vtkDefaultPainter's pipeline of painters. vtkPainterPolyDataMapper::UpdatePainterInformation() would need to be able to set painter-specific information properties. And vtkMapper would need new API for configuring the array to "highlight" by similar to its existing API for setting the array to color by.

Is this the right approach in order to get the enabled/disabled effect I want? If so, is there someone at Kitware who I could get guidance from with regard to its integration in to VTK?

Thanks,

Eric Stanton
Scalable Analytics and Visualization
Sandia National Labs


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20080921/7fa30d12/attachment.html>


More information about the vtk-developers mailing list