<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote"><div class="im"><blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">
It's been a while since I played with it, but maybe this will help:</blockquote></div>
<div> </div>
<div>
<div><a href="http://vtk.org/Wiki/Structured_Grid" target="_blank">http://vtk.org/Wiki/Structured_Grid</a></div>
<div> </div>
<div>If you figure it out and could clean up the example that would be great.</div>
<div><br clear="all">Thanks,<br><font color="#888888"><br>David</font></div></div></div>
</blockquote></div><br><div>Actually, I've been meaning to suggest this for a while: can we add the following function (maybe named differently, and clearly a different prototype, but this will work for a "non-added-to-VTK" solution):</div>
<div><br></div><div><div><div>void GetPoint(vtkStructuredGrid* grid, int x, int y, int z, double p[3])</div><div>{</div><div> int dims[3];</div><div> grid->GetDimensions(dims);</div><div> </div><div> if(x >= dims[0] || y >= dims[1] || z >= dims[2])</div>
<div> {</div><div> return; // out of bounds!</div><div> }</div><div> </div><div> int ind = z*dims[1]*dims[0] + y*dims[0] + x;</div><div> //cout << "x: " << x << " y: " << y << " z: " << z << " ind: " << ind << endl;</div>
<div> </div><div> grid->GetPoint(ind, p); </div><div>}</div><div><br></div></div><div>Thanks,</div><br>David</div>