[vtkusers] How to color CellData?

Amy Squillacote ahs at cfdrc.com
Thu Feb 5 11:40:22 EST 2009


pdata->GetCellData()->AddArray(...)

David Doria wrote:
> 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?
>
>   

-- 
Amy Squillacote                    Phone: (256) 726-4839
Sr. Computer Scientist             Fax: (256) 726-4806
CFD Research Corporation           Web: http://www.cfdrc.com
215 Wynn Drive, Suite 501
Huntsville, AL  35805





More information about the vtkusers mailing list