ROOT logo
ROOT » GUI » GUI » TGRectangle

class TGRectangle


TGDimension, TGPosition, TGLongPosition, TGInsets and TGRectangle

Several small geometry classes that implement dimensions
(width and height), positions (x and y), insets and rectangles.
They are trivial and their members are public.


Function Members (Methods)

public:
TGRectangle()
TGRectangle(const TGRectangle& r)
TGRectangle(const TGPosition& p, const TGDimension& d)
TGRectangle(Int_t rx, Int_t ry, UInt_t rw, UInt_t rh)
virtual~TGRectangle()
Int_tArea() const
static TClass*Class()
Bool_tContains(const TGPosition& p) const
Bool_tContains(Int_t px, Int_t py) const
voidEmpty()
Bool_tIntersects(const TGRectangle& r) const
virtual TClass*IsA() const
Bool_tIsEmpty() const
TGPositionLeftTop() const
voidMerge(const TGRectangle& r)
TGRectangle&operator=(const TGRectangle&)
TGPositionRightBottom() const
virtual voidShowMembers(TMemberInspector& insp, char* parent)
TGDimensionSize() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)

Data Members

public:
UInt_tfHheight
UInt_tfWwidth
Int_tfXx position
Int_tfYy position

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

void Merge(const TGRectangle& r)
 Merge parameters
TGRectangle()
 constructors
{ Empty(); }
TGRectangle(Int_t rx, Int_t ry, UInt_t rw, UInt_t rh)
{ }
TGRectangle(const TGPosition& p, const TGDimension& d)
{ }
TGRectangle(const TGRectangle& r)
{ }
virtual ~TGRectangle()
{ }
Bool_t Contains(Int_t px, Int_t py) const
 methods
Bool_t Contains(const TGPosition& p) const
Bool_t Intersects(const TGRectangle& r) const
Int_t Area() const
{ return (fW * fH); }
TGDimension Size() const
{ return TGDimension(fW, fH); }
TGPosition LeftTop() const
{ return TGPosition(fX, fY); }
TGPosition RightBottom() const
{ return TGPosition(fX + (Int_t) fW - 1, fY + (Int_t) fH - 1); }
void Empty()
{ fX = fY = 0; fW = fH = 0; }
Bool_t IsEmpty() const
{ return ((fW == 0) && (fH == 0)); }