Re: Drawing an angled box

From: Tom Roberts <tjrob_at_fnal.gov>
Date: Thu, 12 Mar 2009 23:08:29 -0500


Fine, Valeri wrote:
> What about
> http://root.cern.ch/root/html522/TPolyLine.html
> One can draw the contour of the polyline or/and its fill area

Thanks! That works just fine.

Two further questions about this:

  1. How does one learn such things -- after all, it's not at all obvious that a polyline can fill its enclosed area (it can do this even if it's not closed -- it adds an edge to close itself).
  2. some objects, such as TMarker, don't need to be re-drawn after a change, while others, such as TPolyLine do need to be re-drawn. How can one tell? Or should I just re-draw them all?

Tom Roberts

> . . . "
>
> Best Regards
> Valeri Fine
> ---------------
> Brookhaven National Laboratory
> Upton, NY 11973, USA
> Phone: +1 631 344 7806
> Fax: +1 631 344 4206
> E-mail: fine_at_bnl.gov
>

>> -----Original Message-----
>> From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch]

> On
>> Behalf Of Tom Roberts
>> Sent: Thursday, March 12, 2009 5:50 PM
>> To: 'ROOT Talk'
>> Subject: [ROOT] Drawing an angled box
>>
>> I have a need to draw a colored rectangle with arbitrary orientation

> on
>> the screen; TBox does not do that. I do not need lines around the

> edge,
>> so it is tempting to use a big fat line. Unfortunately, linewidth is
>> specified in pixels, and widths greater than about 80 pixels don't

> work.
>> The first is easily handled with a coordinate conversion, but the

> second
>> means I have to draw multiple lines, a much bigger complexity.
>>
>> Is there a good way to do this?
>>
>> 	The base data I start with are: Xcenter, Ycenter, width,
>> 	height, angle, color. The first 4 are in user coordinates;
>> 	angle is in degrees; color is R,G,B.
>>
>>
>> Tom Roberts

>
Received on Fri Mar 13 2009 - 05:08:57 CET

This archive was generated by hypermail 2.2.0 : Fri Mar 13 2009 - 11:50:02 CET