File indexing completed on 2025-10-27 09:00:58
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 TString GetSavePaveArgs(const char *extra_arg = nullptr, Bool_t save_option = kTRUE);
0034
0035 public:
0036
0037 enum {
0038 kNameIsAction = BIT(11)
0039 };
0040
0041 TPave();
0042 TPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
0043 Int_t bordersize=4, Option_t *option="br");
0044 TPave(const TPave &pave);
0045 ~TPave() override;
0046
0047 TPave &operator=(const TPave &src);
0048
0049 void Copy(TObject &pave) const override;
0050 virtual void ConvertNDCtoPad();
0051 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0052 void Draw(Option_t *option="") override;
0053 virtual TPave *DrawPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
0054 Int_t bordersize=4 ,Option_t *option="br");
0055 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0056 Int_t GetBorderSize() const { return fBorderSize;}
0057 Double_t GetCornerRadius() const {return fCornerRadius;}
0058 const char *GetName() const override {return fName.Data();}
0059 Option_t *GetOption() const override {return fOption.Data();}
0060 Int_t GetShadowColor() const {return fShadowColor;}
0061 Double_t GetX1NDC() const {return fX1NDC;}
0062 Double_t GetX2NDC() const {return fX2NDC;}
0063 Double_t GetY1NDC() const {return fY1NDC;}
0064 Double_t GetY2NDC() const {return fY2NDC;}
0065 ULong_t Hash() const override { return fName.Hash(); }
0066 Bool_t IsSortable() const override { return kTRUE; }
0067 void ls(Option_t *option="") const override;
0068 void Paint(Option_t *option="") override;
0069 virtual void PaintPave(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
0070 Int_t bordersize=4 ,Option_t *option="br");
0071 virtual void PaintPaveArc(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2,
0072 Int_t bordersize=4 ,Option_t *option="br");
0073 void Print(Option_t *option="") const override;
0074 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0075
0076
0077
0078
0079 virtual void SetBorderSize(Int_t bordersize=4) {fBorderSize = bordersize;}
0080 virtual void SetCornerRadius(Double_t rad = 0.2) {fCornerRadius = rad;}
0081 virtual void SetName(const char *name="") {fName = name;}
0082 virtual void SetOption(Option_t *option="br") {fOption = option;}
0083 virtual void SetShadowColor(Int_t color) {fShadowColor=color;}
0084 virtual void SetX1NDC(Double_t x1) {fX1NDC=x1;}
0085 virtual void SetX2NDC(Double_t x2) {fX2NDC=x2;}
0086 virtual void SetY1NDC(Double_t y1) {fY1NDC=y1;}
0087 virtual void SetY2NDC(Double_t y2) {fY2NDC=y2;}
0088 void SetX1(Double_t x1) override;
0089 void SetX2(Double_t x2) override;
0090 void SetY1(Double_t y1) override;
0091 void SetY2(Double_t y2) override;
0092
0093 ClassDefOverride(TPave,3)
0094 };
0095
0096 #endif
0097