[vtkusers] select a cell from a mesh

David Doria daviddoria at gmail.com
Wed May 23 08:03:09 EDT 2012


On Wed, May 23, 2012 at 3:07 AM, tasnim <hanene-jeder at hotmail.fr> wrote:
> good morning,
> I want to select one cell with the mouse from a mesh.when this cell is
> selected, i wanna to retrieve its cell neighbors also, in order to use them
> to subdivide the selected cell with the vtkloopsubdivisionFilter, because i
> couldn't use this filter to subdivide it without using its neighbors .Any
> help please and thanks

You will need to:

1) Select the cell (this example also has elements of step 3):
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Picking/CellPicking

2) Then find it's neighbors (depending on your definition of "neighbors"):
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/CellPointNeighbors
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/CellEdgeNeighbors

3) Then extract them all:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractSelectionCells

David



More information about the vtkusers mailing list