[vtk-developers] Is vtkDataArray GetLookupTable() ever used?
John Platt
jcplatt at dsl.pipex.com
Thu Nov 8 03:59:47 EST 2012
Hi David,
Yes.
I find this a very useful feature and use it to share the same LUT across
data arrays for each of the grids in the visualisation. It seems a safe and
well designed way to ensure all the mappers produce the correct colours.
It is also very convenient when switching attribute data (cell/point,
scalars/vectors) not to have to find the new range then hunt down the
mapper's and change the range.
Here are a couple of my use cases:
1. Point data is discontinuous across some element boundaries in a finite
element analysis (typically the field
gradients). My solution is to create separate unstructured grids for the
elements where the point data is continuous. By using the same LUT for the
point data in each of the grids, I can easily create a single legend for all
the grids and manipulate the range without reference to any of the mapper's.
2. Animation of transient data. Data for each time step is stored at the
start as field data all sharing the same LUT. Animation proceeds by simply
assigning the field data as attribute data. Again, no knowledge of the
mapper is required.
It is the separation of the data from the mapper which makes these cases
easy to deal with. I suppose the question should be whether the LUT is a
property of the data or the mapper. In my view it is the former but you have
far more experience.
Thanks for your consideration.
John.
----- Original Message -----
From: "David Gobbi" <david.gobbi at gmail.com>
To: "VTK Developers" <vtk-developers at vtk.org>
Sent: Wednesday, November 07, 2012 9:15 PM
Subject: [vtk-developers] Is vtkDataArray GetLookupTable() ever used?
> 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
> _______________________________________________
> 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
>
>
More information about the vtk-developers
mailing list