[vtkusers] extracting pointdata out of vtkXMLPolyDataReader
Joeri Nicolaes
joeri_vtk at hotmail.com
Mon Aug 30 03:34:40 EDT 2004
I have written a vtk xml file (head.vtp see below) that consists of 2 points. I can read it in, but I can't extract the points out of the PolyData object. What am I doing wrong?
# trying to read an vtk polydata xml file
vtkXMLPolyDataReader reader
reader SetFileName "C:/Documents and Settings/staJN/My Documents/XMLhead/head.vtp"
# [reader GetOutput] is a polydata object!
set poly [reader GetOutput]
set points [$poly GetPoints]
puts [$poly GetNumberOfPoints]
OUTPUT: 0
Here is my xml file:
<?xml version="1.0"?>
<VTKFile type="PolyData" version="0.1" byte_order="LittleEndian">
<PolyData>
<Piece NumberOfPoints="2">
<Points>
<DataArray type="Float32" NumberOfComponents="3" format="ascii">
10 0 0 50 50 0
</DataArray>
</Points>
<PointData Scalars="my_scalars">
<DataArray type="Float32" Name="my_scalars" format="ascii">
1 1
</DataArray>
</PointData>
<CellData Scalars="cell_scalars">
<DataArray type="Int32" Name="cell_scalars" format="ascii">
0 1
</DataArray>
</CellData>
</Piece>
</PolyData>
</VTKFile>
Joeri,
Agfa Gevaert, R&D/TI
+ 32 (0) 3 444 6429,
stajn at agfa.com
joeri_vtk at hotmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040830/daec9218/attachment.htm>
More information about the vtkusers
mailing list