[vtkusers] A question about VTK Files...

Brad King brad.king at kitware.com
Tue Sep 30 11:10:57 EDT 2003


On Tue, 30 Sep 2003, [iso-8859-1] Sergio Andrés wrote:
> I would like to use a VTK File (XML Format) to store a PolyData dataset.
>
> Furthermore, I want to include new necessary information in this file,
> by defining new customized XML tags that delimit my own data.
>
> For instance:
[snip]
>
> I am not sure that this is the right way to do this, since it could be
> problematic for VTK Readers.
>
> Maybe, it is better to include my own data in another file....

There is currently no interface in the writers or readers to add such
elements to the XML file.  However, the readers are very robust and should
ignore any extra elements they see (if they do not, there is a bug).
Therefore, if you let a VTK XML writer write the file first, you can use
another tool to insert elements anywhere but inside a DataArray or
AppendedData element. You can then write your own parser (possibly by
subclassing vtkXMLParser) to look for the extra elements while still using
the VTK XML readers to read the VTK data.

You might want to go to http://www.vtk.org/Bug to add a feature request to
VTK for adding an interface to vtkXML* classes for writing/reading such
extra elements.  I cannot say whether it will ever be implemented, though.

-Brad




More information about the vtkusers mailing list