Hi David, <br><br>A minor thing. Using either your code or mine, in the output file, between the SCALARS block for curv and the one for depth, I saw the follows. <br><br><div style="margin-left:40px"><span style="font-family:courier new,monospace">FIELD FieldData 1</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">Depth 1 133597 double</span><br></div><br>It causes problems when I load the file using VTK's Python wrapper in
Python. Interestingly, it had no problem with some visualization
software, e.g., MayaVI.<br><br>To "fix" this, is there any way that I can <br>1. get rid of the "<span style="font-family:courier new,monospace">FIELD FieldData 1</span>" line and,<br>2. have "<span style="font-family:courier new,monospace">Depth 1 133597 double</span>" changed into "<span style="font-family:courier new,monospace">SCALARS Depth double</span>" and,<br>
3. add a line "<span style="font-family:courier new,monospace">LOOKUP_TABLE default</span>" ? <br>
<br clear="all">Cheers, Forrest<br><br><div class="gmail_quote">On Thu, Jan 5, 2012 at 7:02 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="gmail_quote"><div>On Wed, Jan 4, 2012 at 10:47 PM, Forrest Sheng Bao <span dir="ltr"><<a href="mailto:forrest.bao@gmail.com" target="_blank">forrest.bao@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br><br>I am trying to associate two scalars to points of a vtkPolyData object (i.e., I want to see two SCALARS blocks in POINTDATA segment in the output VTK file). <br><br>Suppose I have a vtkPolyData pointer <br>
<pre>vtkPolyData* mesh;
</pre>and two vtkDoubleArray pointers <br>
<pre> vtkDoubleArray* depth;
vtkDoubleArray* curv;
</pre>
This is what I do: <br>
<pre>depth->SetName("Depth");
mesh->GetPointData()->SetScalars(depth);
curv->SetName("Curvature");
mesh->GetPointData()->AddArray(curv)</pre></blockquote></div><div>Sure, that is fine. </div><div class="gmail_quote">You could equivalently do:</div><pre>mesh->GetPointData()->AddArray(depth);<br>mesh->GetPointData()->AddArray(curv)</pre>
<pre><pre>mesh->GetPointData()->SetActiveScalars("Depth");</pre></pre><div>David </div></div><br>
</blockquote></div><br>