[vtkusers] Re: Streamlines from a FloatArray

tom fogal tfogal at apollo.sr.unh.edu
Wed Jul 7 11:18:05 EDT 2004


Sorry all for bothering the list again, but I seem to have figured it out!

Looking through the code a little better (particularly
streamer::Integrate), it seems obvious to me that the input to a
vtkStreamer should be a 'grid' of sorts, because it looks for the
input's GetPointData(), from which it derives the vectors for use in
the streamline -- this fits in with exactly what I want, which makes me
confident that my vtkRectilinearGridSource-based reader is done
correctly =)

So for future users/searchers of the list, make sure your reader object
does something like this:

/* vector is a 3-component array of the vector field */
vector->SetName("my_vectors");
output->GetPointData()->SetVectors(vectors);
output->GetPointData()->SetActiveVectors("my_vectors");

If those are set as such than you should be able to pass things into
objects like vtkStreamer.

HTH,

-tom

 <200407071504.i67F4LxV021538 at apollo.sr.unh.edu>tom fogal writes:
><OFBED18E15.1239F85E-ONC1256ECA.001C98F2-C1256ECA.001D805F at diamond.philips.com
>> ursula.goette at philips.com writes:
>> 1. do you also have a spacing for the vector field (points?)
>
>spacing? I'm not sure I follow you -- are you asking if I have a
>rigid format to the field, as in one reading every 2 'x units', etc ?
>The floatarray is setup to have groups of 3 tuples like:
>
>x0, y0, z0, x1, y1, z1, x2, y2, z2, ...
>
>oh, now that I think about it those are just the strength of the vector
>field at a point, and perhaps you are asking how VTK is to know WHICH
>point to associate that strength with?
>
>> 2. do you give the stream line (a) source point(s) to start from?
>
>yes. I've tried the origin and some points around there when I noticed
>that in vtkStreamer::Integrate() it would end up multiplying by the
>start location =)
>
>> 3. do you set all the other things necessary to create the stream line?
>>
>> Why don't you check out the example file officeTube.tcl. There you
>> can see how to use the filter.
>
>I believe I set everything correctly. I pretty much copied the relevant
>sections from the officeTube.tcl and then changed the input to come
>from my floatarray -> points -> polydata chain.
>
>Thanks for your help!
>
>-tom
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cg
>i-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list