[vtkusers] How to color CellData?

David Doria daviddoria at gmail.com
Thu Feb 5 11:31:15 EST 2009


To color points, I can do this:

vtkSmartPointer<vtkUnsignedCharArray> Colors =
vtkSmartPointer<vtkUnsignedCharArray>::New();
// ... fill Colors ...
pdata->GetPointData()->AddArray(Colors);

But what if I want to color a set of lines.

vtkSmartPointer<vtkCellArray> lines = vtkSmartPointer<vtkCellArray>::New();
// ... fill lines ...
pdata->SetLines(lines);

Now how do I add the color array?

-- 
Thanks,

David



More information about the vtkusers mailing list