[vtk-developers] Add GetPoint function to vtkStructuredGrid

David Doria daviddoria+vtk at gmail.com
Fri Feb 5 13:25:02 EST 2010


There currently doesn't seem to be a way to access points in the "grid"
(x,y,z) structure. Can we add this function:

void vtkStructuredGrid::GetPoint(int x, int y, int z, double p[3])
{
  int dims[3];
  this->GetDimensions(dims);

  if(x >= dims[0] || y >= dims[1] || z >= dims[2])
    {
    return; // out of bounds!
    }

  int ind = z*dims[1]*dims[0] + y*dims[0] + x;
  //cout << "x: " << x << " y: " << y << " z: " << z << " ind: " << ind <<
endl;

  grid->GetPoint(ind, p);
}

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100205/fa5d6c5c/attachment.html>


More information about the vtk-developers mailing list