[vtk-developers] question about vtkxml file format

Brad King brad.king at kitware.com
Mon Aug 8 09:08:08 EDT 2005


Simon Warfield wrote:
> 
> The vtkXMLUnstructuredGrid reader reads data with cell information 
> specified through a connectivity array, an offsets array and a cell type 
> array.   
> http://www.vtk.org/doc/nightly/html/classvtkXMLUnstructuredGridReader.html
> 
> It seems to me the offsets array must specify the index of one past the 
> end of the corresponding cell, rather than the end of the corresponding 
> cell as the documentation suggests.  Or perhaps indexes count from 1 
> instead of from 0.
> This test here uses data that has a cell offsets array constructed to 
> point one past the end of the cell:
> http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/IO/Testing/Tcl/TestXMLUnstructuredGridIO.tcl?root=VTK&content-type=text/plain 
> 
> 
> The example at the end of this documentation 
> http://www.vtk.org/pdf/file-formats.pdf  also offsets by one past the 
> end of the cell.  For example, it quadrilaterals running 0,1,2,3 the 
> index of the 'end of the cell' is 4. 
> 
> Can that be right ?

It indexes to the end of the cell in the STL-iterator sense where the 
end iterator is one past the last element.  Therefore the value of the 
first offset is the number of points in the first cell, and the value of 
the last offset is the length of the connectivity array.

-Brad



More information about the vtk-developers mailing list