[Paraview] bug in vtkLookupTable?

Rafael Küng rafi.kueng at gmx.ch
Wed Dec 8 16:27:26 EST 2010


Hi There

I'm trying to get colored points and tracks with a reader, but i only 
get the first point colored.. can somebody please give me a hint? It 
looks to me that the SetTableRange(d,d) is not doing what it's supposed 
to do... (pv 3.8.0)

In position (vtkPoints) i've got 10 points, connected with lines. I 
would like to color each point according to it's snapid (vtkIdTypeArray).
So, it does some coloring, but only on the line between the 1st point 
(SnapId=0) and the second point (SnapId 1)..

Many thanks
Rafael Kueng
University of Zuerich


My code:

-----
vtkPolyData * out = vtkPolyData::GetData(outputVector);

//...generate points...

vtkSmartPointer<vtkLookupTable> lut = 
vtkSmartPointer<vtkLookupTable>::New();
lut->Build();
lut->SetTableRange(0,9);
lut->SetNumberOfTableValues(10);
lut->SetTableValue(0,1,0,0);
lut->SetTableValue(1,1,1,0);
lut->SetTableValue(2,1,1,1);
lut->SetTableValue(3,0,1,1);
//...

SnapId->SetLookupTable(lut2);

out->SetPoints(Position);
out->SetVerts(Cells);
out->SetLines(Tracks);
out->GetPointData()->AddArray(SnapId);

-----

i also tried lut->build after setting the table values, doesn't make any 
difference..


More information about the ParaView mailing list