[vtkusers] Re: Delete Cells from vtkPolyData
Goodwin Lawlor
goodwin.lawlor at ucd.ie
Thu Mar 1 06:03:49 EST 2007
Mike Jackson wrote:
> So, just how do I actually delete a cell from a vtkPolyData?
<snip>
> I did read some archive threads where it was suggested to just build a
> new vtkPolyData object instead of trying to change the first vtkPolyData
> Object. Is there truth to that?
That's correct - the cells/points list aren't random access so when you
pluck a cell out of the middle of the list you have to reorder the list
after that point.
You can have a look at this class to get an idea:
http://vtkbioeng.cvs.sourceforge.net/*checkout*/vtkbioeng/vtkbioeng/vtkCellsFilter.cxx
Basically, vtkPolyData::CopyCells(vtkPolyData, vtkCellList) does a lot
of the work for you.
hth,
Goodwin
More information about the vtkusers
mailing list