newbie ?: How do I store & read scalar value in a vtk format file ?

Pieper, Chris cpieper at
Thu Aug 26 11:30:21 EDT 1999

I have a vtk format file containing PolyData (points & lines) which is
working fine.  I'd like to add a single scalar attribute.  My guess at the
format to use is;

SCALARS my_scalars_name float

This may or may not be correct (1st question)...

The 2nd question is how do I read it? I read the PolyData using
PolyDataReader, but how can I get the scalar value?

I've tried;

vtkScalars *scalars = vtkScalars::New();

vtkDataReader *datareader = vtkDataReader::New();

obviously, this is wrong...   I'm a newbie to vtk and OOP, so don't laugh
too hard please...

Thanks for any help you may be able to offer.

Chris Pieper
cpieper at
v: 920-721-4037
f: 920-721-8471

This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.

More information about the vtkusers mailing list