[vtkusers] how to find neighbouring vertices in of a vertex

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Mon Mar 21 16:50:27 EST 2005





Hi Kiran

vtkusers-bounces at vtk.org wrote on 19/03/2005 06:27:45:

>
> hi all,
>   is there a function in vtk to find neighbors of a given vertex.
>

In vtkPolyData you can use BuildLinks followed by:

    // get cells the point belongs to
    myPolyData->GetPointCells( pid, cells );

    // for each cell
    nCells = cells->GetNumberOfIds();
    for( cellNum=0; cellNum<nCells; cellNum++ )
      {
      cid = cells->GetId( cellNum );
      cell = myPolyData->GetCell( cid );
      // get points belonging to this cell
      vtkPoints *pts = cell->GetPoints();

  you would have to keep a list so you dont duplicate points shared by
adjacent cells.

  Dave P

> thanks
>
> kiran
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.
> org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list