Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGaxis.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: Rene Brun, Olivier Couet   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_TGaxis
0013 #define ROOT_TGaxis
0014 
0015 #include "TLine.h"
0016 #include "TAttText.h"
0017 #include "TString.h"
0018 
0019 class TF1;
0020 class TAxis;
0021 class TLatex;
0022 class TAxisModLab;
0023 
0024 class TGaxis : public TLine, public TAttText {
0025 
0026 protected:
0027 
0028    Double_t   fWmin;                ///< Lowest value on the axis
0029    Double_t   fWmax;                ///< Highest value on the axis
0030    Float_t    fGridLength;          ///< Length of the grid in NDC
0031    Float_t    fTickSize;            ///< Size of primary tick mark in NDC
0032    Float_t    fLabelOffset;         ///< Offset of label wrt axis
0033    Float_t    fLabelSize;           ///< Size of labels in NDC
0034    Float_t    fTitleOffset;         ///< Offset of title wrt axis
0035    Float_t    fTitleSize;           ///< Size of title in NDC
0036    Int_t      fNdiv;                ///< Number of divisions
0037    Int_t      fLabelColor;          ///< Color for labels
0038    Int_t      fLabelFont;           ///< Font for labels
0039    Int_t      fNModLabs;            ///< Number of modified labels
0040    TString    fChopt;               ///< Axis options
0041    TString    fName;                ///< Axis name
0042    TString    fTitle;               ///< Axis title
0043    TString    fTimeFormat;          ///< Time format, ex: 09/12/99 12:34:00
0044    TString    fFunctionName;        ///< Name of mapping function pointed by fFunction
0045    TF1       *fFunction;            ///<! Pointer to function computing axis values
0046    TAxis     *fAxis;                ///<! Pointer to original TAxis axis (if any)
0047    TList     *fModLabs;             ///<  List of modified labels.
0048 
0049    TGaxis(const TGaxis&);
0050    TGaxis& operator=(const TGaxis&);
0051 
0052    Bool_t IsOwnedModLabs() const;
0053    void CleanupModLabs();
0054 
0055    TAxisModLab *FindModLab(Int_t indx, Int_t numlabels = 0, Double_t v = 0., Double_t eps = -1.) const;
0056 
0057 public:
0058 
0059    TGaxis();
0060    TGaxis(Double_t xmin,Double_t ymin,Double_t xmax,Double_t ymax,
0061           Double_t wmin,Double_t wmax,Int_t ndiv=510, Option_t *chopt="",
0062           Double_t gridlength = 0);
0063    TGaxis(Double_t xmin,Double_t ymin,Double_t xmax,Double_t ymax,
0064           const char *funcname, Int_t ndiv=510, Option_t *chopt="",
0065           Double_t gridlength = 0);
0066    ~TGaxis() override;
0067 
0068    virtual void        AdjustBinSize(Double_t A1,  Double_t A2,  Int_t nold
0069                                     ,Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BinWidth);
0070    virtual void        CenterLabels(Bool_t center=kTRUE);
0071    virtual void        CenterTitle(Bool_t center=kTRUE);
0072    void                ChangeLabelAttributes(Int_t i, Int_t nlabels, TLatex* t, char* c, Double_t value = 0., Double_t eps = -1.);
0073    virtual TGaxis     *DrawAxis(Double_t xmin,Double_t ymin,Double_t xmax,Double_t ymax,
0074                                 Double_t wmin,Double_t wmax,Int_t ndiv=510, Option_t *chopt="",
0075                                 Double_t gridlength = 0);
0076    Float_t             GetGridLength() const   {return fGridLength;}
0077    TF1                *GetFunction() const     {return fFunction;}
0078    Int_t               GetLabelColor() const   {return fLabelColor;}
0079    Int_t               GetLabelFont() const    {return fLabelFont;}
0080    Float_t             GetLabelOffset() const  {return fLabelOffset;}
0081    Float_t             GetLabelSize() const    {return fLabelSize;}
0082    Float_t             GetTitleOffset() const  {return fTitleOffset;}
0083    Float_t             GetTitleSize() const    {return fTitleSize;}
0084    const char         *GetName() const  override {return fName.Data();}
0085    const char         *GetOption() const override {return fChopt.Data();}
0086    const char         *GetTitle() const override {return fTitle.Data();}
0087    static Int_t        GetMaxDigits();
0088    Int_t               GetNdiv() const         {return fNdiv;}
0089    Double_t            GetWmin() const         {return fWmin;}
0090    Double_t            GetWmax()  const        {return fWmax;}
0091    Float_t             GetTickSize() const     {return fTickSize;}
0092    virtual void        ImportAxisAttributes(TAxis *axis);
0093    void                LabelsLimits(const char *label, Int_t &first, Int_t &last);
0094    void                Paint(Option_t *chopt="") override;
0095    virtual void        PaintAxis(Double_t xmin,Double_t ymin,Double_t xmax,Double_t ymax,
0096                                  Double_t &wmin,Double_t &wmax,Int_t &ndiv, Option_t *chopt="",
0097                                  Double_t gridlength = 0, Bool_t drawGridOnly = kFALSE);
0098    virtual void        Rotate(Double_t X,  Double_t Y,  Double_t CFI, Double_t SFI
0099                              ,Double_t XT, Double_t YT, Double_t &U,   Double_t &V);
0100    void                ResetLabelAttributes(TLatex* t);
0101    void                SavePrimitive(std::ostream &out, Option_t *option = "") override;
0102    void                SetFunction(const char *funcname="");
0103    void                SetOption(Option_t *option="");
0104    void                SetLabelColor(Int_t labelcolor) {fLabelColor = labelcolor;} // *MENU*
0105    void                SetLabelFont(Int_t labelfont) {fLabelFont = labelfont;} // *MENU*
0106    void                SetLabelOffset(Float_t labeloffset) {fLabelOffset = labeloffset;} // *MENU*
0107    void                SetLabelSize(Float_t labelsize) {fLabelSize = labelsize;} // *MENU*
0108    void                ChangeLabel(Int_t labNum=0, Double_t labAngle = -1.,
0109                                    Double_t labSize = -1., Int_t labAlign = -1,
0110                                    Int_t labColor = -1 , Int_t labFont = -1,
0111                                    const TString &labText = ""); // *MENU*
0112    void                ChangeLabelByValue(Double_t labValue, Double_t labAngle = -1.,
0113                                         Double_t labSize = -1., Int_t labAlign = -1,
0114                                         Int_t labColor = -1 , Int_t labFont = -1,
0115                                         const TString &labText = ""); // *MENU*
0116    static void         SetMaxDigits(Int_t maxd=5);
0117    virtual void        SetName(const char *name); // *MENU*
0118    virtual void        SetNdivisions(Int_t ndiv) {fNdiv = ndiv;} // *MENU*
0119    virtual void        SetMoreLogLabels(Bool_t more=kTRUE);  // *MENU*
0120    virtual void        SetNoExponent(Bool_t noExponent=kTRUE);  // *MENU*
0121    virtual void        SetDecimals(Bool_t dot=kTRUE);  // *MENU*
0122    void                SetTickSize(Float_t ticksize) {fTickSize = ticksize;} // *MENU*
0123    void                SetTickLength(Float_t ticklength) {SetTickSize(ticklength);}
0124    void                SetGridLength(Float_t gridlength) {fGridLength = gridlength;}
0125    void                SetTimeFormat(const char *tformat);
0126    void                SetTimeOffset(Double_t toffset, Option_t *option="local");
0127    virtual void        SetTitle(const char *title=""); // *MENU*
0128    void                SetTitleOffset(Float_t titleoffset=1) {fTitleOffset = titleoffset;} // *MENU*
0129    void                SetTitleSize(Float_t titlesize) {fTitleSize = titlesize;} // *MENU*
0130    void                SetTitleFont(Int_t titlefont) {SetTextFont(titlefont);} // *MENU*
0131    void                SetTitleColor(Int_t titlecolor) {SetTextColor(titlecolor);} // *MENU*
0132    void                SetWmin(Double_t wmin) {fWmin = wmin;}
0133    void                SetWmax(Double_t wmax) {fWmax = wmax;}
0134    static void         SetExponentOffset(Float_t xoff=0., Float_t yoff=0., Option_t *axis="xy");
0135 
0136    ClassDefOverride(TGaxis,6)  //Graphics axis
0137 };
0138 
0139 #endif