views:

211

answers:

1

I have a simulation in C++ which generates huge amount of data. Right now I am using MATLAB libraries to save the results as a .mat file, but eventually I will be needing an open source binary format. I don't want to implement my own binary format and ASCII is not an option. I heard that VTK provides .vtk binary file format for saving 3d data structures, which is exactly what I need. Is there a good C/C++ library for reading/writing VTK files?

+1  A: 

Yes, there is a good library providing .vtk files I/O, and it is called... wait for it... VTK! :)

http://www.vtk.org/doc/release/4.2/html/classvtkUnstructuredGridWriter.html

http://www.vtk.org/doc/release/4.2/html/classvtkUnstructuredGridReader.html

(There are many other readers/writers to suit your data type).

e.tadeu
BTW, VTK isn't always the best file format... consider using HDF5:http://www.hdfgroup.org/HDF5/
e.tadeu