[vtkusers] Getting Point Data from vtkPolyData object

T.R.Shashwath trshash84 at gmail.com
Sat Jul 25 08:46:27 EDT 2009


On Friday 24 Jul 2009 11:16:36 pm Venkattraman A wrote:
> Hi,
>
> I have a vtkPolyDataReader that reads in a very small input file with two
> scalars and 6 data points. I use that to create an XYPlot and it all works
> like a treat. I wanted to print the point data to the terminal (for no
> specific reason) and tried to use the vtkPolyData object that is output
> from the vtkPolyDataReader object. When I printed the output from the
> reader object, it seems to say give 0 for Number of Points, Number of Cells
> etc etc etc. My XYPlot ouput is as expected. Is there something I am
> missing? This has been reported before but I couldn't find a solution.
>
> Thanks,
> Venkat

Hi Venkat,
Try adding an Update() call to the reader before getting its output.

The filter stages - including readers and writers don't do anything unless 
they're updated. When they're put into a renderer's pipeline, Update is called 
by the renderer itself. But when you use them outside, you've got to manually 
do it before using the output objects.

Regards,
Shash



More information about the vtkusers mailing list