<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>On Oct 29, 2010, at 6:17 AM, David Doria wrote:</div><div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Fri, Oct 29, 2010 at 7:54 AM, Anders Wallin <span dir="ltr">&lt;<a href="mailto:anders.e.e.wallin@gmail.com">anders.e.e.wallin@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
Hi group,<br>
I have an algorithm that outputs triangles for an<br>
animation/simulation[1]. For each new time-step the number of<br>
triangles that change is a small number compared to the total number<br>
of triangles. I would therefore not like to create a new polydata for<br>
each time-step, but rather use the same polydata and delete some<br>
cells/triangles, and add some new cells/triangles at each time-step.<br>
<br>
I was looking here:<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/PolyData/DeletePoints" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/PolyData/DeletePoints</a><br>
and here:<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/PolyData/Delete_cells" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/PolyData/Delete_cells</a><br>
<br>
but both of these are in the "broken" category of examples.<br>
<br>
Any ideas for how to do this easily/efficiently ?<br>
To save memory I should probably delete old/unused points also, not only cells?<br>
<br>
thanks,<br>
Anders W<br>
[1] something like this: <a href="http://www.youtube.com/watch?v=17mpgQ4KVLg" target="_blank">http://www.youtube.com/watch?v=17mpgQ4KVLg</a></blockquote><div><br></div>A few days ago Eric suggested using the ExtractSelection filter in "INVERT" mode to do this. That is, specify that you want to select/extract the cells that you want to delete, but then invert the selection so what is extracted is the remaining cells.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">These may help:</div><div class="gmail_quote"><br></div><div class="gmail_quote"><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractSelectionCells">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractSelectionCells</a></div>
<div class="gmail_quote"><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractSelectionCells"></a><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractCellsUsingPoints">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractCellsUsingPoints</a><br clear="all">
<br></div><div class="gmail_quote"><div>David&nbsp;</div></div></blockquote><br></div><div>One thing to note, though, is that using vtkExtractSelection will only hide the fact that he's really creating a new polydata on each time step. It may be a nice solution and perform well enough, though.</div><div><br></div><div>I'd advise going ahead and creating the new polydata on each time step and see how that performs. More knowledgeable people can speak up, but I'm not sure that the polydata data structures are really made to efficiently add and remove pieces in arbitrary spots over time, anyway.</div><div><br></div><div>-Eric</div><div><br></div><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">------------------------------------------------------<br>Eric E Monson<br>Duke Visualization Technology Group<br></span></div><div><br></div></body></html>