[vtkusers] Problem with vtkThreshold

John Norris jnorris at mcs.anl.gov
Thu Oct 13 13:08:33 EDT 2005


Hi,

Looking at VTK from CVS, I was trying to find an easy way to determine 
how to differentiate point data from cell data when using 
vtkDataObject::FIELD_ASSOCIATION_POINTS_THEN_CELLS in 
vtkAlgorithm::SetInputArrayToProcess().  I looked at vtkThreshold for 
enlightenment, since it uses this association.  But it cheats!  It 
checks to see if the number of points in the input equals the number of 
points in the input array.  If so, it assumes that the array is point 
data.  This is not necessarily true.  An vtkUnstructuredGrid or 
vtkPolyData with the same number of cells as points, cell data, and no 
point data would not be processed correctly by vtkThreshold since it 
would treat the cell data as point data.  In our simulations, 
unstructured grids with the same number of points as cells occur 
surprisingly often, so this is a bit of a problem.

For my own filters, I'll just keep grabbing the scalars the 
old-fashioned way so that I know if they're point or cell data.

John
-- 
John Norris
Research Programmer
Center for Simulation of Advanced Rockets
http://www.uiuc.edu/ph/www/jnorris



More information about the vtkusers mailing list