[vtkusers] Accessing isosurface data

Kevin Wright krw at viz-solutions.com
Thu Oct 18 12:41:58 EDT 2001


> vtkPolyData *polys = isoProbe->GetPolyDataOutput();
>        float numPolys = polys->GetNumberOfPolys();
>
>        for(i=0;i<numPolys; i++)
>        {
>               polys->GetCell(i);
>              vtkCell *cell = polys->GetCell(i);
>              vtkPoints *points = cell->GetPoints();
>              points->GetPoint(0, p1);
>              ...
>              ...
>        }
>
> but I am not quite sure how to get hold of the scalar values from the
> second data set that are mapped onto the isosurface.

vtkScalars *scalars = polys->GetPointData()->GetScalars();
for(int i = 0; i < scalars->GetNumberOfScalars(); i++) {
  float val = scalars->GetScalar(i);
  ...
}





More information about the vtkusers mailing list