TAxis.h

Go to the documentation of this file.
00001 // @(#)root/hist:$Id: TAxis.h 36506 2010-11-04 20:58:59Z brun $
00002 // Author: Rene Brun   12/12/94
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TAxis
00013 #define ROOT_TAxis
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TAxis                                                                //
00019 //                                                                      //
00020 // Axis class.                                                          //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TNamed
00025 #include "TNamed.h"
00026 #endif
00027 #ifndef ROOT_TAttAxis
00028 #include "TAttAxis.h"
00029 #endif
00030 #ifndef ROOT_TArrayD
00031 #include "TArrayD.h"
00032 #endif
00033 
00034 class THashList;
00035 
00036 class TAxis : public TNamed, public TAttAxis {
00037 
00038 private:
00039    Int_t        fNbins;          //Number of bins
00040    Double_t     fXmin;           //low edge of first bin
00041    Double_t     fXmax;           //upper edge of last bin
00042    TArrayD      fXbins;          //Bin edges array in X
00043    Int_t        fFirst;          //first bin to display
00044    Int_t        fLast;           //last bin to display
00045    UShort_t     fBits2;          //second bit status word
00046    Bool_t       fTimeDisplay;    //on/off displaying time values instead of numerics
00047    TString      fTimeFormat;     //Date&time format, ex: 09/12/99 12:34:00
00048    TObject     *fParent;         //!Object owning this axis
00049    THashList   *fLabels;         //List of labels
00050 
00051    TAxis& operator=(const TAxis&); // Not implemented
00052 
00053 public:
00054    // TAxis status bits
00055    enum { kTickPlus      = BIT(9),
00056           kTickMinus     = BIT(10),
00057           kAxisRange     = BIT(11),
00058           kCenterTitle   = BIT(12),
00059           kCenterLabels  = BIT(14), //bit 13 is used by TObject
00060           kRotateTitle   = BIT(15),
00061           kPalette       = BIT(16),
00062           kNoExponent    = BIT(17),
00063           kLabelsHori    = BIT(18),
00064           kLabelsVert    = BIT(19),
00065           kLabelsDown    = BIT(20),
00066           kLabelsUp      = BIT(21),
00067           kIsInteger     = BIT(22),
00068           kMoreLogLabels = BIT(23),
00069           kDecimals      = BIT(11)}; //in fBits2
00070 
00071    TAxis();
00072    TAxis(Int_t nbins, Double_t xmin, Double_t xmax);
00073    TAxis(Int_t nbins, const Double_t *xbins);
00074    TAxis(const TAxis &axis);
00075    virtual ~TAxis();
00076    virtual void       CenterLabels(Bool_t center=kTRUE);  // *TOGGLE* *GETTER=GetCenterLabels
00077    virtual void       CenterTitle(Bool_t center=kTRUE);  // *TOGGLE* *GETTER=GetCenterTitle
00078    const char        *ChooseTimeFormat(Double_t axislength=0);
00079    virtual void       Copy(TObject &axis) const;
00080    virtual void       Delete(Option_t * /*option*/ ="") { }
00081    virtual Int_t      DistancetoPrimitive(Int_t px, Int_t py);
00082    virtual TObject   *DrawClone(Option_t * /*option*/ ="") const {return 0;}
00083    virtual void       ExecuteEvent(Int_t event, Int_t px, Int_t py);
00084    virtual Int_t      FindBin(Double_t x);
00085    virtual Int_t      FindBin(const char *label);
00086    virtual Int_t      FindFixBin(Double_t x) const;
00087    virtual Double_t   GetBinCenter(Int_t bin) const;
00088    virtual Double_t   GetBinCenterLog(Int_t bin) const;
00089    const char        *GetBinLabel(Int_t bin) const;
00090    virtual Double_t   GetBinLowEdge(Int_t bin) const;
00091    virtual Double_t   GetBinUpEdge(Int_t bin) const;
00092    virtual Double_t   GetBinWidth(Int_t bin) const;
00093    virtual void       GetCenter(Double_t *center) const;
00094            Bool_t     GetCenterLabels() const;
00095            Bool_t     GetCenterTitle() const;
00096    THashList         *GetLabels() {return fLabels;}
00097    virtual void       GetLowEdge(Double_t *edge) const;
00098            Bool_t     GetMoreLogLabels() const;
00099            Int_t      GetNbins() const { return fNbins; }
00100            Bool_t     GetNoExponent() const;
00101            Bool_t     GetDecimals() const;
00102    virtual TObject   *GetParent() const {return fParent;}
00103            Bool_t     GetRotateTitle() const;
00104    virtual const char *GetTicks() const;
00105    virtual Bool_t     GetTimeDisplay() const {return fTimeDisplay;}
00106    virtual const char *GetTimeFormat() const {return fTimeFormat.Data();}
00107    virtual const char *GetTimeFormatOnly() const;
00108    const char        *GetTitle() const {return fTitle.Data();}
00109    const TArrayD     *GetXbins() const {return &fXbins;}
00110            Int_t      GetFirst() const;
00111            Int_t      GetLast() const;
00112            Double_t   GetXmin() const {return fXmin;}
00113            Double_t   GetXmax() const {return fXmax;}
00114    virtual void       ImportAttributes(const TAxis *axis);
00115    Bool_t             IsVariableBinSize() const {
00116                          // true if axis has variable bin sizes, false otherwise
00117                          return (fXbins.GetSize() != 0);
00118                       }
00119    virtual void       LabelsOption(Option_t *option="h");  // *MENU*
00120    virtual void       RotateTitle(Bool_t rotate=kTRUE); // *TOGGLE* *GETTER=GetRotateTitle
00121    virtual void       SaveAttributes(ostream &out, const char *name, const char *subname);
00122    virtual void       Set(Int_t nbins, Double_t xmin, Double_t xmax);
00123    virtual void       Set(Int_t nbins, const Float_t *xbins);
00124    virtual void       Set(Int_t nbins, const Double_t *xbins);
00125    virtual void       SetBinLabel(Int_t bin, const char *label);
00126    virtual void       SetDefaults();
00127    virtual void       SetDrawOption(Option_t * /*option*/ ="") { }
00128    virtual void       SetLimits(Double_t xmin, Double_t xmax);
00129    virtual void       SetMoreLogLabels(Bool_t more=kTRUE);  // *TOGGLE* *GETTER=GetMoreLogLabels
00130    virtual void       SetNoExponent(Bool_t noExponent=kTRUE);  // *TOGGLE* *GETTER=GetNoExponent
00131    virtual void       SetDecimals(Bool_t dot=kTRUE);  // *TOGGLE* *GETTER=GetDecimals
00132    virtual void       SetParent(TObject *obj) {fParent = obj;}
00133    virtual void       SetRange(Int_t first=0, Int_t last=0);  // *MENU*
00134    virtual void       SetRangeUser(Double_t ufirst, Double_t ulast);  // *MENU*
00135    virtual void       SetTicks(Option_t *option="+"); // *MENU*
00136    virtual void       SetTimeDisplay(Int_t value) {fTimeDisplay = (value != 0);} // *TOGGLE*
00137    virtual void       SetTimeFormat(const char *format="");  // *MENU*
00138    virtual void       SetTimeOffset(Double_t toffset, Option_t *option="local");
00139    virtual void       UnZoom();  // *MENU*
00140    virtual void       ZoomOut(Double_t factor=0, Double_t offset=0);  // *MENU*
00141 
00142    ClassDef(TAxis,9)  //Axis class
00143 };
00144 
00145 #endif
00146 

Generated on Tue Jul 5 14:22:47 2011 for ROOT_528-00b_version by  doxygen 1.5.1