<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7000.0"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV>Hello,<BR><BR>I am currently trying to write my own quick output routine to
generate a <BR>binary file using C++. I am currently trying to avoid having to
use the vtk <BR>libraries because I only need a very basic output that doesn't
change much. <BR>I so far have the ASCII output working no problem but I can't
get the binary <BR>working.<BR><BR>I am using file.write() function to output
the binary data and that seems to <BR>be working no problem and when used in a
legacy format application it works <BR>perfectly except that the data is
LittleEndian instead of BigEndian. That's <BR>why I have moved to BigEndian
because I don't want to have to make the <BR>output routine for the data anymore
complicated that file.write.<BR><BR>I started using the xml format and
considering my output is raw binary and <BR>not base64 I changed it to be in the
AppendedData section instead of <BR>DataArray. It still isn't working right, I
get the following error when I <BR>try to load in ParaView:<BR><BR>ERROR: In
..\..\..\ParaView3\VTK\IO\vtkXMLStructuredDataReader.cxx, line
349<BR>vtkXMLImageDataReader (0ADEC7F8): Error reading extent 0 422 0 242 0 1
from <BR>piece 0<BR><BR><BR>ERROR: In
..\..\..\ParaView3\VTK\IO\vtkXMLDataReader.cxx, line
537<BR>vtkXMLImageDataReader (0ADEC7F8): Cannot read cell data array "pressure"
<BR>from PointData in piece 0. The data array in the element may be too
short.<BR><BR>The format of my output file is as follows:<BR><BR><?xml
version="1.0"?><BR><VTKFile type="ImageData" version="0.1"
byte_order="LittleEndian"><BR><ImageData WholeExtent="0 422 0 242 0 1"
Origin="0 0 0" Spacing="1 1 1"><BR><Piece Extent="0 422 0 242 0
1"><BR><PointData><BR></PointData><BR><CellData
Scalars="pressure"><BR><DataArray type="Float32" Name="pressure"
format="appended"
offset="0"/><BR></CellData><BR></Piece><BR></ImageData><BR><AppendedData
encoding="raw"><BR>_BINARYDATA<BR></AppendedData><BR></VTKFile><BR><BR>Note
following an error message I have added an _ at the start of the binary
<BR>data. Is this required?<BR><BR>One final thing, when using appended data,
how do you calculate what the <BR>offset should
be?<BR><BR>Thanks<BR>David</DIV></BODY></HTML>