[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IDLgrPolyline



"Leon Majewski" <majewski@cygnus.uwa.edu.au> wrote in message
397dbe55.6657070@news.uwa.edu.au">news:397dbe55.6657070@news.uwa.edu.au...
> ...
>
> I'm trying to create a field of displacement vectors, with arrows
> pointing from the origin (i,i) to the destination (i+delx, j+dely). I
> figured that a (whole lot of) polyline with an invisible character at
> the start and a visible character at the end would suffice for arrows
> - and this seems to be true (& easy).
>
> However I wonder if how I am adding each polyline to the model (view,
> window) is the best approach (see code segment below). When I have a
> large number of polylines to be added it takes a (rather) long time.

Object graphics operations become slow when there are more than a few
hundred atoms in your graphics tree. The fastest way (by far) to draw a
large number of line segments is to wrap them all in a single IDLgrPolyline.
Then you can handle several thousand or more. You specify the vertex
positions via the DATA keyword and how the vertices should be joined via the
POLYLINES keyword.

You might want to take a look at my "barb plot" class, which wraps up this
functionality:

http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/mghgrbarbplot__define.
pro
http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/mgh_example_barb.pro

To run the latter you will need other routines from my library. You can get
them all in one of these files:

http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/MARKS_ROUTINES.tar.gz
http://katipo.niwa.cri.nz/~hadfield/gust/software/idl/MARKS_ROUTINES.zip

I must admit that I haven't got proper heads on the arrows--the barb plot is
just a collection of lines. However it's pretty simple to mark the base
and/or the head of each barb with a symbol, much as you have done. But until
a few days ago I didn't even know IDLgrPolylines could *have* symbols (I
knew IDLgrPlot objects could) so I'm a bit behind there!

---
Mark Hadfield
m.hadfield@niwa.cri.nz  http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand