<br><br><div class="gmail_quote">On Mon, Jul 6, 2009 at 2:35 AM, ClaudeG <span dir="ltr">&lt;<a href="mailto:claude.gangolf@gmail.com">claude.gangolf@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hi,<br>
<br>
I&#39;m programming in C++ for my VTK-project and i need a function to read a<br>
file where the data of the vector field a stored but the problem is that i<br>
have not the right idea how to write this function, can you help me please!<br>
<br>
Thx for any help you can give me!<br>
<br>
claude<br>
--</blockquote><div><br>What kind of file is your vector field in? Plain text? What is the format?<br><br><a href="http://www.vtk.org/Wiki/Write_a_file_of_triangle_corners">http://www.vtk.org/Wiki/Write_a_file_of_triangle_corners</a><br clear="all">
<br>Here is an outline of how to generate data and save it to a vtp file, you can probably cut the part about saving to a file and replace the part about generating the data with using standard c++ techniques to read from the ascii file. If that is the part you are having trouble with let us know.<br>
<br>There are other examples there that deal with Normals, so if you are looking to store vectors that may be worth looking at. The difference is that you set the number of components to 3.<br><pre class="de1">vtkDoubleArray<span class="sy2">*</span> PointNormalsArray <span class="sy1">=</span> vtkDoubleArray<span class="sy4">::</span><span class="kw3">New</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span><br>
        PointNormalsArray<span class="sy2">-</span><span class="sy1">&gt;</span>SetNumberOfComponents<span class="br0">(</span><span class="nu0">3</span><span class="br0">)</span><span class="sy4">;</span></pre><br><br>Thanks,<br>
<br>David <br></div></div>