[vtkusers] vtkStructuredPointsWriter

Christopher M. Navarro cnavarro at ncsa.uiuc.edu
Wed Oct 9 14:04:55 EDT 2002


I've noticed that if I first read a structured points file with 
vtkStructuredPointsReader and then immediately write it with 
vtkStructuredPointsWriter (or anytime thereafter), the scalar name set in 
the original foo.vtk file is lost and it defaults to the name "scalars".  
If I explicitly say 

points.GetPointData().GetScalars().SetName("elevation")

it still writes out 'scalars' as the name.  Now, if I set the scalar name 
explicitly with the writer, it writes out 'elevation'.  ie

out.SetScalarsName("elevation")

To further complicate things, if I add more arrays of scalar data with 
GetPointData().AddArray(myArray) it does not append not merely append the 
extra arrays when I write the structuredpoints object to file.  It mix and 
matched the arrays.  In one instance, with the additional arrays, 
elevation was written second in the file and the name showed up....so it 
is there, something is just not allowing it to write the name to the file 
when it shows up first in the file.  To clarify all of this, it would 
appear that StructuredPointsWriter uses a default name 'scalars' for the 
first scalar written to file, unless explicitly set within the writer object.  
With additional arrays, it does not just append them on to the 
original pointdata, but alters the order (how/why?).  Am I doing something 
incorrectly?  This all seems pretty straightforward.  As reference I am 
using java + vtk 4.0.  Any thoughts? 

-chris




More information about the vtkusers mailing list