Warning, file /include/root/TText.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TText
0013 #define ROOT_TText
0014
0015
0016 #include "TAttText.h"
0017 #include "TNamed.h"
0018 #include "TAttBBox2D.h"
0019
0020 class TPoint;
0021
0022 class TText : public TNamed, public TAttText, public TAttBBox2D {
0023
0024 protected:
0025 Double_t fX{0};
0026 Double_t fY{0};
0027 void *fWcsTitle{nullptr};
0028
0029 public:
0030
0031 enum {
0032 kTextNDC = BIT(14)
0033 };
0034
0035 TText() {}
0036 TText(Double_t x, Double_t y, const char *text);
0037 TText(Double_t x, Double_t y, const wchar_t *text);
0038 TText(const TText &text);
0039 ~TText() override;
0040
0041 TText &operator=(const TText &src);
0042
0043 void Copy(TObject &text) const override;
0044 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0045 virtual TText *DrawText(Double_t x, Double_t y, const char *text);
0046 virtual TText *DrawText(Double_t x, Double_t y, const wchar_t *text);
0047 virtual TText *DrawTextNDC(Double_t x, Double_t y, const char *text);
0048 virtual TText *DrawTextNDC(Double_t x, Double_t y, const wchar_t *text);
0049 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0050
0051 virtual void GetControlBox(Int_t x, Int_t y, Double_t theta,
0052 Int_t cBoxX[4], Int_t cBoxY[4]);
0053 Double_t GetX() const { return fX; }
0054 virtual void GetBoundingBox(UInt_t &w, UInt_t &h, Bool_t angle = kFALSE);
0055 virtual void GetTextAscentDescent(UInt_t &a, UInt_t &d, const char *text) const;
0056 virtual void GetTextAscentDescent(UInt_t &a, UInt_t &d, const wchar_t *text) const;
0057 virtual void GetTextExtent(UInt_t &w, UInt_t &h, const char *text) const;
0058 virtual void GetTextExtent(UInt_t &w, UInt_t &h, const wchar_t *text) const;
0059 virtual void GetTextAdvance(UInt_t &a, const char *text, const Bool_t kern=kTRUE) const;
0060 const void * GetWcsTitle(void) const;
0061 Double_t GetY() const { return fY; }
0062
0063 void ls(Option_t *option="") const override;
0064 void Paint(Option_t *option="") override;
0065 virtual void PaintControlBox(Int_t x, Int_t y, Double_t theta);
0066 virtual void PaintText(Double_t x, Double_t y, const char *text);
0067 virtual void PaintText(Double_t x, Double_t y, const wchar_t *text);
0068 virtual void PaintTextNDC(Double_t u, Double_t v, const char *text);
0069 virtual void PaintTextNDC(Double_t u, Double_t v, const wchar_t *text);
0070 void Print(Option_t *option="") const override;
0071 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0072 virtual void SetMbTitle(const wchar_t *title=L"");
0073 virtual void SetNDC(Bool_t isNDC=kTRUE);
0074 virtual void SetText(Double_t x, Double_t y, const char *text) {fX=x; fY=y; SetTitle(text);}
0075 virtual void SetText(Double_t x, Double_t y, const wchar_t *text) {fX=x; fY=y; SetMbTitle(text);}
0076 virtual void SetX(Double_t x) { fX = x; }
0077 virtual void SetY(Double_t y) { fY = y; }
0078
0079 Rectangle_t GetBBox() override;
0080 TPoint GetBBoxCenter() override;
0081 void SetBBoxCenter(const TPoint &p) override;
0082 void SetBBoxCenterX(const Int_t x) override;
0083 void SetBBoxCenterY(const Int_t y) override;
0084 void SetBBoxX1(const Int_t) override;
0085 void SetBBoxX2(const Int_t) override;
0086 void SetBBoxY1(const Int_t) override;
0087 void SetBBoxY2(const Int_t) override;
0088
0089 ClassDefOverride(TText,3)
0090 };
0091
0092 #endif