<div dir="ltr">Could you change this order<br><br> appendFilter->RemoveInput(selected);<br><div id=":7y"> appendFilter->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"><<a href="mailto:312846295@qq.com">312846295@qq.com</a>></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<vtkDataSetCollection> collection =<br>
vtkSmartPointer<vtkDataSetCollection>::New();<br>
collection = appendFilter->GetInputList();<br>
int NumberOfItems = collection->GetNumberOfItems();<br>
std::cout<<"There are"<< NumberOfItems<<" Item In Collection"<<std::endl;<br>
vtkDataSet *selected = collection->GetItem(i);<br>
<br>
appendFilter->RemoveInput(selected);<br>
appendFilter->Update();<br>
<br>
//collection = appendFilter->GetInputList();<br>
//std::cout<<"After Remove,There are"<< collection->GetNumberOfItems()<<"<br>
Item In Collection"<<std::endl;<br>
selectedMapper->SetInputConnection(appendFilter->GetOutputPort());<br>
selectedActor->SetMapper(selectedMapper);<br>
selectedActor->GetProperty()->SetColor(1,0,0);<br>
<br>
this->Interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->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>