[vtkusers] vtkGeometryFilter::UnstructuredGridExecute() : BUG ?

John Biddiscombe j.biddiscombe at rl.ac.uk
Thu Aug 31 05:34:53 EDT 2000


Philippe,

>I suggest to use newCellId = output->InsertNextCell(type,npts,pts) as in
>vtkGeometryFilter::PolyDataExecute() (line 506) which give the correct
>newCellId.

Watch out. There are quite a few filters which 'might' have this bug in
them. If you find any more...post again.

There's a problem...

newCellId = output->InsertNextCell(type,npts,pts)

doesn't work properly either, because 

1 = output->InsertNextCell(POLYGON)
2 = output->InsertNextCell(LINE)
3 = output->InsertNextCell(POLYGON)
4 = output->InsertNextCell(LINE)

the actual cell numbers should be
VERTS
LINES
POLYS
STRIPS

(in our above insertion the correct order'd be 2,4,1,3)

so inserting cells in random order is fine, because they will be correctly
handled, but copying cell data is ALWAYS WRONG using the current system.
I've found this in vtkCleanPolyData and my solution was a bit longwinded,
however a good solution would be to take my code from vtkCleanPolyData and
use it to create a helper class vtkPolyDataCellHelper, which would allow
random insertion of cells, store the cell data in a series of temporary
lists and then after completion, copy it back in the correct order. Very
tedious indeed, but there's no easy and clean way of getting it right. (At
least I think not, it's been a while since I looked at this).

Want to have a go?

JB






More information about the vtkusers mailing list