<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->GetPointData();<br><br>vtkDataArray* arr;<br> arr = vals->GetArray(0); <br>
<br>arr->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"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></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 <<a href="mailto:soumya.nsec@gmail.com">soumya.nsec@gmail.com</a>> wrote:<br>
> Hi All,<br>
><br>
> I am new to vtk and trying to find my way to use vtk structuredgrid. I have<br>
> a plot3d data that has several variable and vectors. I loaded the file using<br>
> following code:<br>
><br>
> vtkSmartPointer<vtkMultiBlockPLOT3DReader> reader =<br>
> vtkSmartPointer<vtkMultiBlockPLOT3DReader>::New();<br>
> reader->SetXYZFileName(xyzFilename.c_str());<br>
> reader->SetQFileName(qFilename.c_str());<br>
> reader->SetAutoDetectFormat(1);<br>
> reader->SetScalarFunctionNumber(110);<br>
> reader->SetVectorFunctionNumber(200);<br>
><br>
><br>
> the I did the following to convert it into a structured grid:<br>
><br>
> vtkSmartPointer<vtkStructuredGrid> sgrid =<br>
> vtkSmartPointer<vtkStructuredGrid>::New();<br>
> sgrid = vtkStructuredGrid::SafeDownCast(reader->GetOutput()->GetBlock(0));<br>
><br>
> now how can I can I access individual scalar values from this grid data<br>
> structure?<br>
><br>
> If I do the following:<br>
><br>
> vtkPoints* pts;<br>
> pts = sgrid->GetPoints();<br>
><br>
> I think I am getting the x,y,z locations of the points.. but I am not able<br>
> to access the fields and their scalar values. Any kind of help would be<br>
> appreciated.<br>
><br>
> --<br>
> Yours' Sincerely,<br>
> Soumya Dutta<br>
<br>
</div></div>Are you looking for vtkPointData* pointData = sgrid->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' 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>