[vtkusers] Unable to read all scalars from Cell Data in a VTK file
amit112amit
amit112amit at yahoo.co.in
Mon Jan 4 22:06:17 EST 2016
Thanks a lot for your reply, Cory. ReadAllScalarsOn() and ReadAllVectorsOn()
are exactly the functions that I needed to read the original version of my
legacy VTK file. That VTK file was generated directly using C++ file output
functions. That means there was no vtkPolyData object created and no
vtkPolyDataWriter was used to write it. I am trying to use vtkPolyDataWriter
such that I get a legacy VTK files which has multiple scalars and vectors
listed as I showed in my original VTK file sample. But I am not able to find
how.
How do I add multiple scalars to a cell-data? I looked at the code for
vtkCellData *cd->SetScalars(<data array>);
It removes the existing scalar array and then adds the new one.
Whereas if I do
vtkCellData *cd->AddArray(<data-array>);
when i write the file using vtkPolyDataWriter object, the added array
appears under FIELD section instead of under SCALAR. This is what prompted
me to think that all except the first scalar must be stored as field data
and thus the file format I found to work.
Can you please help? Thanks again.
Regards,
Amit
--
View this message in context: http://vtk.1045678.n5.nabble.com/Unable-to-read-all-scalars-from-Cell-Data-in-a-VTK-file-tp5735720p5735778.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list