[vtkusers] Setting colors to individual cell

R K Shyamprakash ramakrishna.prakash at quest-global.com
Sun Apr 20 05:09:37 EDT 2003


Hi Nanditha,
       Following a code snippet which should solve your problem. I am
assuming your polydata has some scalar value. The code is in JAVA.

double color = 10.0; // different scalar value
((vtkFloatArray)yourPolyData.GetCellData().GetScalars()).SetValue(cellId,col
or); //cell Id is picked cell's id
yourPolyData.Modified();

regards
Shyam

-----Original Message-----
From: vtkusers-admin at public.kitware.com
[mailto:vtkusers-admin at public.kitware.com]On Behalf Of Nanditha Thakur
Sent: Friday, April 18, 2003 6:21 PM
To: Jonathan Bailleul
Cc: VTK-User
Subject: Re: Re: [vtkusers] Setting colors to individual cell


Hi Jonathan,
              I still have not succeeded in my method. I am able
to change the scalar value, but the result is far from satisfying.
Can you please elborate on your approach. It will be of great
help.

thanks
Nanditha
On Thu, 03 Apr 2003 Jonathan Bailleul wrote :
>Nanditha Thakur wrote:
> >
> > Hello Users,
> >                I have a 3D object. Can I set different color
>to
> > some of the cells(or points) of this object? This is how my
> > requirement is going to be. Say my actor is blue in color.I
>will
> > pick some of the cells of the object by clicking on it. Now I
>want
> > to set, say red color, to these picked cells. Is it possible
>to do
> > so in VTK? Help!
> >
> > Thanks
> > Nanditha
> >
>
>
>Dear Nanditha,
>
>I am just dealing with a similar problem right now! My choice
>consisted
>in glyphing the points of the selected cell instead, since I just
>didn't
>figure out how to proceed otherwise.
>
>I still have problems to solve, but it seems fairly usable. Let
>me know
>if you need to know more about this, or if you managed to do what
>you
>planned!
>
>Best Regards,
>
>
>--
>-----------------------------------
>Jonathan BAILLEUL, Doctorant
>GREYC Image - Université de Caen
>http://www.greyc.ismra.fr/~bailleul
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers



_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list