File indexing completed on 2025-01-18 10:12:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TPave
0013 #define ROOT_TPave
0014
0015
0016 #include "TBox.h"
0017 #include "TString.h"
0018
0019 class TPave : public TBox {
0020
0021 protected:
0022 Double_t fX1NDC;
0023 Double_t fY1NDC;
0024 Double_t fX2NDC;
0025 Double_t fY2NDC;
0026 Int_t fBorderSize;
0027 Int_t fInit;
0028 Int_t fShadowColor;
0029 Double_t fCornerRadius;
0030 TString fOption;
0031 TString fName;
0032
0033 public:
0034
0035 enum {
0036 kNameIsAction = BIT(11)
0037 };
0038
0039 TPave();
0040 TPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
0041 Int_t bordersize=4 ,Option_t *option="br");
0042 TPave(const TPave &pave);
0043 ~TPave() override;
0044
0045 TPave &operator=(const TPave &src);
0046
0047 void Copy(TObject &pave) const override;
0048 virtual void ConvertNDCtoPad();
0049 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0050 void Draw(Option_t *option="") override;
0051 virtual TPave *DrawPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
0052 Int_t bordersize=4 ,Option_t *option="br");
0053 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0054 Int_t GetBorderSize() const { return fBorderSize;}
0055 Double_t GetCornerRadius() const {return fCornerRadius;}
0056 const char *GetName() const override {return fName.Data();}
0057 Option_t *GetOption() const override {return fOption.Data();}
0058 Int_t GetShadowColor() const {return fShadowColor;}
0059 Double_t GetX1NDC() const {return fX1NDC;}
0060 Double_t GetX2NDC() const {return fX2NDC;}
0061 Double_t GetY1NDC() const {return fY1NDC;}
0062 Double_t GetY2NDC() const {return fY2NDC;}
0063 ULong_t Hash() const override { return fName.Hash(); }
0064 Bool_t IsSortable() const override { return kTRUE; }
0065 void ls(Option_t *option="") const override;
0066 void Paint(Option_t *option="") override;
0067 virtual void PaintPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
0068 Int_t bordersize=4 ,Option_t *option="br");
0069 virtual void PaintPaveArc(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
0070 Int_t bordersize=4 ,Option_t *option="br");
0071 void Print(Option_t *option="") const override;
0072 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0073
0074
0075
0076
0077 virtual void SetBorderSize(Int_t bordersize=4) {fBorderSize = bordersize;}
0078 virtual void SetCornerRadius(Double_t rad = 0.2) {fCornerRadius = rad;}
0079 virtual void SetName(const char *name="") {fName = name;}
0080 virtual void SetOption(Option_t *option="br") {fOption = option;}
0081 virtual void SetShadowColor(Int_t color) {fShadowColor=color;}
0082 virtual void SetX1NDC(Double_t x1) {fX1NDC=x1;}
0083 virtual void SetX2NDC(Double_t x2) {fX2NDC=x2;}
0084 virtual void SetY1NDC(Double_t y1) {fY1NDC=y1;}
0085 virtual void SetY2NDC(Double_t y2) {fY2NDC=y2;}
0086 void SetX1(Double_t x1) override;
0087 void SetX2(Double_t x2) override;
0088 void SetY1(Double_t y1) override;
0089 void SetY2(Double_t y2) override;
0090
0091 ClassDefOverride(TPave,3)
0092 };
0093
0094 #endif
0095