ROOT  6.06/09
Reference Guide
TPave.h
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Rene Brun 16/10/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TPave
13 #define ROOT_TPave
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TPave //
19 // //
20 // Pave class. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TBox
25 #include "TBox.h"
26 #endif
27 #ifndef ROOT_TString
28 #include "TString.h"
29 #endif
30 
31 class TPave : public TBox {
32 
33 protected:
34  Double_t fX1NDC; //X1 point in NDC coordinates
35  Double_t fY1NDC; //Y1 point in NDC coordinates
36  Double_t fX2NDC; //X2 point in NDC coordinates
37  Double_t fY2NDC; //Y2 point in NDC coordinates
38  Int_t fBorderSize; //window box bordersize in pixels
39  Int_t fInit; //(=0 if transformation to NDC not yet done)
40  Int_t fShadowColor; //Color of the pave's shadow
41  Double_t fCornerRadius; //Corner radius in case of option arc
42  TString fOption; //Pave style
43  TString fName; //Pave name
44 
45 public:
46  // TPave status bits
47  enum {
48  kNameIsAction = BIT(11) // double clicking on TPave will execute action
49  };
50 
51  TPave();
53  Int_t bordersize=4 ,Option_t *option="br");
54  TPave(const TPave &pave);
55  virtual ~TPave();
56  void Copy(TObject &pave) const;
57  virtual void ConvertNDCtoPad();
58  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
59  virtual void Draw(Option_t *option="");
60  virtual void DrawPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
61  Int_t bordersize=4 ,Option_t *option="br");
62  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
63  Int_t GetBorderSize() const { return fBorderSize;}
65  Option_t *GetName() const {return fName.Data();}
66  Option_t *GetOption() const {return fOption.Data();}
67  Int_t GetShadowColor() const {return fShadowColor;}
68  Double_t GetX1NDC() const {return fX1NDC;}
69  Double_t GetX2NDC() const {return fX2NDC;}
70  Double_t GetY1NDC() const {return fY1NDC;}
71  Double_t GetY2NDC() const {return fY2NDC;}
72  virtual ULong_t Hash() const { return fName.Hash(); }
73  virtual Bool_t IsSortable() const { return kTRUE; }
74  virtual void ls(Option_t *option="") const;
75  virtual void Paint(Option_t *option="");
76  virtual void PaintPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
77  Int_t bordersize=4 ,Option_t *option="br");
78  virtual void PaintPaveArc(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
79  Int_t bordersize=4 ,Option_t *option="br");
80  virtual void Print(Option_t *option="") const;
81  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
82  virtual void SetBorderSize(Int_t bordersize=4) {fBorderSize = bordersize;} // *MENU*
83  virtual void SetCornerRadius(Double_t rad = 0.2) {fCornerRadius = rad;} // *MENU*
84  virtual void SetName(const char *name="") {fName = name;} // *MENU*
85  virtual void SetOption(Option_t *option="br") {fOption = option;}
86  virtual void SetShadowColor(Int_t color) {fShadowColor=color;} // *MENU*
87  virtual void SetX1NDC(Double_t x1) {fX1NDC=x1;}
88  virtual void SetX2NDC(Double_t x2) {fX2NDC=x2;}
89  virtual void SetY1NDC(Double_t y1) {fY1NDC=y1;}
90  virtual void SetY2NDC(Double_t y2) {fY2NDC=y2;}
91  virtual void SetX1(Double_t x1);
92  virtual void SetX2(Double_t x2);
93  virtual void SetY1(Double_t y1);
94  virtual void SetY2(Double_t y2);
95 
96  ClassDef(TPave,3) //Pave. A box with shadowing
97 };
98 
99 #endif
100 
virtual void SetName(const char *name="")
Definition: TPave.h:84
ClassDef(TAttBBox2D, 0)
const char Option_t
Definition: RtypesCore.h:62
virtual void SetX2NDC(Double_t x2)
Definition: TPave.h:88
Create a Box.
Definition: TBox.h:44
TString fName
Definition: TPave.h:43
#define BIT(n)
Definition: Rtypes.h:120
Int_t GetBorderSize() const
Definition: TPave.h:63
Int_t GetShadowColor() const
Definition: TPave.h:67
Double_t GetX1NDC() const
Definition: TPave.h:68
Basic string class.
Definition: TString.h:137
Double_t GetY1NDC() const
Definition: TPave.h:70
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void Copy(TObject &pave) const
Copy this pave to pave.
Definition: TPave.cxx:167
virtual void SetOption(Option_t *option="br")
Definition: TPave.h:85
Double_t GetCornerRadius() const
Definition: TPave.h:64
A TBox with a bordersize and a shadow option.
Definition: TPave.h:31
virtual void ConvertNDCtoPad()
Convert pave coordinates from NDC to Pad coordinates.
Definition: TPave.cxx:121
const char * Data() const
Definition: TString.h:349
virtual void SetY2(Double_t y2)
Set the Y2 value.
Definition: TPave.cxx:669
static const double x2[5]
Double_t fX1NDC
Definition: TPave.h:34
virtual void SetCornerRadius(Double_t rad=0.2)
Definition: TPave.h:83
virtual ~TPave()
Pave default destructor.
Definition: TPave.cxx:97
Double_t GetY2NDC() const
Definition: TPave.h:71
virtual Bool_t IsSortable() const
Definition: TPave.h:73
char * out
Definition: TBase64.cxx:29
virtual void PaintPaveArc(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t bordersize=4, Option_t *option="br")
Draw this pave with rounded corners.
Definition: TPave.cxx:392
Option_t * GetOption() const
Definition: TPave.h:66
virtual void ls(Option_t *option="") const
List this pave with its attributes.
Definition: TPave.cxx:258
virtual void SetShadowColor(Int_t color)
Definition: TPave.h:86
virtual void SetX1(Double_t x1)
Set the X1 value.
Definition: TPave.cxx:630
virtual void SetX1NDC(Double_t x1)
Definition: TPave.h:87
virtual void Paint(Option_t *option="")
Paint this pave with its current attributes.
Definition: TPave.cxx:283
Option_t * GetName() const
Returns name of object.
Definition: TPave.h:65
Int_t fBorderSize
Definition: TPave.h:38
Double_t fCornerRadius
Definition: TPave.h:41
virtual void SetY2NDC(Double_t y2)
Definition: TPave.h:90
virtual void Draw(Option_t *option="")
Draw this pave with its current attributes.
Definition: TPave.cxx:209
virtual void SetY1(Double_t y1)
Set the Y1 value.
Definition: TPave.cxx:656
Double_t fY2NDC
Definition: TPave.h:37
static const double x1[5]
Int_t fShadowColor
Definition: TPave.h:40
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TPave.cxx:234
double Double_t
Definition: RtypesCore.h:55
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a pave.
Definition: TPave.cxx:189
unsigned long ULong_t
Definition: RtypesCore.h:51
virtual void Print(Option_t *option="") const
Dump this pave with its attributes.
Definition: TPave.cxx:593
Double_t GetX2NDC() const
Definition: TPave.h:69
Double_t fX2NDC
Definition: TPave.h:36
virtual void SetX2(Double_t x2)
Set the X2 value.
Definition: TPave.cxx:643
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
virtual void DrawPave(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t bordersize=4, Option_t *option="br")
Draw this pave with new coordinates.
Definition: TPave.cxx:221
Int_t fInit
Definition: TPave.h:39
Double_t fY1NDC
Definition: TPave.h:35
virtual void PaintPave(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t bordersize=4, Option_t *option="br")
Draw this pave with new coordinates.
Definition: TPave.cxx:294
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TPave.cxx:601
virtual ULong_t Hash() const
Return hash value for this object.
Definition: TPave.h:72
TString fOption
Definition: TPave.h:42
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void SetBorderSize(Int_t bordersize=4)
Definition: TPave.h:82
virtual void SetY1NDC(Double_t y1)
Definition: TPave.h:89
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Definition: TString.cxx:605