<div dir="ltr"><div><div><div><div>The set color by name api in the example looks like:<br><br><table class=""><tbody><tr valign="top"><td class=""><br></td><td class=""><span class="">nc</span><span class="">.</span><span class="">SetColor</span><span class="">(</span><span class="">sphereActor</span><span class="">.</span><span class="">GetProperty</span><span class="">(),</span><span class="">"AmbientColor"</span><span class="">,</span><span class="">"Yellow"</span><span class="">)</span></td>

</tr></tbody></table><br></div>Perhaps an API like this instead:<br><br></div>sphereActor.GetProperty().SetAmbientColor(nc.GetColor("Yellow"))<br><br></div><br></div>I think that if the goal is to have dynamic properties in VTK's C++ api, it should be automated using the mechanism that is used for Python, client-server, Java, etc.  In the patch up for gerrit review, the dynamic property dispatch is manually implemented inside the SetProperty1() virtual function overload, which doesn't seem scalable.<br>

<br><br>Pat<br><div><div><br><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 14, 2013 at 12:15 PM, David Thompson <span dir="ltr"><<a href="mailto:david.thompson@kitware.com" target="_blank">david.thompson@kitware.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi John,<br>
<div class="im"><br>
> Modifying vtkObject just so that you can set colours in Lookuptables strikes me as shockingly bad.<br>
<br>
</div>I think that there is a general need for an abstract interface to set properties; setting colors just happens to be driving the change. For example, vtkPlot already has a similar method as do the statistics filters (vtkStatisticsAlgorithm::SetParameter). We are just talking about moving these down to vtkObject in order to allow the functionality elsewhere and get around some module dependency issues.<br>


<br>
I am obviously in favor of adding something, although I would rather see a single method with this signature:<br>
<br>
    virtual void SetProperty(<br>
        const std::string& property, int component, const vtkVariant&);<br>
<br>
There is no reason vtkPlot cannot keep its alternate signature (as a deprecated method).<br>
<br>
        David<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</blockquote></div><br></div>