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

Re: IDLgrPolyline

"Leon Majewski" <majewski@cygnus.uwa.edu.au> wrote in message
> ...
> 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


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


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