[vtk-developers] vtkProperty :- Get/SetColor

David Thompson david.thompson at kitware.com
Mon May 13 11:13:06 EDT 2013


> Does anyone know why these methods are not virtual?

Nope.

> If there is no reason, can anyone see a problem with making these methods virtual?

I'll be happy to review a patch to make SetColor virtual. Most Get methods are not virtual because they return state held directly by the instance and should not be overridden. They are also typically called in tight loops while Set methods are not.

> The reason I am looking at this is that I am considering making the methods in vtkNamedColors virtual so that that this class can be subclassed. It would also be easy to so the same change to Get/SetColor in vtkProperty.
> I am thinking it would be nice to do things in a subclass of vtkProperty such as SetColor("Red") etc.


That sounds neat.

	David




More information about the vtk-developers mailing list