[vtkusers] Re: Delete Cells from vtkPolyData

Mike Jackson imikejackson at gmail.com
Thu Mar 1 15:19:47 EST 2007


And does the same go for inserting cells? I am trying to "split" a  
manifold edge at its points which means I need to add a new point and  
then change the cell so that it references this new point. Do I have  
to rebuild the links each time? I seem to be hitting a point where  
after I have added some new points, when I attempt to use the  
GetEdgeNeighbors(...) the method fails with a "Exec_bad_access"  
error. Which to me seems like I am walking of the end of an array or  
maybe something else that did not get updated.

Thanks for any help from anyone.
-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Mar 1, 2007, at 6:03 AM, Goodwin Lawlor wrote:

> 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
>
> _______________________________________________
> This is the private VTK discussion list. Please keep messages on- 
> topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list