<div dir="ltr">I suspect what is happening is that SetTuple is fast but does not mark the data as modified. So the rendering engine has no idea you changed the data. Try calling Modified() on the Scalars after changing its data. That "should" work, if it doesn't you can try calling Modified() on the PointData().<div><br></div><div>Thanks</div><div>Ken</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 28, 2016 at 3:08 PM, kent myers via vtkusers <span dir="ltr"><<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have found several posts from the last few years asking basically the same<br>
question that I am asking, and they have not gotten an answer.  My<br>
application is Java, but I think the technique should be the same as for<br>
C++.<br>
<br>
I have created an actor with a vtkPolyDataMapper using output from a<br>
vtkVertexGlyphFilter using vtkPolyData of vtkPoints. I have created a<br>
vtkUnsignedCharArray with an entry for each point.  Each entry in the array<br>
is a "short" color triplet of rgb values in range 0 to 255.  The<br>
vtkUnsignedCharArray is assigned to the vtkPolyData object using<br>
GetPointData().SetScalars(). This renders exactly as expected.<br>
<br>
Now I want to change the color of one of the rendered points based on<br>
selection of the point.   I am presently using the SetTuple3 to update the<br>
selected entry in the vtkUnsignedCharArray with a new color triplet.  This<br>
has no effect.  I have also tried calling the<br>
polyData.GetPointData().SetScalars() with the updated vtkUnsignedCharArray.<br>
No effect.<br>
<br>
I have verified that the array of color triplets is updated by calling<br>
GetTuple3.<br>
<br>
I also tried using double values for the colors using a range of 0 to 255<br>
and also 0 to 1, and tried assigning a color lookup table to the mapper and<br>
SetColorModeToMapScalars instead of SetColorModeToDefault. This did not work<br>
either.<br>
<br>
Can anyone give me a suggestion about how to change the color of a point<br>
that already has a color assigned?  It doesn't seem like this should be so<br>
hard to do.<br>
<br>
Thanks,<br>
Kent<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Changing-color-of-point-after-selection-tp5736910.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/Changing-color-of-point-after-selection-tp5736910.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br>518 371 3971<div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div>
</div>