<div class="gmail_quote">On Wed, Jan 4, 2012 at 10:47 PM, Forrest Sheng Bao <span dir="ltr">&lt;<a href="mailto:forrest.bao@gmail.com">forrest.bao@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">
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-&gt;SetName(&quot;Depth&quot;);
mesh-&gt;GetPointData()-&gt;SetScalars(depth);
curv-&gt;SetName(&quot;Curvature&quot;);
mesh-&gt;GetPointData()-&gt;AddArray(curv)</pre></blockquote><div>Sure, that is fine. </div><div class="gmail_quote">You could equivalently do:</div><pre>mesh-&gt;GetPointData()-&gt;AddArray(depth);<br>mesh-&gt;GetPointData()-&gt;AddArray(curv)</pre>
<pre><pre>mesh-&gt;GetPointData()-&gt;SetActiveScalars(&quot;Depth&quot;);</pre></pre><div>David </div></div><br>