[vtkusers] reading a vtu file with vtkXMLUnstructuredGridReader

Murat Aydın murat.aydin at netcad.com.tr
Mon Dec 7 03:40:34 EST 2009


Hi,

I am writing a vtkUnstructuredGrid to a vtu file with the following  code:

vtk.vtkXMLUnstructuredGridWriter w = new vtk.vtkXMLUnstructuredGridWriter();

string ltempFile = filePath;

w.SetFileName(ltempFile);

w.SetDataModeToBinary();

w.SetInput(((vtk.vtkUnstructuredGrid)block));

w.write();

The generated vtu file is in attachments.

Then i read it with:

vtk.vtkXMLUnstructuredGridReader w2 = new vtk.vtkXMLUnstructuredGridReader();

w2.SetFileName(filePath);

w2.Update();

But the output data has no cells,no points etc..

When i delete the PointData and CellData XML elements, i can read the file succesfully.

Am i missing something in reading or writing ?

Kind Regards,



murat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091207/f16346f9/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Block.vtu
Type: application/octet-stream
Size: 18729 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091207/f16346f9/attachment.obj>


More information about the vtkusers mailing list