[vtkusers] How to change the color of a single polyline ??

Bill Lorensen bill.lorensen at gmail.com
Tue Mar 23 14:05:18 EDT 2010


Add cell data scalars to the unstructured grid. Then you have two options:

1) Assign a different cell scalar to the polyline to be highlighted
e.g. 1. Make all of the other cell scalars another value, e.g. 0.. Use
a vtkLookupTable to assign the proper colors.
2) Make each cell data scalar a unique value (say 0...n-1). Create a
vtkLookupTable with n colors. Modify the entry of the cell you want to
highlight.

Bill


On Tue, Mar 23, 2010 at 8:02 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
> On Tue, Mar 23, 2010 at 5:58 AM, Rakesh Patil <rakeshthp at in.com> wrote:
>>
>> Hello users
>>
>> I have one unstructured grid which contains more than one poly-lines and
>> poly-vertex. Now, on the other hand, I have only one actor corresponding to
>> this grid. Now what I want to do is select a particular polyline. And change
>> the color of this polyline. Initially all polylines are black in color. Once
>> i change the color, it should be reflected back in the actor only for that
>> particular polyline..
>>
>> I have only one actor.. And i guess, using this actor, if i change the
>> color, using get property, it changes the color of all the the polylines.
>> How do i change the colors of only one polyline..??
>>
>> Thanks
>>
>> Regards
>> Rakesh Patil
>>
>
> I think you are supposed to make a new actor which contains the selected
> line only, and set the color of that line.
> Thanks,
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list