<div dir="ltr"><div><div><div><div>Hi David,<br><br></div>thanks for the suggestion.. I am now able to get the data<br><br>vtkPointData* vals;<br>  vals = data-&gt;GetPointData();<br><br>vtkDataArray* arr;<br>  arr = vals-&gt;GetArray(0); <br>
<br>arr-&gt;GetTuple(i,value);<br><br></div>this gives the values..<br><br><br></div>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 ?<br>
</div>I can draw isosurface using paraview. SO I am assuming that it is possible. <br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 5, 2013 at 9:11 AM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Nov 4, 2013 at 5:43 PM, Soumya Dutta &lt;<a href="mailto:soumya.nsec@gmail.com">soumya.nsec@gmail.com</a>&gt; wrote:<br>

&gt; Hi All,<br>
&gt;<br>
&gt; I am new to vtk and trying to find my way to use vtk structuredgrid. I have<br>
&gt; a plot3d data that has several variable and vectors. I loaded the file using<br>
&gt; following code:<br>
&gt;<br>
&gt; vtkSmartPointer&lt;vtkMultiBlockPLOT3DReader&gt; reader =<br>
&gt; vtkSmartPointer&lt;vtkMultiBlockPLOT3DReader&gt;::New();<br>
&gt;   reader-&gt;SetXYZFileName(xyzFilename.c_str());<br>
&gt;   reader-&gt;SetQFileName(qFilename.c_str());<br>
&gt;   reader-&gt;SetAutoDetectFormat(1);<br>
&gt; reader-&gt;SetScalarFunctionNumber(110);<br>
&gt;   reader-&gt;SetVectorFunctionNumber(200);<br>
&gt;<br>
&gt;<br>
&gt; the I did the following to convert it into a structured grid:<br>
&gt;<br>
&gt; vtkSmartPointer&lt;vtkStructuredGrid&gt; sgrid =<br>
&gt; vtkSmartPointer&lt;vtkStructuredGrid&gt;::New();<br>
&gt;   sgrid = vtkStructuredGrid::SafeDownCast(reader-&gt;GetOutput()-&gt;GetBlock(0));<br>
&gt;<br>
&gt; now how can I can I access individual scalar values from this grid data<br>
&gt; structure?<br>
&gt;<br>
&gt; If I do the following:<br>
&gt;<br>
&gt; vtkPoints* pts;<br>
&gt;   pts = sgrid-&gt;GetPoints();<br>
&gt;<br>
&gt; I think I am getting the x,y,z locations of the points.. but I am not able<br>
&gt; to access the fields and their scalar values. Any kind of help would be<br>
&gt; appreciated.<br>
&gt;<br>
&gt; --<br>
&gt; Yours&#39; Sincerely,<br>
&gt; Soumya Dutta<br>
<br>
</div></div>Are you looking for vtkPointData* pointData = sgrid-&gt;GetPointData()?<br>
<br>
There are some examples that explain how to set and retrieve data from<br>
points and cells (the examples are mostly for vtkPolyData, but they<br>
should apply to vtkStructuredGrid as well):<br>
<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/MiscPointData" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/MiscPointData</a><br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><i>Yours&#39; Sincerely</i>,<br><span style="font-weight:bold;font-style:italic">Soumya Dutta</span><br>
<span style="font-style:italic">Graduate Student</span><br style="font-style:italic">
<span style="font-style:italic">Department of Computer Science and Engineering</span><br>
<span style="font-style:italic">The Ohio State University</span><br><i></i><br><br><br>
</div>