[vtk-developers] EnSight reader changes

Berk Geveci berk.geveci at kitware.com
Tue Sep 6 16:37:21 EDT 2005


Amy and I have been working on changing EnSight reader so that instead of
creating multiple outputs, it will create one composite output
(vtkHierarchicalDataSet). EnSight reader has always been a problem because,
unlike other VTK readers, it has to be updated before it's outputs can be
accessed:

vtkSomeEnSightReader reader
reader SetFileName foo
reader Update

set numOuts [reader GetNumberOfOutputs]

vtkSomeFilter filter
filter SetInput [reader GetOutput N]

With the addition of composite datasets to VTK, this is no longer
necessary. Multi-block/part readers  can now have one output and produce one
vtkHierarchicalDataSet that contains all the blocks.
The drawback is that some of the user code will have to change in two ways:

1. EnSight readers will now have 1 output
2. Processing composite datasets requires either using special filters or
having a composite data-aware consumer (for example mapper or geometry
filter)

Here is an example pipeline:

vtkSomeEnSightReader reader
reader SetFileName foo

vtkContourFilter contour
contour SetInputConnection [reader GetOutputPort]

vtkHierarchicalPolyDataMapper mapper
mapper SetInputConnection [contour GetOutputPort]

or

vtkHierarchicalDataSetGeometryFilter geom
geom SetInputConnection [contour GetOutputPort]

vtkPolyDataMapper mapper
mapper SetInputConnection [geom GetOutputPort]

We plan to commit the changes either later this week or early next
week. This change will not be in VTK 5.0. Once we commit the change, I will
point out some tests/examples that demonstrate how the user code should be
changed.



More information about the vtk-developers mailing list