Back to home page

EIC code displayed by LXR

 
 

    


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 // @(#)root/graf:$Id$
0002 // Author: Nicolas Brun   12/12/94
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
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};                 ///< X position of text (left,center,etc..)
0026    Double_t     fY{0};                 ///< Y position of text (left,center,etc..)
0027    void         *fWcsTitle{nullptr};   ///<!Used by TMathText
0028 
0029 public:
0030    // TText status bits
0031    enum {
0032       kTextNDC = BIT(14)  ///< The text position is in the NDC space
0033    };
0034 
0035    TText() {} // NOLINT: not allowed to use = default because of TObject::kIsOnHeap detection, see ROOT-10300
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);} // *MENU* *ARGS={x=>fX,y=>fY,text=>fTitle}
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; } // *MENU*
0077    virtual void     SetY(Double_t y) { fY = y; } // *MENU*
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; //Not Implemented
0085    void             SetBBoxX2(const Int_t) override; //Not Implemented
0086    void             SetBBoxY1(const Int_t) override; //Not Implemented
0087    void             SetBBoxY2(const Int_t) override; //Not Implemented
0088 
0089    ClassDefOverride(TText,3)  //Text
0090 };
0091 
0092 #endif