[vtk-developers] Add GetPoint function to vtkStructuredGrid

David Doria daviddoria+vtk at gmail.com
Sat Feb 6 08:43:45 EST 2010


On Fri, Feb 5, 2010 at 9:34 PM, Berk Geveci <berk.geveci at kitware.com> wrote:

> I wouldn't have the flag but if I was forced to have it, I'd have it as the
> last argument with a default value set to false (I think) so that one can
> still do
>
> GetPoint(i, j, k, pt);
>
> I think that it is better to force people to think in terms of extents
> because that is the way they need to implement their algorithms if they want
> them to work when streaming. So, if they are going to loop over all points,
> I'd rather they did:
>
> for (i=extent[0]; i<extent[1]; i++)
>   for (j=extent[2]; j<extent[2]; k++)
>     for (k=extent[3]; k<extent[4]; k++)
>
> than
>
> for (i=0; i<dims[1]; i++)
>   for (j=0; j<dims[2]; k++)
>     for (k=0; k<dims[4]; k++)
>
> Also, I wouldn't use x, y and z for variable names as many people associate
> those names with position rather than index (nitpicking here).
>
> -berk
>
>
All -

I committed the function. Please take a look and make sure we're all on the
same page.

Berk - it's not nitpicking, it's clarity. I changed it. However, I set the
flag to 'true' as David G has beaten into me that extents are your friend :)

David G. - please read the documentation I added with the function and make
sure I got my extent interpretation correct.

Thanks for the discussion everyone - I hope this function will remove some
of the confusion of the StructuredGrid.

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


More information about the vtk-developers mailing list