Thank you for the informative link. <div><br></div><div>I tried running the <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/GenericDataObjectReader" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/GenericDataObjectReader</a> on my data file and it correctly </div>
<div>gave the total number of points viz. 5 points for my program. </div><div><br></div><div>However, does this code also read and store the pressure, density, position vector and velocity vectors somehwere? </div><div>If so, how do I access / print them? The vtk documentation looks quite intimidating and I am not sure of how to do this. </div>
<div><br></div><div>Here is the data file again.</div><div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "><div># vtk DataFile Version 3.0</div>
<div><div>The actual time is 0.01000000</div><div>ASCII</div><div>DATASET POLYDATA</div><div>POINTS 5 double</div><div>1.0 3.0 6.8</div><div>2.3 4.5 6.7</div><div>4.5 6.7 9.0</div><div>1.2 3.4 5.6</div><div>2.1 1.5 2.3 </div>
<div>POINT_DATA 5</div><div>SCALARS pressure double</div><div>LOOKUP_TABLE default</div><div>3.4</div><div>6.7</div><div>8.9</div><div>3.5</div><div>6.9</div><div>SCALARS density double</div><div>LOOKUP_TABLE default</div>
<div>3</div><div>4</div><div>5</div><div>6</div><div>7</div><div>VECTORS velocity double</div><div>3 4 5</div><div>6 7 8</div><div>1 2 3</div><div>6 7 8</div><div>8 9 0</div></div></span></div><div><br></div><div><br></div>
<div><br></div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Wed, Oct 19, 2011 at 5:31 PM, 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><div></div><div>On Wed, Oct 19, 2011 at 5:27 PM, Gaurish Telang <<a href="mailto:gaurish108@gmail.com" target="_blank">gaurish108@gmail.com</a>> wrote:<br>
> Hi I am new to the VTK toolkit. Is there any standard VTK function/ library<br>
> available to read the VTK files. The file which I want to read into my C++<br>
> program looks like<br>
> # vtk DataFile Version 3.0<br>
> The actual time is 0.01000000<br>
> ASCII<br>
> DATASET POLYDATA<br>
> POINTS 5 double<br>
> 1.0 3.0 6.8<br>
> 2.3 4.5 6.7<br>
> 4.5 6.7 9.0<br>
> 1.2 3.4 5.6<br>
> 2.1 1.5 2.3<br>
> POINT_DATA 5<br>
> SCALARS pressure double<br>
> LOOKUP_TABLE default<br>
> 3.4<br>
> 6.7<br>
> 8.9<br>
> 3.5<br>
> 6.9<br>
> SCALARS density double<br>
> LOOKUP_TABLE default<br>
> 3<br>
> 4<br>
> 5<br>
> 6<br>
> 7<br>
> VECTORS velocity double<br>
> 3 4 5<br>
> 6 7 8<br>
> 1 2 3<br>
> 6 7 8<br>
> 8 9 0<br>
> I want to read this information into the arrays<br>
> xp[5], yp[5], zp[5] (the first block of numbers)<br>
> pressure[5] (second block)<br>
> density[5] (third block)<br>
> velocity_x[5], velocity_y[5] velocity_z[5] (fourth block)<br>
<br>
</div></div>If this is a .vtk "legacy" file, I think you can use:<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/GenericDataObjectReader" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/GenericDataObjectReader</a><br>
<font color="#888888"><br>
David<br>
</font></blockquote></div><br></div>