I have a legacy POLYDATA dataset with only points and associated SCALARS (no CELLS) from some hydrologic simulation code. The only important piece of information is the location of the points themselves. I have two questions:
Is having a CELLS field necessary?
If so, how should I define such cells? Can I just define a single cell over the whole volume with the points?
This seems like a basic question but I haven’t ben able to answer this question with previous searches. Thanks for your help!
In next release, you will be able to instantiate vtkPointSet, which will not be abstract anymore, and which will be the designated data structure for point sets. As for now, if you want to display points in a vtkPolyData, you should fill up the vtkCellArray you can get from vtkPolyData::GetVerts(). Your cells would be vtkVertex.
I think I wasn’t clear enough in my first question. The VTK polydata file is being written manually in a FORTRAN code, and the only parts that are written are the POINTS and the SCALARS.
It doesn’t have any polygons or cells. I’m trying to figure out: 1) whether this is a valid legacy VTK file format that readers should recognize (I can get the data out of it in Python, but that’s the only one I’ve gotten working so far, with particularly VisIt and ParaView having problems); and 2) what I need to do to adapt the file format if it is not. I have had one person tell me that the VTKs need a structure for the data to lay in, and hence a set of CELLS, so I’m trying to track down more of that.
Since the data doesn’t have any vertices or cells, I don’t get anything when I call vtkPolyData::GetVerts().
If I understand what you’re saying, I need to add a vertices section that repeats the points section (with a unique number for each vertex?) because I need to let it know that the points are not parts of cells, but rather are just stand-alone locations in space.
I think that the SCALARS should remain as they are, because in fact it reads: