ROOT logo
ROOT » GRAF2D » GRAF » TBox

class TBox: public TObject, public TAttLine, public TAttFill, public TAttBBox2D


Box class

A box is defined by :
  • Its bottom left coordinates x1,y1
  • Its top right coordinates x2,y2
A box has line attributes (see TAttLine) and fill area attributes (see TAttFill).
 

Function Members (Methods)

public:
TBox()
TBox(const TBox& box)
TBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
virtual~TBox()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidCopy(TObject& box) const
virtual voidTObject::Delete(Option_t* option = "")MENU
Int_tTAttLine::DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
virtual Int_tDistancetoPrimitive(Int_t px, Int_t py)
virtual voidDraw(Option_t* option = "")
virtual TBox*DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Rectangle_tGetBBox()
virtual TPointGetBBoxCenter()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Color_tTAttFill::GetFillColor() const
virtual Style_tTAttFill::GetFillStyle() const
virtual const char*TObject::GetIconName() const
virtual Color_tTAttLine::GetLineColor() const
virtual Style_tTAttLine::GetLineStyle() const
virtual Width_tTAttLine::GetLineWidth() const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
Double_tGetX1() const
Double_tGetX2() const
Double_tGetY1() const
Double_tGetY2() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidHideToolTip(Int_t event)
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
Bool_tIsBeingResized() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
virtual Int_tIsInside(Double_t x, Double_t y) const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
virtual Bool_tTAttFill::IsTransparent() const
Bool_tTObject::IsZombie() const
virtual voidls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual voidTAttLine::Modify()
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TBox&operator=(const TBox&)
virtual voidPaint(Option_t* option = "")
virtual voidPaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidTAttFill::ResetAttFill(Option_t* option = "")
virtual voidTAttLine::ResetAttLine(Option_t* option = "")
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTAttFill::SaveFillAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1001)
virtual voidTAttLine::SaveLineAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1, Int_t widdef = 1)
virtual voidSavePrimitive(ostream& out, Option_t* option = "")
virtual voidSetBBoxCenter(const TPoint& p)
virtual voidSetBBoxCenterX(const Int_t x)
virtual voidSetBBoxCenterY(const Int_t y)
virtual voidSetBBoxX1(const Int_t x)
virtual voidSetBBoxX2(const Int_t x)
virtual voidSetBBoxY1(const Int_t y)
virtual voidSetBBoxY2(const Int_t y)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTAttFill::SetFillAttributes()MENU
virtual voidTAttFill::SetFillColor(Color_t fcolor)
virtual voidTAttFill::SetFillColorAlpha(Color_t fcolor, Float_t falpha)
virtual voidTAttFill::SetFillStyle(Style_t fstyle)
virtual voidTAttLine::SetLineAttributes()MENU
virtual voidTAttLine::SetLineColor(Color_t lcolor)
virtual voidTAttLine::SetLineColorAlpha(Color_t lcolor, Float_t lalpha)
virtual voidTAttLine::SetLineStyle(Style_t lstyle)
virtual voidTAttLine::SetLineWidth(Width_t lwidth)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidSetToolTipText(const char* text, Long_t delayms = 1000)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidSetX1(Double_t x1)
virtual voidSetX2(Double_t x2)
virtual voidSetY1(Double_t y1)
virtual voidSetY2(Double_t y2)
virtual voidShowMembers(TMemberInspector&)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

protected:
Color_tTAttFill::fFillColorfill area color
Style_tTAttFill::fFillStylefill area style
Color_tTAttLine::fLineColorline color
Style_tTAttLine::fLineStyleline style
Width_tTAttLine::fLineWidthline width
Bool_tfResizing!True if box is being resized
Double_tfX1X of 1st point
Double_tfX2X of 2nd point
Double_tfY1Y of 1st point
Double_tfY2Y of 2nd point
private:
TObject*fTip!tool tip associated with box

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TBox()
 Box default constructor.
TBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 Box standard constructor.
~TBox()
 Box destructor.
TBox(const TBox& box)
 Box copy constructor.
TBox& operator=(const TBox& )
 Assignment operator.
void Copy(TObject& box) const
 Copy a Box.
Int_t DistancetoPrimitive(Int_t px, Int_t py)
 Compute distance from point px,py to a box.

 Compute the closest distance of approach from point px,py to the
 edges of this box.
 The distance is computed in pixels units.

 In case of a filled box the distance returned is 0 if the point
 (px,py) is inside the box, and is huge if the point is outside.
void Draw(Option_t* option = "")
 Draw this box with its current attributes.
 if the box has no fill style (ie fill style=0), the box contour is drawn
 if the box has a fill style, the box contour is not drawn by default.
 to force the contour to be drawn, specify option "l"
TBox * DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 Draw this box with new coordinates.
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
 Execute action corresponding to one event.

  This member function is called when a BOX/WBOX/PAD object is clicked.

  If the mouse is clicked in one of the 4 corners of the box (pA,pB,pC,pD)
  the box is resized with the rubber rectangle.

  If the mouse is clicked inside the box, the box is moved.

  If the mouse is clicked on the 4 edges (pL,pR,pTop,pBot), the box is
  rescaled parallel to this edge (same as Motif window manager).

    pA                 pTop                       pB
     +--------------------------------------------+
     |                                            |
     |                                            |
     |                                            |
   pL|                  pINSIDE                   |pR
     |                                            |
     |                                            |
     |                                            |
     |                                            |
     +--------------------------------------------+
    pD                 pBot                      pC

  Note that this function is duplicated on purpose by TPad::ExecuteEvent.
  If somebody modifies this function, may be similar changes should also
  be applied to TPad::ExecuteEvent.
void HideToolTip(Int_t event)
 Hide tool tip depending on the event type. Typically tool tips
 are hidden when event is not a kMouseEnter and not a kMouseMotion
 event.
Int_t IsInside(Double_t x, Double_t y) const
 Function which returns 1 if point x,y lies inside the box, 0 otherwise.
void ls(Option_t* option = "") const
 List this box with its attributes.
void Paint(Option_t* option = "")
 Paint this box with its current attributes.
void PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t* option = "")
 Draw this box with new coordinates.
void Print(Option_t* option = "") const
 Dump this box with its attributes.
void SavePrimitive(ostream& out, Option_t* option = "")
 Save primitive as a C++ statement(s) on output stream out
void SetToolTipText(const char* text, Long_t delayms = 1000)
 Set tool tip text associated with this box. The delay is in
 milliseconds (minimum 250). To remove tool tip call method with
 text = 0.
void Streamer(TBuffer& )
 Stream an object of class TBox.
Rectangle_t GetBBox()
 Return the "bounding Box" of the Box
TPoint GetBBoxCenter()
 Return the center of the Box as TPoint in pixels
void SetBBoxCenter(const TPoint& p)
 Set center of the Box
void SetBBoxCenterX(const Int_t x)
 Set X coordinate of the center of the Box
void SetBBoxCenterY(const Int_t y)
 Set Y coordinate of the center of the Box
void SetBBoxX1(const Int_t x)
 Set lefthandside of BoundingBox to a value
 (resize in x direction on left)
void SetBBoxX2(const Int_t x)
 Set righthandside of BoundingBox to a value
 (resize in x direction on right)
void SetBBoxY1(const Int_t y)
 Set top of BoundingBox to a value (resize in y direction on top)
void SetBBoxY2(const Int_t y)
 Set bottom of BoundingBox to a value
 (resize in y direction on bottom)
Bool_t IsBeingResized() const
{ return fResizing; }
Double_t GetX1() const
{ return fX1; }
Double_t GetX2() const
{ return fX2; }
Double_t GetY1() const
{ return fY1; }
Double_t GetY2() const
{ return fY2; }
void SetX1(Double_t x1)
{fX1=x1;}
void SetX2(Double_t x2)
{fX2=x2;}
void SetY1(Double_t y1)
{fY1=y1;}
void SetY2(Double_t y2)
{fY2=y2;}