[vtk-developers] Is vtkDataArray GetLookupTable() ever used?

David Gobbi david.gobbi at gmail.com
Wed Nov 7 16:15:16 EST 2012


The vtkDataArray::LookupTable seems to be a purely legacy feature.
So I'm wondering if it can be removed, to eliminate the dependency
of vtkDataArray on vtkLookupTable.  This would, in fact, completely
remove the dependency of _all_ Common classes on vtkLookupTable,
except for the ones in Common/Color.

Most tellingly, VTK's xml reader/writers completely ignore the data
array lookup tables.  When the data arrays are saved in a file, their
lookup tables are not saved.  So these lookup tables do not seem to
be considered an important part of the data set.

Only the following files call vtkDataArray::GetLookupTable():

Common/Core/vtkDataArray.h
Common/Core/vtkDataArray.cxx
Common/Core/Testing/Cxx/otherArrays.cxx
Common/DataModel/vtkDataSetAttributes.cxx
IO/Geometry/vtkIVWriter.cxx
IO/Legacy/vtkDataReader.cxx
IO/Legacy/vtkDataWriter.cxx
IO/MINC/vtkMNIObjectWriter.cxx
Rendering/Core/vtkMapper.cxx
Rendering/Core/vtkPolyDataMapper2D.cxx
Rendering/Core/vtkScalarsToColorsPainter.cxx

No test failures occurred after I commented out the GetLookupTable()
lines of code in the above files.  This indicates that the data array lookup
tables are completely untested.

In summary: if the vtkDataArray::LookupTable is removed, then
vtkLookupTable and all its associated classes can be cleanly moved
from Common/Core to Common/Color.  If people aren't comfortable with
doing the removal in VTK 6.0, it would probably be worthwhile to at
least deprecate the data array Get/SetLookupTable() methods now
so they can be removed in VTK 6.2.

  - David



More information about the vtk-developers mailing list