[vtkusers] Graph vertex coloring not working

Jeff Baumes jeff.baumes at kitware.com
Tue Mar 30 10:17:43 EDT 2010


On Tue, Mar 30, 2010 at 9:00 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
> On Mon, Mar 29, 2010 at 9:42 PM, Jeff Baumes <jeff.baumes at kitware.com> wrote:
>> vtkGraphLayoutView does not support a special unsigned char array
>> named "color" for coloring vertices. You will need to use an array
>> with normal scalar values (e.g. a vtkIntArray) and then use
>> vtkViewTheme's point lookup table to set up the proper mapping of
>> integers to colors.
>>
> Isn't that what this function is for:
> http://www.vtk.org/doc/nightly/html/classvtkGraphLayoutView.html#a45b37f2ed2ee24681616deea31b98e00

This is for setting the name of the scalar array that will be sent
through the lookup table. The named array is not intended to hold
color values directly.

> I did what you said (using a vtkViewTheme) and it still seems to have
> the problem of 2 vertices get colored one color (red) and two another
> (green).

You are close. You only set 2 table values, so all scalars will be
mapped to one or the other. If you add intermediate table values you
would be ok.

Jeff



More information about the vtkusers mailing list