[vtk-developers] Setting color properties directly by name in VTK.

Pat Marion pat.marion at kitware.com
Fri Jun 14 12:21:10 EDT 2013


The set color by name api in the example looks like:


nc.SetColor(sphereActor.GetProperty(),"AmbientColor","Yellow")
Perhaps an API like this instead:

sphereActor.GetProperty().SetAmbientColor(nc.GetColor("Yellow"))


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.


Pat




On Fri, Jun 14, 2013 at 12:15 PM, David Thompson <david.thompson at kitware.com
> wrote:

> Hi John,
>
> > Modifying vtkObject just so that you can set colours in Lookuptables
> strikes me as shockingly bad.
>
> 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.
>
> I am obviously in favor of adding something, although I would rather see a
> single method with this signature:
>
>     virtual void SetProperty(
>         const std::string& property, int component, const vtkVariant&);
>
> There is no reason vtkPlot cannot keep its alternate signature (as a
> deprecated method).
>
>         David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20130614/2d282847/attachment.html>


More information about the vtk-developers mailing list