[vtkusers] Need to pick a cell and it's neighbors

David Doria daviddoria at gmail.com
Thu Aug 2 12:01:22 EDT 2012


On Thu, Aug 2, 2012 at 11:45 AM, tasnim <hanene-jeder at hotmail.fr> wrote:
>
> Hello
> is there anyone who tried to pick a cell and its cells and points
> neighbors!!. It means that my cellId will not be fixed like this example :
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/CellPointNeighbors
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/CellPointNeighbors  in
> which our cellId is fixed to " 0 " for example. My aim is that when i pick
> on the mesh, i will retrieve its neighbors ( cells and the vertex's cells
> also).
> I tried to modify this example but some thing is wrong :/
> any help please,
> thanks,
> Tasnim

You just have to use a normal vtkCellPicker to get the cell ID of the
cell you want to query for neighbors. That is, change:

 vtkIdType cellId = 0;

in the example to the result of a vtkCellPicker.

David



More information about the vtkusers mailing list