[vtkusers] Using vtkXMLStructuredGridReader to read only part of a data file

Ben Medina ben.medina at gmail.com
Tue Mar 9 14:03:28 EST 2010


I'm using a vtkXMLStructuredDataReader to read a data file. I know
that this file has 6 point arrays, because if I call Update() on the
reader, then GetPointDataArraySelection() returns 6.

However, Update() reads the entire data file into memory. My goal is
to only read in one of the point arrays. Presumably I can do this by
manipulating the instance of vtkDataArraySelection returned by
vtkXMLReader::GetPointDataArraySelection(). However, if I get the data
array selection object before calling Update(), it has zero entries in
it.

How do I specify which point arrays to load before the loading actually occurs?

On a related note, is it possible to use the reader (or some other
class) to extract an arbitrary array of data and give it to me in a
vtkDataArray? Or does one always have to go through the reader output
data object?

Thanks,
Ben



More information about the vtkusers mailing list