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
0002
0003
0004
0005
0006
0007
0008
0009
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;
0029 Double_t fWmax;
0030 Float_t fGridLength;
0031 Float_t fTickSize;
0032 Float_t fLabelOffset;
0033 Float_t fLabelSize;
0034 Float_t fTitleOffset;
0035 Float_t fTitleSize;
0036 Int_t fNdiv;
0037 Int_t fLabelColor;
0038 Int_t fLabelFont;
0039 Int_t fNModLabs;
0040 TString fChopt;
0041 TString fName;
0042 TString fTitle;
0043 TString fTimeFormat;
0044 TString fFunctionName;
0045 TF1 *fFunction;
0046 TAxis *fAxis;
0047 TList *fModLabs;
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;}
0105 void SetLabelFont(Int_t labelfont) {fLabelFont = labelfont;}
0106 void SetLabelOffset(Float_t labeloffset) {fLabelOffset = labeloffset;}
0107 void SetLabelSize(Float_t labelsize) {fLabelSize = labelsize;}
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 = "");
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 = "");
0116 static void SetMaxDigits(Int_t maxd=5);
0117 virtual void SetName(const char *name);
0118 virtual void SetNdivisions(Int_t ndiv) {fNdiv = ndiv;}
0119 virtual void SetMoreLogLabels(Bool_t more=kTRUE);
0120 virtual void SetNoExponent(Bool_t noExponent=kTRUE);
0121 virtual void SetDecimals(Bool_t dot=kTRUE);
0122 void SetTickSize(Float_t ticksize) {fTickSize = ticksize;}
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="");
0128 void SetTitleOffset(Float_t titleoffset=1) {fTitleOffset = titleoffset;}
0129 void SetTitleSize(Float_t titlesize) {fTitleSize = titlesize;}
0130 void SetTitleFont(Int_t titlefont) {SetTextFont(titlefont);}
0131 void SetTitleColor(Int_t titlecolor) {SetTextColor(titlecolor);}
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)
0137 };
0138
0139 #endif