[vtkusers] how to get the scalar or vector data from vtkstructuredgrid

David Doria daviddoria at gmail.com
Tue Nov 5 11:48:29 EST 2013


On Tue, Nov 5, 2013 at 10:28 AM, Soumya Dutta <soumya.nsec at gmail.com> wrote:
> Hi David,
>
> thanks for the suggestion.. I am now able to get the data
>
> vtkPointData* vals;
>   vals = data->GetPointData();
>
> vtkDataArray* arr;
>   arr = vals->GetArray(0);
>
> arr->GetTuple(i,value);
>
> this gives the values..
>
>
> do you know how I can draw isosurface in this structured grid data? I know I
> can not do volume rendering.. but does vtk allow drawing isosurafce in a
> structured grid ?
> I can draw isosurface using paraview. SO I am assuming that it is possible.

I encourage you to look through the examples wiki:
http://www.vtk.org/Wiki/VTK/Examples/Cxx

There is a section on implicit functions:
http://www.vtk.org/Wiki/VTK/Examples/Cxx#Implicit_Functions_and_Iso-surfaces

It contains a few examples that demonstrate vtkContourFilter, which
should do what you're looking for:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImplicitFunctions/IsoContours

Good luck,

David


More information about the vtkusers mailing list