[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: POLYFILL erases my tick values - solution?
"J.D. Smith" <jdsmith@astro.cornell.edu> writes:
> I have used:
>
> plot,x,y,XRANGE=xr,YRANGE=yr,XSTYLE=5,YSTYLE=5,/NODATA,POSITION=p
>
> to setup data coordinates in the case they are needed before the plot which
> would have set them.
I was going to suggest it too, but I wanted to my post to be short and
sweet :-) Anyway, this still doesn't get around the use of *two* PLOT
commands plus the POLYFILL.
> This brings up an interesting side problem: I have a direct graphics widget
> application which undershades various parts of a plot. These shaded regions can
> be moved with the mouse or arrow keys after selection with a mouse click. Since
> they *underly* the plot, the only reliable way of moving them I've found is
> re-shading and re-plotting at each step of the move. As you can imagine, this
> causes the updates to be somewhat... unappealing. A pixmap in the normal usage
> won't seem to do the job, since usually the trick is to restore some portion of
> the window and then overplot some changing feature (like a rubber-band selection
> outline).
...
You could re-render the entire thing in an off-screen pixmap, and then
dump the pixmap to the screen (or at least the relevant portion). I
believe this would be a classic example of so-called double buffering
in computer graphics.
If re-rendering the static scene is too expensive, then it might be
possible to precompute that part of it, along with an mask which
simply records the part of the image where the background doesn't show
through. Then you would continuously render the changing "underneath"
part of the image, and composite them together like so:
outimage = (static AND mask) + (underneath AND (NOT mask))
Obviously this can be improved further if the background color is
zero, then (static AND mask) is redundant; also (NOT mask) can be
precomputed.
Have fun,
Craig
P.S. It would be nice if you kept your lines < 80 characters. The
default line wrap murders your text otherwise.
--
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------