[vtkusers] How to use more than one set of scalar (or other) data from a dataset?

s comp sscomp2004 at yahoo.com.au
Mon Oct 18 22:25:50 EDT 2004


Thanks Tom,
 
But it did not work, perhaps because I am using an unstructured grid, which doesn't seem to recognise the method "SetActiveScalars", what should be the equivalent I think, "SetScalarsName", is recognised, but doesn't do what I expected as I said (It always uses the scalar field that comes last in the script).
 
Does anyone know how to use different scalar fields in different parts of the one TCL script?
 
I am guessing this has something to do with the lazy algorithm, meaning that these scripts don't execute in a linear fasion?
 
Sonam

tom fogal <tfogal at apollo.sr.unh.edu> wrote:
<20041018115934.57007.qmail at web61101.mail.yahoo.com>s comp writes:
>How, for example, do I contour 2 different scalar fields from the one data set
> at the same time?
>
>The obvious way of using SetScalarsName once creating a contour, and then usin
>g SetScalarsName again to change the scalar field, and creating another contou
>r does not work - both contours are of the same scalar field.

Try 'SetActiveScalars(char*)'. The string it takes is the name given to
the scalars via AddArray() and SetArray() [which both use the name of
the vtkArray which is passed into it].
These methods are off of vtkPointData or one of its parents, I believe.
For example, for a rectilinear grid (at least) I would do:

Grid->GetPointData()->SetActiveScalars("data1");
[ . . . generate contour . . .]
Grid->GetPointData()->SetActiveScalars("data2");
[ . . . generate contour . . .]

HTH,

-tom





---------------------------------
Find local movie times and trailers on Yahoo! Movies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20041019/c5fe8b34/attachment.htm>


More information about the vtkusers mailing list