[vtkusers] Adding two SCALARS into on vtkPolyData

Forrest Sheng Bao forrest.bao at gmail.com
Wed Jan 4 22:47:22 EST 2012


Hi,

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).

Suppose I have a vtkPolyData pointer

vtkPolyData* mesh;

and two vtkDoubleArray pointers

 vtkDoubleArray* depth;
 vtkDoubleArray* curv;

This is what I do:

depth->SetName("Depth");
mesh->GetPointData()->SetScalars(depth);
curv->SetName("Curvature");
mesh->GetPointData()->AddArray(curv);


I tried to write ``mesh'' into a VTK-format file and it seemed to be right.
But I wonder whether this is the right way to do so.

Cheers, Forrest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120104/000246db/attachment.htm>


More information about the vtkusers mailing list