[vtkusers] XML format: base64 or raw

Mathieu Malaterre mathieu.malaterre at kitware.com
Fri Feb 23 15:21:26 EST 2007


Frédéric Petit wrote:
> Hi all,
> 
> I repost an old thread.
> 
> I wanted to write my data in XML format not encoded in base64, bas as 
> raw format.
> 
> Mathieu answered me something I completely did not understand,
> 
> not knowing enough in C++ (but I know a little more in C).
> 
> He also answered that it was leaving for vacation and completely overbooked.
> 
> I hope this is not the case now ;-)
> 
> So, he advised me to look at vtkXMLWriter API, starting with
> 
> void vtkXMLWriterC_SetType(int t)
> 
> {
> 
> switch(t)
> 
> {
> 
> case BINARY:
> 
> self->Writer->SetToBinaryType();
> 
> ...
> 
> }
> 
> I think I need a little more help on this, because I'm quite, to not say 
> completely, lost.

Fixed in VTK CVS.

$ cvs ci -m"ENH: Provide an API to write binary XML files" 
 

/cvsroot/VTK/VTK/IO/vtkXMLWriterC.cxx,v  <--  vtkXMLWriterC.cxx
new revision: 1.5; previous revision: 1.4
/cvsroot/VTK/VTK/IO/vtkXMLWriterC.h,v  <--  vtkXMLWriterC.h
new revision: 1.2; previous revision: 1.1
/cvsroot/VTK/VTK/IO/vtkXMLWriterF.h,v  <--  vtkXMLWriterF.h
new revision: 1.3; previous revision: 1.2



You can now use:

/**
  * Set the VTK writer data mode to either:
  * - Ascii
  * - Binary
  * - Appended (default)
  *
  * This may be used only after SetDataObjectType has been called.
  */
VTK_XML_EXPORT
void vtkXMLWriterC_SetDataModeType(vtkXMLWriterC* self, int datamodetype);


HTH
-Mathieu



More information about the vtkusers mailing list