Re: Copying Pads

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Oct 12 1998 - 11:22:31 MEST


Mark C. Szigety wrote:
> 
> Rooters:
>   quick question.  i have a pad in which i have drawn a figure (in this
> case, the 2-D layout of a detector).  i would like to draw other figures on
> top of this detector (specifically, trajectories).  however, i would like
> to draw them one at a time and, thus, every time i hit a button to draw the
> next event, i want the old event erased, but the original picture of the
> layout to remain where it was.  is there a quick way to do this?  i just
> don't want to redraw the layout every time a user wants to display a new
> event.  i can think of some solutions, but they are all memory intensive.
> any suggestions?
> 
> thanks a bunch,
> mark szigety

Mark,
The Root pad drawing/updating mechanism is fully described at URL:
  http://root.cern.ch/root/HowtoDraw.html
In your case, with the current version of Root, you have the choice
between:
 - clear the pad, draw detector and tracks for each event
 - draw the detector once. at each new event, remove tracks from the
   pad list of primitives.
The two options are equivalent in performance. In both cases, the
detector
Paint function and the tracks Paint function will be invoked.
The ideal solution (as indicated by Valery) would be to support
transparent
pads. It is our intention to support this option in the future versions
and also (same problem) support for images (gif,etc) as background for a
pad.

Meanwhile, I suggest you use option 1 above.

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:38 MET