Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TPaletteAxis.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/histpainter:$Id$
0002 // Author: Rene Brun   15/11/2002
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_TPaletteAxis
0013 #define ROOT_TPaletteAxis
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TPaletteAxis                                                         //
0019 //                                                                      //
0020 // class used to display a color palette axis for 2-d plots             //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TPave.h"
0025 #include "TGaxis.h"
0026 #include "TH1.h"
0027 
0028 class TPaletteAxis : public TPave {
0029 
0030 protected:
0031    TGaxis       fAxis;          ///<  Palette axis
0032    TH1         *fH;             ///<! Pointer to parent histogram
0033    Int_t        fLog;           ///< Log option: 0 use Logz, 1 is linear, 2 is log
0034 
0035 public:
0036    // TPaletteAxis status bits
0037    enum EStatusBits { kHasView = BIT(11) };
0038 
0039    TPaletteAxis();
0040    TPaletteAxis(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2, TH1 *h);
0041    TPaletteAxis(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2, Double_t min, Double_t max);
0042    TPaletteAxis(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2, TAxis *ax);
0043    TPaletteAxis(const TPaletteAxis &palette);
0044    ~TPaletteAxis() override;
0045    void Copy(TObject &palette) const override;
0046    TPaletteAxis& operator=(const TPaletteAxis&);
0047 
0048    Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0049    void  ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0050    TGaxis       *GetAxis() {return &fAxis;}
0051    Int_t         GetBinColor(Int_t i, Int_t j);
0052    TH1*          GetHistogram(){return fH;}
0053    char *GetObjectInfo(Int_t px, Int_t py) const override;
0054    Int_t         GetValueColor(Double_t zc);
0055    void  Paint(Option_t *option="") override;
0056    void  SavePrimitive(std::ostream &out, Option_t *option = "") override;
0057    Int_t         GetLog() const;
0058    void          SetLog(Int_t log) {fLog = log;}
0059    void          SetHistogram(TH1* h) {fH = h;}
0060    virtual void  SetNdivisions(Int_t ndiv=10)                 {if (fH) fH->GetZaxis()->SetNdivisions(ndiv);       else fAxis.SetNdivisions(ndiv);}     // *MENU*
0061    virtual void  SetLabelColor(Int_t color=1)                 {if (fH) fH->GetZaxis()->SetLabelColor(color);      else fAxis.SetLabelColor(color);}    // *MENU*
0062    virtual void  SetLabelFont(Int_t font=42)                  {if (fH) fH->GetZaxis()->SetLabelFont(font);        else fAxis.SetLabelFont(font);}      // *MENU*
0063    virtual void  SetLabelOffset(Float_t offset=0.005)         {if (fH) fH->GetZaxis()->SetLabelOffset(offset);    else fAxis.SetLabelOffset(offset);}  // *MENU*
0064    virtual void  SetLabelSize(Float_t size=0.035)             {if (fH) fH->GetZaxis()->SetLabelSize(size);        else fAxis.SetLabelSize(size);}      // *MENU*
0065    virtual void  SetMaxDigits(Float_t maxdigits=5)            {if (fH) fH->GetZaxis()->SetMaxDigits(maxdigits);   else fAxis.SetMaxDigits(maxdigits);} // *MENU*
0066    virtual void  SetTickLength(Float_t length=0.03)           {if (fH) fH->GetZaxis()->SetTickLength(length);     else fAxis.SetTickLength(length);}   // *MENU*
0067    virtual void  SetTitleOffset(Float_t offset=1)             {if (fH) fH->GetZaxis()->SetTitleOffset(offset);    else fAxis.SetTitleOffset(offset);}  // *MENU*
0068    virtual void  SetTitleSize(Float_t size=0.035)             {if (fH) fH->GetZaxis()->SetTitleSize(size);        else fAxis.SetTitleSize(size);}      // *MENU*
0069    virtual void  SetTitleColor(Int_t color=1)                 {if (fH) fH->GetZaxis()->SetTitleColor(color);      else fAxis.SetTitleColor(color);}    // *MENU*
0070    virtual void  SetTitleFont(Int_t font=42)                  {if (fH) fH->GetZaxis()->SetTitleFont(font);        else fAxis.SetTitleFont(font);}      // *MENU*
0071    virtual void  SetTitle(const char *title="")               {if (fH) fH->GetZaxis()->SetTitle(title);           else fAxis.SetTitle(title);}         // *MENU*
0072    virtual void  SetAxisColor(Int_t color=1, Float_t alpha=1) {if (fH) fH->GetZaxis()->SetAxisColor(color,alpha);} // *MENU*
0073    void  SetLineWidth(Width_t width) override {fAxis.SetLineWidth(width);} // *MENU*
0074 
0075    virtual void  UnZoom();  // *MENU*
0076 
0077    ClassDefOverride(TPaletteAxis, 5)  //class used to display a color palette axis for 2-d plots
0078 };
0079 
0080 #endif
0081