<br><font size=3>my_polyData</font><font size=2 face="sans-serif"> is at
the end of a pipeline. Each time you Update it (which is done at each frame
if you render it), it is reset to the output of the previous filter.</font>
<br><font size=2 face="sans-serif">If you want to break the dependency
chain, you have to insert a ShallowCopy : </font>
<br><font size=2 face="sans-serif">output = </font><font size=3>my_vtkPolyDataConnectivityFilter-&gt;GetOutput();</font>
<br><font size=3>my_polyData</font><font size=2 face="sans-serif"> = vtkPolyData::New();</font>
<br><font size=3>my_polyData</font><font size=2 face="sans-serif">-&gt;ShallowCopy(output);</font>
<br><font size=2 face="sans-serif">...</font>
<br><font size=2 face="sans-serif">and remeber to call </font><font size=3>my_polyData</font><font size=2 face="sans-serif">-&gt;Delete()
later.</font>
<br>
<br><font size=2 face="sans-serif">But the best way would be to implement
a filter that does the job to remove some cells, so that your pipeline
is still connected.</font>
<br>
<br><font size=2 face="sans-serif">Stephane</font>
<br><font size=2 face="sans-serif"><br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>cocoricore@gmail.com</b>
</font>
<br><font size=1 face="sans-serif">Envoyé par : vtkusers-bounces@vtk.org</font>
<p><font size=1 face="sans-serif">28/07/2009 15:47</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">A</font></div>
<td><font size=1 face="sans-serif">dominik@itis.ethz.ch</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">vtkusers@vtk.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Objet</font></div>
<td><font size=1 face="sans-serif">Re: [vtkusers] How to really delete
cells?</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=3>No change.<br>
</font>
<br><font size=3>2009/7/28 Dominik Szczerba &lt;</font><a href=mailto:dominik@itis.ethz.ch><font size=3 color=blue><u>dominik@itis.ethz.ch</u></font></a><font size=3>&gt;</font>
<br><font size=3>And what does calling -&gt;Update() ?<br>
<br>
Corinne Tith wrote:</font>
<br><font size=3>Thanks for your help. I tried to put your code after my_polyData-&gt;RemoveDeletedCells();<br>
Unfortunately It doesn't work.<br>
I tried to delete lot of cells, they are never really removed.<br>
<br>
My VTK version is 5.2, does it matter?<br>
<br>
</font>
<br><font size=3>2009/7/28 Dominik Szczerba &lt;</font><a href=mailto:dominik@itis.ethz.ch target=_blank><font size=3 color=blue><u>dominik@itis.ethz.ch</u></font></a><font size=3>
&lt;mailto:</font><a href=mailto:dominik@itis.ethz.ch target=_blank><font size=3 color=blue><u>dominik@itis.ethz.ch</u></font></a><font size=3>&gt;&gt;</font>
<br><font size=3><br>
<br>
&nbsp; &nbsp;my_polyData-&gt;Modified()<br>
<br>
&nbsp; &nbsp;Corinne Tith wrote:<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;Hi all,<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;I get a polydata volume with a vtkContourFilter
and a<br>
&nbsp; &nbsp; &nbsp; &nbsp;vtkWindowSincPolyDataFilter.<br>
&nbsp; &nbsp; &nbsp; &nbsp;Some cells are not connected to the largest
volume. They seem to<br>
&nbsp; &nbsp; &nbsp; &nbsp;be 'on' the mesh but have no vertice in common.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;I tried the filters vtkCleanPolyData and<br>
&nbsp; &nbsp; &nbsp; &nbsp;vtkPolyDataConnectivityFilter, but most of my
unconnected cells<br>
&nbsp; &nbsp; &nbsp; &nbsp;are not removed.<br>
&nbsp; &nbsp; &nbsp; &nbsp;Finally, I tried to delete them 'manually',
but nothing happens.<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;How can I really remove my unconnected cells?<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;Any help is appreciated, thanks!<br>
<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;// generate my volume<br>
&nbsp; &nbsp; &nbsp; &nbsp;my_vtkWindowSincPolyDataFilter-&gt;SetInputConnection(my_vtkContourFilter-&gt;GetOutputPort());<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;// no effect on my cells<br>
&nbsp; &nbsp; &nbsp; &nbsp;my_vtkCleanPolyData-&gt;SetInputConnection(my_vtkWindowSincPolyDataFilter-&gt;GetOutputPort());<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;my_vtkCleanPolyData-&gt;PointMergingOn();<br>
&nbsp; &nbsp; &nbsp; &nbsp;my_vtkPolyDataConnectivityFilter-&gt;SetInputConnection(my_vtkContourFilter-&gt;GetOutputPort());<br>
&nbsp; &nbsp; &nbsp; &nbsp;my_vtkPolyDataConnectivityFilter-&gt;SetExtractionModeToLargestRegion();<br>
&nbsp; &nbsp; &nbsp; &nbsp;// manual remove<br>
&nbsp; &nbsp; &nbsp; &nbsp;my_vtkPolyDataConnectivityFilter-&gt;Update();<br>
&nbsp; &nbsp; &nbsp; &nbsp;my_polyData = my_vtkPolyDataConnectivityFilter-&gt;GetOutput();<br>
&nbsp; &nbsp; &nbsp; &nbsp;for(int i = 0; i &lt; n; i++){<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;my_polyData-&gt;DeleteCell(cellsToRemove[i]);<br>
&nbsp; &nbsp; &nbsp; &nbsp;}<br>
&nbsp; &nbsp; &nbsp; &nbsp;my_polyData-&gt;RemoveDeletedCells();<br>
<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;------------------------------------------------------------------------<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;_______________________________________________</font>
<br><font size=3>&nbsp; &nbsp; &nbsp; &nbsp;Powered by </font><a href=http://www.kitware.com/ target=_blank><font size=3 color=blue><u>www.kitware.com</u></font></a><font size=3>
&lt;</font><a href=http://www.kitware.com/ target=_blank><font size=3 color=blue><u>http://www.kitware.com</u></font></a><font size=3>&gt;</font>
<br><font size=3><br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;Visit other Kitware open-source projects at<br>
&nbsp; &nbsp; &nbsp; &nbsp;</font><a href=http://www.kitware.com/opensource/opensource.html target=_blank><font size=3 color=blue><u>http://www.kitware.com/opensource/opensource.html</u></font></a><font size=3><br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;Please keep messages on-topic and check the
VTK FAQ at:<br>
&nbsp; &nbsp; &nbsp; &nbsp;</font><a href=http://www.vtk.org/Wiki/VTK_FAQ target=_blank><font size=3 color=blue><u>http://www.vtk.org/Wiki/VTK_FAQ</u></font></a><font size=3><br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp;Follow this link to subscribe/unsubscribe:<br>
&nbsp; &nbsp; &nbsp; &nbsp;</font><a href=http://www.vtk.org/mailman/listinfo/vtkusers target=_blank><font size=3 color=blue><u>http://www.vtk.org/mailman/listinfo/vtkusers</u></font></a><font size=3><br>
<br>
<br>
</font>
<br>
<br><tt><font size=2>_______________________________________________<br>
Powered by www.kitware.com<br>
<br>
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br>
<br>
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<br>
<br>
Follow this link to subscribe/unsubscribe:<br>
http://www.vtk.org/mailman/listinfo/vtkusers<br>
</font></tt>
<br>