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(); 52 TPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2, 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;} 64 Double_t GetCornerRadius() const {return fCornerRadius;} 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(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 101