Hi all,<br>I have some cells in a vtkPolyData where I also have a std::list of their index in my program. Sometimes, I want to delete some of these cells, but when I call RemoveDeletedCells the cells in my vtkPolyData get re-ordered, so my std::list index to them are no longer correct. <br>
<br>My question is there another way to keep track of which cell is which cell if I do call RemoveDeletedCells and get rid of some of them? Such as a pointer to each cell within my vtkPolyData...<br><br>Relevant code below:<br>
<br>pointArray is of vtkPoints<br>cellArray is of vtkCellArray<br><br>I keep a list of actorIndex to refer to each cell. (each cell is basically just the point i want to display on the render window). So when I delete actorIndex 10, the old actorIndex 11 becomes 10, and when I try to delete 11 I get an error....<br>
<br>AddPoint(double pt[3]) {<br><br>    int actorIndex = pointArray-&gt;InsertNextPoint(pt);<br>    polyData-&gt;SetPoints(pointArray);<br><br>    int n = pointArray-&gt;GetNumberOfPoints() - 1; // Subtract one for the correct array index<br>
    cellArray-&gt;InsertNextCell(1, &amp;n);<br><br>    polyData-&gt;SetVerts(cellArray);<br>    if (n==0) {<br>        polyMapper-&gt;SetInput(polyData);<br>        actor-&gt;SetMapper(polyMapper);<br>        actor-&gt;GetProperty()-&gt;SetRepresentationToPoints();<br>
        renderer-&gt;AddActor(actor);<br>    }<br>    polyData-&gt;Modified();<br>...<br><br>Any help/clue/pointer is appreciated! <br><br>-Will<br><br>