[vtkusers] xml data extraction

Paul Cochrane cochrane at esscc.uq.edu.au
Mon Feb 21 03:38:42 EST 2005


Hi all,

I'm a newbie to vtk, and have a question concerning the process of reading
data from vtk xml files into vtk so that I can then manipulate and view the
data.

The vtk xml file contains an UnstructuredGrid, with Points for the locations
of the data, PointData containing the scalar values of the data at those
points, and various CellData elements containing tags, and connectivity etc.  
The process that I'm using is to read the data in like so:

reader = vtk.vtkXMLUnstructuredGridReader()
reader.SetFileName("geom26.xml")

But then I run into my first wall.  What do I do then? I assume that I
should use some kind of data mapper, so I'd do something like:

particleMapper = vtk.vtkDataSetMapper()
particleMapper.SetInput(reader.GetOutput())

But what data out of the UnstructuredGrid did I just grab?  I want to
generate spheres at the locations of the Points, with radii from the
PointData, and use other attributes defined in the CellData to specify such
things as colour etc.  How do I do this?  

I have read the vtk User's Guide, and _many_ of the examples, but it still
isn't clear to me how vtk thinks.  I.e. where do I pipe what data to what
object (and importantly why?).

Many thanks in advance for any assistance.

Paul Cochrane

-- 
Paul Cochrane
Computational Scientist/Software Developer
Earth Systems Science Computational Centre
University of Queensland
Brisbane
Queensland 4072
Australia

E: cochrane at esscc dot uq dot edu dot au



More information about the vtkusers mailing list