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

David E DeMarle dave.demarle at kitware.com
Fri Mar 12 10:35:39 EST 2010


I could be wrong but I don't think that reader (or the vtk or the
other vt? ones) have the ability to let you choose from the available
arrays. They simply load all available arrays. Other readers, like
exodus or xdmf do.

In answer to the second question, readers always produce a whole data
object, and you have to
GetOutput()->GetPoint/CellData()->GetArray("X") to get the arrays out
of them.

David E DeMarle
Kitware, Inc.
R&D Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x109



On Tue, Mar 9, 2010 at 2:03 PM, Ben Medina <ben.medina at gmail.com> wrote:
> 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
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list