00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGaxis
00013 #define ROOT_TGaxis
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef ROOT_TNamed
00027 #include "TNamed.h"
00028 #endif
00029 #ifndef ROOT_TLine
00030 #include "TLine.h"
00031 #endif
00032 #ifndef ROOT_TAttText
00033 #include "TAttText.h"
00034 #endif
00035
00036 class TF1;
00037 class TAxis;
00038
00039 class TGaxis : public TLine, public TAttText {
00040
00041 protected:
00042 Double_t fWmin;
00043 Double_t fWmax;
00044 Float_t fGridLength;
00045 Float_t fTickSize;
00046 Float_t fLabelOffset;
00047 Float_t fLabelSize;
00048 Float_t fTitleOffset;
00049 Float_t fTitleSize;
00050 Int_t fNdiv;
00051 Int_t fLabelColor;
00052 Int_t fLabelFont;
00053 TString fChopt;
00054 TString fName;
00055 TString fTitle;
00056 TString fTimeFormat;
00057 TString fFunctionName;
00058 TF1 *fFunction;
00059 TAxis *fAxis;
00060
00061 static Int_t fgMaxDigits;
00062
00063 TGaxis(const TGaxis&);
00064 TGaxis& operator=(const TGaxis&);
00065
00066 public:
00067
00068 TGaxis();
00069 TGaxis(Double_t xmin,Double_t ymin,Double_t xmax,Double_t ymax,
00070 Double_t wmin,Double_t wmax,Int_t ndiv=510, Option_t *chopt="",
00071 Double_t gridlength = 0);
00072 TGaxis(Double_t xmin,Double_t ymin,Double_t xmax,Double_t ymax,
00073 const char *funcname, Int_t ndiv=510, Option_t *chopt="",
00074 Double_t gridlength = 0);
00075 virtual ~TGaxis();
00076
00077 virtual void AdjustBinSize(Double_t A1, Double_t A2, Int_t nold
00078 ,Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BinWidth);
00079 virtual void CenterLabels(Bool_t center=kTRUE);
00080 virtual void CenterTitle(Bool_t center=kTRUE);
00081 virtual void DrawAxis(Double_t xmin,Double_t ymin,Double_t xmax,Double_t ymax,
00082 Double_t wmin,Double_t wmax,Int_t ndiv=510, Option_t *chopt="",
00083 Double_t gridlength = 0);
00084 Float_t GetGridLength() const {return fGridLength;}
00085 TF1 *GetFunction() const {return fFunction;}
00086 Int_t GetLabelColor() const {return fLabelColor;}
00087 Int_t GetLabelFont() const {return fLabelFont;}
00088 Float_t GetLabelOffset() const {return fLabelOffset;}
00089 Float_t GetLabelSize() const {return fLabelSize;}
00090 Float_t GetTitleOffset() const {return fTitleOffset;}
00091 Float_t GetTitleSize() const {return fTitleSize;}
00092 virtual const char *GetName() const {return fName.Data();}
00093 virtual const char *GetOption() const {return fChopt.Data();}
00094 virtual const char *GetTitle() const {return fTitle.Data();}
00095 static Int_t GetMaxDigits();
00096 Int_t GetNdiv() const {return fNdiv;}
00097 Double_t GetWmin() const {return fWmin;}
00098 Double_t GetWmax() const {return fWmax;}
00099 Float_t GetTickSize() const {return fTickSize;}
00100 virtual void ImportAxisAttributes(TAxis *axis);
00101 void LabelsLimits(const char *label, Int_t &first, Int_t &last);
00102 virtual void Paint(Option_t *chopt="");
00103 virtual void PaintAxis(Double_t xmin,Double_t ymin,Double_t xmax,Double_t ymax,
00104 Double_t &wmin,Double_t &wmax,Int_t &ndiv, Option_t *chopt="",
00105 Double_t gridlength = 0, Bool_t drawGridOnly = kFALSE);
00106 virtual void Rotate(Double_t X, Double_t Y, Double_t CFI, Double_t SFI
00107 ,Double_t XT, Double_t YT, Double_t &U, Double_t &V);
00108 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00109 void SetFunction(const char *funcname="");
00110 void SetOption(Option_t *option="");
00111 void SetLabelColor(Int_t labelcolor) {fLabelColor = labelcolor;}
00112 void SetLabelFont(Int_t labelfont) {fLabelFont = labelfont;}
00113 void SetLabelOffset(Float_t labeloffset) {fLabelOffset = labeloffset;}
00114 void SetLabelSize(Float_t labelsize) {fLabelSize = labelsize;}
00115 static void SetMaxDigits(Int_t maxd=5);
00116 virtual void SetName(const char *name);
00117 virtual void SetNdivisions(Int_t ndiv) {fNdiv = ndiv;}
00118 virtual void SetMoreLogLabels(Bool_t more=kTRUE);
00119 virtual void SetNoExponent(Bool_t noExponent=kTRUE);
00120 virtual void SetDecimals(Bool_t dot=kTRUE);
00121 void SetTickSize(Float_t ticksize) {fTickSize = ticksize;}
00122 void SetGridLength(Float_t gridlength) {fGridLength = gridlength;}
00123 void SetTimeFormat(const char *tformat);
00124 void SetTimeOffset(Double_t toffset, Option_t *option="local");
00125 virtual void SetTitle(const char *title="");
00126 void SetTitleOffset(Float_t titleoffset=1) {fTitleOffset = titleoffset;}
00127 void SetTitleSize(Float_t titlesize) {fTitleSize = titlesize;}
00128 void SetTitleFont(Int_t titlefont) {SetTextFont(titlefont);}
00129 void SetTitleColor(Int_t titlecolor) {SetTextColor(titlecolor);}
00130 void SetWmin(Double_t wmin) {fWmin = wmin;}
00131 void SetWmax(Double_t wmax) {fWmax = wmax;}
00132
00133 ClassDef(TGaxis,5)
00134 };
00135
00136 #endif
00137
00138