[vtkusers] vtkPolyData->GetPointData->GetScalars

Amy Squillacote amy.squillacote at kitware.com
Thu Jun 2 08:27:19 EDT 2005

Hi Kate,

Does your scalar array have a name (e.g., "temperature" or "pressure")?  If 
so, try the following in Tcl.

vtkFloatArray thisdata
         set thisdata [thisPointData GetArray "arrayName"]  # Put the name 
of your array in place of arrayName

- Amy

At 10:14 PM 6/1/2005, Katherine Kerekes wrote:
>Hello all,
>I have seen several postings on the group about problems getting scalars
>from vtkPolyData.  One message says that to do this in tcl, the correct
>syntax would be:
>[[polyData GetPointData] GetScalars]
>So my code is something like this
>vtkPointData thisPointData
>         set thisPointData [[polyloop GetOutput] GetPointData]
>vtkFloatArray thisdata
>         set thisdata [thisPointData GetScalars]
>         puts "thisdata=$thisdata"
>(polyloop is a vtkSelectPolyData)
>But when I do this I get nothing--thisdata="" instead of a vtkTemp object.
>I have read that in C++ casting the result of
>polyData->GetPointData()->GetScalars() to a vtkFloatArray will give results.
>How can I do something similar in tcl?  vtkFloatArray is not a defined data
>Please help!
>Kate Kerekes
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
>Follow this link to subscribe/unsubscribe:

More information about the vtkusers mailing list