[vtkusers] How to color CellData?
David Doria
daviddoria at gmail.com
Thu Feb 5 17:50:57 EST 2009
Ah ok, I hadn't included vtkCellData.h so I was getting some super
cryptic error about invalid use of CellData. I haven't check to make
sure the colors work in the morning, but at least it compiles now!
Thanks again Amy!
On Thu, Feb 5, 2009 at 11:40 AM, Amy Squillacote <ahs at cfdrc.com> wrote:
> 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
>
>
>
--
Thanks,
David
More information about the vtkusers
mailing list