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

Rakesh Patil rakeshthp at in.com
Wed Mar 24 00:44:09 EDT 2010


 Hello,Its not the question of highlighting... I'm working on FEM based mesh generation application.. So, I draw a line and have to set the property for this line. I mean polyline.. This line is classified into two, closed boundary or open boundary. So, initially when i draw a line, it has unassigned value.. i.e. boundary is not defined.. Thus it is black in color.. THen i select this line and change the properties.. If it is set to be an open boundary then it should be of say green color... and if it is of closed boundary, I need to show it in say brown color.. And this color will remain unchanged till end. I mean till mesh is generated, till file is saved. And even after file is reloaded, based on the property the same color it should show..I hope the problem is clear... :) Any solutions for this..??ThanksRegardsRakesh Patil Original message From:Bill Lorensen< bill.lorensen at gmail.com >Date: 23 Mar 10 23:35:18Subject:Re: [vtkusers] How to change the color of a single polyli
 ne ??To: David Doria Add cell data scalars to the unstructured grid. Then you have two options:1) Assign a different cell scalar to the polyline to be highlightede.g. 1. Make all of the other cell scalars another value, e.g. 0.. Usea vtkLookupTable to assign the proper colors.2) Make each cell data scalar a unique value (say 0...n1). Create avtkLookupTable with n colors. Modify the entry of the cell you want tohighlight.BillOn Tue, Mar 23, 2010 at 8:02 AM, David Doriawrote:> On Tue, Mar 23, 2010 at 5:58 AM, Rakesh Patilwrote:>>>> Hello users>>>> I have one unstructured grid which contains more than one polylines and>> polyvertex. 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.. A
 nd 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 opensource projects at> http://www.kitware.com/opensource/opensource.html>> Please keep messages ontopic and check the VTK FAQ at:> http://www.vtk.org/Wiki/VTKFAQ>> Follow this link to subscribe/unsubscribe:> http://www.vtk.org/mailman/listinfo/vtkusers>> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100324/9d01dc96/attachment.htm>


More information about the vtkusers mailing list