Re: [ROOT] When things get small.

From: Brett Viren (bv@bnl.gov)
Date: Thu Apr 26 2001 - 23:14:23 MEST


Valeri Fine (Faine) writes:
 > 
 > 
 > > Hi,
 > > 
 > > I am using TBox'es to draw some hit detector elements on to a TPad.
 > > At the default zoom these TBox'es get drawn either very small or not
 > > at all.  To solve this I would like some way to give the elements an
 > > artificial minimum size in pixels (say 1x1 or 2x2 pixels).
 > 
 > Can you create a concurrent structure with TPolyMarker3D instead 
 > of your TBox'es an choose either one depends of your ZOOM parameter? 

As a (maybe not so) temporary kludge, I tried a switch along similar
lines.  Instead of switching objects drawn I artificially inflate the
size of the box by doing the following in my TBox derived class's
Paint() method:

 - convert TBox boundary to pixel coordinates
 - check if width or height is <2 pixels
 - enlarge these to 2 pixels if necessary
 - convert back to world coordinates
 - call TBox::PaintBox() with the (possibly modified) world coords.

Since behind the scenes ROOT must eventually plot in pixels, there is
double conversion.

This does force everything to be visible even if the TBox is truly <1
pixel in size but causes ``shimmering'' durring zooming (maybe due to
rounding errors between the multiple transforms between world and
pixel coords).

Thanks,
-Brett.



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:43 MET