Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TPaletteAxis.h
Go to the documentation of this file.
1 // @(#)root/histpainter:$Id$
2 // Author: Rene Brun 15/11/2002
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TPaletteAxis
13 #define ROOT_TPaletteAxis
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TPaletteAxis //
19 // //
20 // class used to display a color palette axis for 2-d plots //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TPave.h"
25 #include "TGaxis.h"
26 
27 class TH1;
28 
29 class TPaletteAxis : public TPave {
30 
31 protected:
32  TGaxis fAxis; // palette axis
33  TH1 *fH; //! pointer to parent histogram
34  TString fName; // Pave name
35 
36 public:
37  // TPaletteAxis status bits
38  enum EStatusBits { kHasView = BIT(11) };
39 
40  TPaletteAxis();
41  TPaletteAxis(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2, TH1 *h);
42  TPaletteAxis(const TPaletteAxis &palette);
43  virtual ~TPaletteAxis();
44  void Copy(TObject &palette) const;
45  TPaletteAxis& operator=(const TPaletteAxis&);
46 
47  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
48  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
49  TGaxis *GetAxis() {return &fAxis;}
50  Int_t GetBinColor(Int_t i, Int_t j);
51  TH1* GetHistogram(){return fH;}
52  Option_t *GetName() const {return fName.Data();}
53  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
54  Int_t GetValueColor(Double_t zc);
55  virtual void Paint(Option_t *option="");
56  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
57  void SetHistogram(TH1* h) {fH = h;}
58  virtual void SetName(const char *name="") {fName = name;} // *MENU*
59  virtual void SetLabelColor(Int_t labelcolor) {fAxis.SetLabelColor(labelcolor);} // *MENU*
60  virtual void SetLabelFont(Int_t labelfont) {fAxis.SetLabelFont(labelfont);} // *MENU*
61  virtual void SetLabelOffset(Float_t labeloffset) {fAxis.SetLabelOffset(labeloffset);} // *MENU*
62  virtual void SetLabelSize(Float_t labelsize) {fAxis.SetLabelSize(labelsize);} // *MENU*
63  virtual void SetTitleOffset(Float_t titleoffset=1) {fAxis.SetTitleOffset(titleoffset);} // *MENU*
64  virtual void SetTitleSize(Float_t titlesize) {fAxis.SetTitleSize(titlesize);} // *MENU*
65  virtual void SetLineColor(Color_t linecolor) {fAxis.SetLineColor(linecolor);} // *MENU*
66  virtual void SetLineWidth(Width_t linewidth) {fAxis.SetLineWidth(linewidth);} // *MENU*
67  virtual void UnZoom(); // *MENU*
68 
69  ClassDef(TPaletteAxis,3) //class used to display a color palette axis for 2-d plots
70 };
71 
72 #endif
73