<div dir="ltr">Could you change this order<br><br> appendFilter-&gt;RemoveInput(selected);<br><div id=":7y"> appendFilter-&gt;Update();<br><br>Jothy<br></div><br><br><div class="gmail_quote">On Tue, Mar 6, 2012 at 5:49 AM, fanghao <span dir="ltr">&lt;<a href="mailto:312846295@qq.com">312846295@qq.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I use left button to pick the cell and chang it's color.<br>
when I push down the right button,the selected cell will be deleted.<br>
 vtkAppendFilter->addInput(selected)  and<br>
vtkAppendFilter->removeInput(selected)  is OK。 but I  have a trouble .<br>
when I  want to delete the last one,the error information will come out.<br>
<br>
<br>
ERROR: In ..\..\VTK\Filtering\vtkDemandDrivenPipeline.cxx, line 727<br>
vtkStreamingDemandDrivenPipeline (0256C690): Input port 0 of algorithm<br>
vtkAppendFilter(025821B8) has 0 connections but is not optional.xfF<br>
<br>
A part of source code:<br>
<br>
vtkSmartPointer&lt;vtkDataSetCollection&gt; collection =<br>
vtkSmartPointer&lt;vtkDataSetCollection&gt;::New();<br>
                        collection = appendFilter-&gt;GetInputList();<br>
                        int NumberOfItems = collection-&gt;GetNumberOfItems();<br>
                        std::cout&lt;&lt;&quot;There are&quot;&lt;&lt; NumberOfItems&lt;&lt;&quot; Item In Collection&quot;&lt;&lt;std::endl;<br>
                        vtkDataSet *selected = collection-&gt;GetItem(i);<br>
<br>
                        appendFilter-&gt;RemoveInput(selected);<br>
                        appendFilter-&gt;Update();<br>
<br>
                        //collection = appendFilter-&gt;GetInputList();<br>
                        //std::cout&lt;&lt;&quot;After Remove,There are&quot;&lt;&lt; collection-&gt;GetNumberOfItems()&lt;&lt;&quot;<br>
Item In Collection&quot;&lt;&lt;std::endl;<br>
                        selectedMapper-&gt;SetInputConnection(appendFilter-&gt;GetOutputPort());<br>
                        selectedActor-&gt;SetMapper(selectedMapper);<br>
                        selectedActor-&gt;GetProperty()-&gt;SetColor(1,0,0);<br>
<br>
this-&gt;Interactor-&gt;GetRenderWindow()-&gt;GetRenderers()-&gt;GetFirstRenderer()-&gt;AddActor(selectedActor);<br>
<br>
<a href="http://vtk.1045678.n5.nabble.com/file/n5539990/QQ%E6%88%AA%E5%9B%BE20120306135025.jpg" target="_blank">http://vtk.1045678.n5.nabble.com/file/n5539990/QQ%E6%88%AA%E5%9B%BE20120306135025.jpg</a><br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Cell-pick-and-Delete-tp5539990p5539990.html" target="_blank">http://vtk.1045678.n5.nabble.com/Cell-pick-and-Delete-tp5539990p5539990.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</div>