<div class="gmail_quote">On Wed, Jan 4, 2012 at 10:47 PM, Forrest Sheng Bao <span dir="ltr"><<a href="mailto:forrest.bao@gmail.com">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>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>