[vtk-developers] C interface to write VTK XML files

tom fogal tfogal at apollo.sr.unh.edu
Tue Jun 28 12:03:51 EDT 2005


 <42C1622C.2020807 at kitware.com>Mathieu Malaterre writes:
>
>Full documentation can be found in:
>
>VTK/IO/vtkXMLWriterC.h
>VTK/IO/vtkXMLWriterC.cxx
>
>A simple test of writing a timestep cube can be found at:
>
>VTK/IO/Testing/Cxx/TestXMLCInterface.c
>-------------------------------------------
>
>The basic idea was to provide an OO-like C interface to access the 
>vtkXML*Writer classes. The C interface hold a reference to the 
>vtkDataSet you are writting. So the main difference between a C++ code 
>and the equivalent C code is that you are passing structure directly to 
>the writer (instead of creating a vtkDataSet).

Wow, thats awesome! Thanks Mathieu!

<snip>
>vtkXMLWriterC* writer = vtkXMLWriterC_New();
>/* #define VTK_UNSTRUCTURED_GRID               4 */
>vtkXMLWriterC_SetDataObjectType(writer, 4);
<snip>

I'm curious as to where all these #defines are coming from. How does
one know a VTK_UNSTRUCTURED_GRID is 4? I also saw this type of thing in
the testing interface (TestXMLCInterface.c).
Could we perhaps have a C-includable header that would allow us to use
the symblic constants?

I didn't see anything about pieces in a quick grep. Does this support
splitting the data up, like
vtkXMLStructuredDataWriter::SetNumberOfPieces(int)? Although with raw
access to the arrays, splitting the data isn't very hard anyway...

Thanks again!

-tom



More information about the vtk-developers mailing list