Logo ROOT   6.08/07
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 #ifndef ROOT_TBox
17 #include "TBox.h"
18 #endif
19 #ifndef ROOT_TString
20 #include "TString.h"
21 #endif
22 
23 class TPave : public TBox {
24 
25 protected:
26  Double_t fX1NDC; ///< X1 point in NDC coordinates
27  Double_t fY1NDC; ///< Y1 point in NDC coordinates
28  Double_t fX2NDC; ///< X2 point in NDC coordinates
29  Double_t fY2NDC; ///< Y2 point in NDC coordinates
30  Int_t fBorderSize; ///< window box bordersize in pixels
31  Int_t fInit; ///< (=0 if transformation to NDC not yet done)
32  Int_t fShadowColor; ///< Color of the pave's shadow
33  Double_t fCornerRadius; ///< Corner radius in case of option arc
34  TString fOption; ///< Pave style
35  TString fName; ///< Pave name
36 
37 public:
38  // TPave status bits
39  enum {
40  kNameIsAction = BIT(11) ///< double clicking on TPave will execute action
41  };
42 
43  TPave();
45  Int_t bordersize=4 ,Option_t *option="br");
46  TPave(const TPave &pave);
47  virtual ~TPave();
48  void Copy(TObject &pave) const;
49  virtual void ConvertNDCtoPad();
50  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
51  virtual void Draw(Option_t *option="");
52  virtual void DrawPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
53  Int_t bordersize=4 ,Option_t *option="br");
54  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
55  Int_t GetBorderSize() const { return fBorderSize;}
57  Option_t *GetName() const {return fName.Data();}
58  Option_t *GetOption() const {return fOption.Data();}
59  Int_t GetShadowColor() const {return fShadowColor;}
60  Double_t GetX1NDC() const {return fX1NDC;}
61  Double_t GetX2NDC() const {return fX2NDC;}
62  Double_t GetY1NDC() const {return fY1NDC;}
63  Double_t GetY2NDC() const {return fY2NDC;}
64  virtual ULong_t Hash() const { return fName.Hash(); }
65  virtual Bool_t IsSortable() const { return kTRUE; }
66  virtual void ls(Option_t *option="") const;
67  virtual void Paint(Option_t *option="");
68  virtual void PaintPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
69  Int_t bordersize=4 ,Option_t *option="br");
70  virtual void PaintPaveArc(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
71  Int_t bordersize=4 ,Option_t *option="br");
72  virtual void Print(Option_t *option="") const;
73  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
74  virtual void SetBorderSize(Int_t bordersize=4) {fBorderSize = bordersize;} // *MENU*
75  virtual void SetCornerRadius(Double_t rad = 0.2) {fCornerRadius = rad;} // *MENU*
76  virtual void SetName(const char *name="") {fName = name;} // *MENU*
77  virtual void SetOption(Option_t *option="br") {fOption = option;}
78  virtual void SetShadowColor(Int_t color) {fShadowColor=color;} // *MENU*
79  virtual void SetX1NDC(Double_t x1) {fX1NDC=x1;}
80  virtual void SetX2NDC(Double_t x2) {fX2NDC=x2;}
81  virtual void SetY1NDC(Double_t y1) {fY1NDC=y1;}
82  virtual void SetY2NDC(Double_t y2) {fY2NDC=y2;}
83  virtual void SetX1(Double_t x1);
84  virtual void SetX2(Double_t x2);
85  virtual void SetY1(Double_t y1);
86  virtual void SetY2(Double_t y2);
87 
88  ClassDef(TPave,3) //Pave. A box with shadowing
89 };
90 
91 #endif
92 
Option_t * GetOption() const
Definition: TPave.h:58
virtual void SetName(const char *name="")
Definition: TPave.h:76
virtual void Print(Option_t *option="") const
Dump this pave with its attributes.
Definition: TPave.cxx:593
Double_t GetCornerRadius() const
Definition: TPave.h:56
const char Option_t
Definition: RtypesCore.h:62
virtual void SetX2NDC(Double_t x2)
Definition: TPave.h:80
Create a Box.
Definition: TBox.h:36
TString fName
Pave name.
Definition: TPave.h:35
#define BIT(n)
Definition: Rtypes.h:120
virtual ULong_t Hash() const
Return hash value for this object.
Definition: TPave.h:64
void Copy(TObject &pave) const
Copy this pave to pave.
Definition: TPave.cxx:167
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
double clicking on TPave will execute action
Definition: TPave.h:40
virtual void SetOption(Option_t *option="br")
Definition: TPave.h:77
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Definition: TString.cxx:606
A TBox with a bordersize and a shadow option.
Definition: TPave.h:23
virtual void ConvertNDCtoPad()
Convert pave coordinates from NDC to Pad coordinates.
Definition: TPave.cxx:121
virtual void SetY2(Double_t y2)
Set the Y2 value.
Definition: TPave.cxx:669
static const double x2[5]
#define ClassDef(name, id)
Definition: Rtypes.h:254
Double_t fX1NDC
X1 point in NDC coordinates.
Definition: TPave.h:26
virtual void SetCornerRadius(Double_t rad=0.2)
Definition: TPave.h:75
virtual ~TPave()
Pave default destructor.
Definition: TPave.cxx:97
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
Double_t GetX1NDC() const
Definition: TPave.h:60
virtual void SetShadowColor(Int_t color)
Definition: TPave.h:78
virtual void SetX1(Double_t x1)
Set the X1 value.
Definition: TPave.cxx:630
virtual void SetX1NDC(Double_t x1)
Definition: TPave.h:79
Double_t GetY1NDC() const
Definition: TPave.h:62
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:57
Int_t fBorderSize
window box bordersize in pixels
Definition: TPave.h:30
Double_t fCornerRadius
Corner radius in case of option arc.
Definition: TPave.h:33
virtual void SetY2NDC(Double_t y2)
Definition: TPave.h:82
Double_t GetY2NDC() const
Definition: TPave.h:63
Int_t GetShadowColor() const
Definition: TPave.h:59
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
Y2 point in NDC coordinates.
Definition: TPave.h:29
static const double x1[5]
Int_t fShadowColor
Color of the pave&#39;s shadow.
Definition: TPave.h:32
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
Double_t GetX2NDC() const
Definition: TPave.h:61
unsigned long ULong_t
Definition: RtypesCore.h:51
Double_t fX2NDC
X2 point in NDC coordinates.
Definition: TPave.h:28
virtual void SetX2(Double_t x2)
Set the X2 value.
Definition: TPave.cxx:643
Mother of all ROOT objects.
Definition: TObject.h:37
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
TPave()
Pave default constructor.
Definition: TPave.cxx:35
virtual void ls(Option_t *option="") const
List this pave with its attributes.
Definition: TPave.cxx:258
Int_t fInit
(=0 if transformation to NDC not yet done)
Definition: TPave.h:31
Double_t fY1NDC
Y1 point in NDC coordinates.
Definition: TPave.h:27
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
TString fOption
Pave style.
Definition: TPave.h:34
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual Bool_t IsSortable() const
Definition: TPave.h:65
char name[80]
Definition: TGX11.cxx:109
virtual void SetBorderSize(Int_t bordersize=4)
Definition: TPave.h:74
Int_t GetBorderSize() const
Definition: TPave.h:55
virtual void SetY1NDC(Double_t y1)
Definition: TPave.h:81
const char * Data() const
Definition: TString.h:349