[vtkusers] How to access vtkPolyData data

Raúl Ferriz raul at torresyvalero.com
Wed Sep 15 13:14:25 EDT 2010


  Hello!

I have an spline polydata on an vtkPolyData variable:

vtkPolyData * poly = vtkPolyData::New();
SPLineRepresentation->GetPolyData (poly);

vtkCellArray * lines = polyData->GetLines();
vtkPoints    * points = polyData->GetPoints();

int nlines = lines->GetNumberOfCells();
int npoints = points->GetNumberOfPoints();

How can I obtain line and point data?
I tried this but don't work:

     vtkIdList * id = vtkIdList::New();
     for (int _i = 0; _i < nlines; _i++)
     {
         if (lines->GetNextCell(id) == 0)
         {
             vtkErrorMacro(<< "No next cell");
             return;
         }
     }






More information about the vtkusers mailing list