[vtk-developers] Manual conversion of some Tcl to Python tests.

David Thompson david.thompson at kitware.com
Fri Aug 31 18:39:24 EDT 2012


>>> Maybe we could just use that.  A vtkLookupTable subclass that
>>> provides html colors, with all the standard names.
>> 
>> Hmm... I suppose you could treat the annotations as color names, but then you would lose the ability to have a note to go alongside the value.
> 
> I was thinking along the lines of a vtkLookupTable that could take a
> vtkAbstractArray as input instead of being limited to a vtkDataArray.
> There would be a discrete set of allowed input values (that could be
> strings).  It would probably be best not to hijack your annotations
> for this purpose, the list of possible input strings (and their
> mappings) would be distinct from your annotation labels.

Yup. There's not a method in vtkScalarsToColors to accept an abstract array yet. I'm sorely tempted to change MapScalars. However, you can't change MapScalars to take an abstract array without forcing subclasses to perform additional sanity checks, and you can't have both

  virtual vtkUnsignedCharArray* MapScalars(
    vtkDataArray* scalars, int colorMode, int component);

and

  virtual vtkUnsignedCharArray* MapScalars(
    vtkAbstractArray* scalars, int colorMode, int component);

without reimplementing both in every subclass that implements one... so there's no easy way to be completely backwards-compatible without just defining a new method (e.g., MapAbstractScalars()) and hoping everyone switches to that.

	David


More information about the vtk-developers mailing list