[vtkusers] Question ? [Reading data from txt file]

David Doria daviddoria at gmail.com
Mon Aug 6 12:50:03 EDT 2012


>
> What I could read it in VTK ?
>
> I have already tried with  example:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/InfoVis/ReadDelimitedFile
>
> But I couldn't read well data value of points/triangle.
> I received : output :
> x: 1.#QNANy: 0z: 0 n: 0 0 0
>

If you're going to use a custom file format, you'll have to write a custom
reader :)

That DelimitedTextReader is expecting only point data in the file (no
header like you have). You'd then also have to construct the triangles and
tell it when to reinterpret the data in the output table as triangle
connectivity rather than points.

I'd suggest you just do it manually using something like this:
http://programmingexamples.net/wiki/CPP/IO/FileInput and parsing the stream
manually. Then you can put it all together with:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Triangle

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120806/a374a3ab/attachment.htm>


More information about the vtkusers mailing list