Re: clearing the pad

Rene Brun (Rene.Brun@cern.ch)
Mon, 05 Jan 1998 10:11:17 +0100


Ivar Siccama wrote:

> Dear ROOT developers,
>
> I am writing a simple event display which has
> a node structure with 3D shapes, similar to the tutorial example:
> http://root.cern.ch/root/html/examples/shapes.C.html
>
> The subnodes are in my case hits in the shape of tubes,
> these hits change for every event.
> I am trying to clear the pad or the mother-node before a new event
> is displayed but I did not succeed yet. The old hits (=nodes) are still
> visible in the pad.
>
> How do I clear the pad/mother node, or what do I have to
> clear/clean, so that the hits of the previous event are properly
> erased ?

Calling gPad->Clear() deletes the reference to all objects drawn
in the pad.
In your case, very likely, you keep creating new nodes in the list of
nodes
and you never delete your subnodes. Next time you draw the main node,
you see all old subnodes as well. Simply delete the subnodes.

The next version of Root will include a new class TMarker3DBox
designed for event display. A TMarker3DBox object has a position,
an orientation and a size.
The next version also has another new class THelix that can be used
to draw tracks in a magnetic field (thanks Ping Yeh).

Rene Brun