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 
0034 public:
0035    // TPaletteAxis status bits
0036    enum EStatusBits { kHasView = BIT(11) };
0037 
0038    TPaletteAxis();
0039    TPaletteAxis(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2, TH1 *h);
0040    TPaletteAxis(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2, Double_t min, Double_t max);
0041    TPaletteAxis(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2, TAxis *ax);
0042    TPaletteAxis(const TPaletteAxis &palette);
0043    ~TPaletteAxis() override;
0044    void Copy(TObject &palette) const override;
0045    TPaletteAxis& operator=(const TPaletteAxis&);
0046 
0047    Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0048    void  ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0049    TGaxis       *GetAxis() {return &fAxis;}
0050    Int_t         GetBinColor(Int_t i, Int_t j);
0051    TH1*          GetHistogram(){return fH;}
0052    char *GetObjectInfo(Int_t px, Int_t py) const override;
0053    Int_t         GetValueColor(Double_t zc);
0054    void  Paint(Option_t *option="") override;
0055    void  SavePrimitive(std::ostream &out, Option_t *option = "") override;
0056    void          SetHistogram(TH1* h) {fH = h;}
0057    virtual void  SetNdivisions(Int_t ndiv=10)                 {if (fH) fH->GetZaxis()->SetNdivisions(ndiv);       else fAxis.SetNdivisions(ndiv);}     // *MENU*
0058    virtual void  SetLabelColor(Int_t color=1)                 {if (fH) fH->GetZaxis()->SetLabelColor(color);      else fAxis.SetLabelColor(color);}    // *MENU*
0059    virtual void  SetLabelFont(Int_t font=42)                  {if (fH) fH->GetZaxis()->SetLabelFont(font);        else fAxis.SetLabelFont(font);}      // *MENU*
0060    virtual void  SetLabelOffset(Float_t offset=0.005)         {if (fH) fH->GetZaxis()->SetLabelOffset(offset);    else fAxis.SetLabelOffset(offset);}  // *MENU*
0061    virtual void  SetLabelSize(Float_t size=0.035)             {if (fH) fH->GetZaxis()->SetLabelSize(size);        else fAxis.SetLabelSize(size);}      // *MENU*
0062    virtual void  SetMaxDigits(Float_t maxdigits=5)            {if (fH) fH->GetZaxis()->SetMaxDigits(maxdigits);   else fAxis.SetMaxDigits(maxdigits);} // *MENU*
0063    virtual void  SetTickLength(Float_t length=0.03)           {if (fH) fH->GetZaxis()->SetTickLength(length);     else fAxis.SetTickLength(length);}   // *MENU*
0064    virtual void  SetTitleOffset(Float_t offset=1)             {if (fH) fH->GetZaxis()->SetTitleOffset(offset);    else fAxis.SetTitleOffset(offset);}  // *MENU*
0065    virtual void  SetTitleSize(Float_t size=0.035)             {if (fH) fH->GetZaxis()->SetTitleSize(size);        else fAxis.SetTitleSize(size);}      // *MENU*
0066    virtual void  SetTitleColor(Int_t color=1)                 {if (fH) fH->GetZaxis()->SetTitleColor(color);      else fAxis.SetTitleColor(color);}    // *MENU*
0067    virtual void  SetTitleFont(Int_t font=42)                  {if (fH) fH->GetZaxis()->SetTitleFont(font);        else fAxis.SetTitleFont(font);}      // *MENU*
0068    virtual void  SetTitle(const char *title="")               {if (fH) fH->GetZaxis()->SetTitle(title);           else fAxis.SetTitle(title);}         // *MENU*
0069    virtual void  SetAxisColor(Int_t color=1, Float_t alpha=1) {if (fH) fH->GetZaxis()->SetAxisColor(color,alpha);} // *MENU*
0070    void  SetLineWidth(Width_t width) override {fAxis.SetLineWidth(width);} // *MENU*
0071 
0072    virtual void  UnZoom();  // *MENU*
0073 
0074    ClassDefOverride(TPaletteAxis,4)  //class used to display a color palette axis for 2-d plots
0075 };
0076 
0077 #endif
0078