<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">i don't see that you added cells to the polydata, just points. you need a cell array of type vtk_vertex.</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Aug 6, 2013 at 4:44 PM, Renil <span dir="ltr"><<a href="mailto:renilac@gmail.com" target="_blank">renilac@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Jeff Lee,<br>
<br>
I tried following your suggestion, and used the example from the<br>
wiki/examples, /deleteCells/.<br>
I used a polydata to hold the points and changed the lines to spheres and<br>
tried to remove the cells associated to one of the points.<br>
It doesn't seem to be doing anything.<br>
<br>
I'm probably not delete any cells, right?<br>
<br>
*Code* below:<br>
<br>
int main(int, char *[])<br>
{<br>
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();<br>
points->InsertNextPoint(0,0,0);<br>
points->InsertNextPoint(1,0,0);<br>
points->InsertNextPoint(1,1,0);<br>
points->InsertNextPoint(0,1,0);<br>
<br>
// vtkSmartPointer<vtkCellArray> lines =<br>
vtkSmartPointer<vtkCellArray>::New();<br>
// lines->InsertNextCell(points->GetNumberOfPoints());<br>
<br>
vtkSmartPointer<vtkPolyData> polydata =<br>
vtkSmartPointer<vtkPolyData>::New();<br>
polydata->SetPoints(points);<br>
<br>
vtkSmartPointer<vtkSphereSource> sphereSource =<br>
vtkSmartPointer<vtkSphereSource>::New();<br>
sphereSource->SetThetaResolution(20);<br>
sphereSource->SetPhiResolution(20);<br>
sphereSource->SetRadius(0.5);<br>
<br>
vtkSmartPointer<vtkGlyph3D> atomGlyphs =<br>
vtkSmartPointer<vtkGlyph3D>::New();<br>
atomGlyphs ->SetInput(polydata);<br>
atomGlyphs ->SetSource(sphereSource->GetOutput());<br>
<br>
// Create the mapper & actor for the atoms<br>
vtkSmartPointer<vtkPolyDataMapper> atomMapper =<br>
vtkSmartPointer<vtkPolyDataMapper>::New();<br>
atomMapper->SetInput(atomGlyphs->GetOutput());<br>
<br>
vtkSmartPointer<vtkActor> sphereActor = vtkSmartPointer<vtkActor>::New();<br>
sphereActor->SetMapper(atomMapper);<br>
sphereActor->GetProperty()->SetColor(0.7, 0.7, 0.7);<br>
<br>
// Tell the polydata to build 'upward' links from points to cells.<br>
polydata->BuildLinks();<br>
vtkSmartPointer<vtkIdList> cellIds = vtkSmartPointer<vtkIdList>::New();<br>
polydata->GetPointCells(1, cellIds);<br>
<br>
// Mark a cell as deleted.<br>
for (int i = 0; cellIds->GetNumberOfIds();i++){<br>
polydata->DeleteCell(i);<br>
}<br>
<br>
// Remove the marked cell.<br>
polydata->RemoveDeletedCells();<br>
<br>
vtkSmartPointer<vtkRenderer> renderer =<br>
vtkSmartPointer<vtkRenderer>::New();<br>
renderer->AddActor(sphereActor);<br>
vtkSmartPointer<vtkRenderWindow> renderWindow =<br>
vtkSmartPointer<vtkRenderWindow>::New();<br>
renderWindow->AddRenderer(renderer);<br>
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =<br>
vtkSmartPointer<vtkRenderWindowInteractor>::New();<br>
renderWindowInteractor->SetRenderWindow(renderWindow);<br>
renderWindow->Render();<br>
renderWindowInteractor->Start();<br>
<br>
return EXIT_SUCCESS;<br>
}<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/trade-vtkPoints-between-actors-tp5722498p5722526.html" target="_blank">http://vtk.1045678.n5.nabble.com/trade-vtkPoints-between-actors-tp5722498p5722526.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>
</blockquote></div><br></div>