Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 #include "TBox.h"
17 #include "TString.h"
18 
19 class TPave : public TBox {
20 
21 protected:
22  Double_t fX1NDC; ///< X1 point in NDC coordinates
23  Double_t fY1NDC; ///< Y1 point in NDC coordinates
24  Double_t fX2NDC; ///< X2 point in NDC coordinates
25  Double_t fY2NDC; ///< Y2 point in NDC coordinates
26  Int_t fBorderSize; ///< window box bordersize in pixels
27  Int_t fInit; ///< (=0 if transformation to NDC not yet done)
28  Int_t fShadowColor; ///< Color of the pave's shadow
29  Double_t fCornerRadius; ///< Corner radius in case of option arc
30  TString fOption; ///< Pave style
31  TString fName; ///< Pave name
32 
33 public:
34  // TPave status bits
35  enum {
36  kNameIsAction = BIT(11) ///< double clicking on TPave will execute action
37  };
38 
39  TPave();
40  TPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
41  Int_t bordersize=4 ,Option_t *option="br");
42  TPave(const TPave &pave);
43  virtual ~TPave();
44 
45  TPave &operator=(const TPave &src);
46 
47  void Copy(TObject &pave) const;
48  virtual void ConvertNDCtoPad();
49  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
50  virtual void Draw(Option_t *option="");
51  virtual void DrawPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
52  Int_t bordersize=4 ,Option_t *option="br");
53  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
54  Int_t GetBorderSize() const { return fBorderSize;}
55  Double_t GetCornerRadius() const {return fCornerRadius;}
56  Option_t *GetName() const {return fName.Data();}
57  Option_t *GetOption() const {return fOption.Data();}
58  Int_t GetShadowColor() const {return fShadowColor;}
59  Double_t GetX1NDC() const {return fX1NDC;}
60  Double_t GetX2NDC() const {return fX2NDC;}
61  Double_t GetY1NDC() const {return fY1NDC;}
62  Double_t GetY2NDC() const {return fY2NDC;}
63  virtual ULong_t Hash() const { return fName.Hash(); }
64  virtual Bool_t IsSortable() const { return kTRUE; }
65  virtual void ls(Option_t *option="") const;
66  virtual void Paint(Option_t *option="");
67  virtual void PaintPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
68  Int_t bordersize=4 ,Option_t *option="br");
69  virtual void PaintPaveArc(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
70  Int_t bordersize=4 ,Option_t *option="br");
71  virtual void Print(Option_t *option="") const;
72  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
73  virtual void SetBorderSize(Int_t bordersize=4) {fBorderSize = bordersize;} // *MENU*
74  virtual void SetCornerRadius(Double_t rad = 0.2) {fCornerRadius = rad;} // *MENU*
75  virtual void SetName(const char *name="") {fName = name;} // *MENU*
76  virtual void SetOption(Option_t *option="br") {fOption = option;}
77  virtual void SetShadowColor(Int_t color) {fShadowColor=color;} // *MENU*
78  virtual void SetX1NDC(Double_t x1) {fX1NDC=x1;}
79  virtual void SetX2NDC(Double_t x2) {fX2NDC=x2;}
80  virtual void SetY1NDC(Double_t y1) {fY1NDC=y1;}
81  virtual void SetY2NDC(Double_t y2) {fY2NDC=y2;}
82  virtual void SetX1(Double_t x1);
83  virtual void SetX2(Double_t x2);
84  virtual void SetY1(Double_t y1);
85  virtual void SetY2(Double_t y2);
86 
87  ClassDef(TPave,3) //Pave. A box with shadowing
88 };
89 
90 #endif
91