Logo ROOT   6.08/07
Reference Guide
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 #ifndef ROOT_TPave
25 #include "TPave.h"
26 #endif
27 #ifndef ROOT_TGaxis
28 #include "TGaxis.h"
29 #endif
30 
31 class TH1;
32 
33 class TPaletteAxis : public TPave {
34 
35 protected:
36  TGaxis fAxis; // palette axis
37  TH1 *fH; //! pointer to parent histogram
38  TString fName; // Pave name
39 
40 public:
41  // TPaletteAxis status bits
42  enum { kHasView = BIT(11)};
43 
44  TPaletteAxis();
46  TPaletteAxis(const TPaletteAxis &palette);
47  virtual ~TPaletteAxis();
48  void Copy(TObject &palette) const;
50 
51  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
52  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
53  TGaxis *GetAxis() {return &fAxis;}
55  TH1* GetHistogram(){return fH;}
56  Option_t *GetName() const {return fName.Data();}
57  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
59  virtual void Paint(Option_t *option="");
60  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
61  void SetHistogram(TH1* h) {fH = h;}
62  virtual void SetName(const char *name="") {fName = name;} // *MENU*
63  virtual void SetLabelColor(Int_t labelcolor) {fAxis.SetLabelColor(labelcolor);} // *MENU*
64  virtual void SetLabelFont(Int_t labelfont) {fAxis.SetLabelFont(labelfont);} // *MENU*
65  virtual void SetLabelOffset(Float_t labeloffset) {fAxis.SetLabelOffset(labeloffset);} // *MENU*
66  virtual void SetLabelSize(Float_t labelsize) {fAxis.SetLabelSize(labelsize);} // *MENU*
67  virtual void SetTitleOffset(Float_t titleoffset=1) {fAxis.SetTitleOffset(titleoffset);} // *MENU*
68  virtual void SetTitleSize(Float_t titlesize) {fAxis.SetTitleSize(titlesize);} // *MENU*
69  virtual void SetLineColor(Color_t linecolor) {fAxis.SetLineColor(linecolor);} // *MENU*
70  virtual void SetLineWidth(Width_t linewidth) {fAxis.SetLineWidth(linewidth);} // *MENU*
71  virtual void UnZoom(); // *MENU*
72 
73  ClassDef(TPaletteAxis,3) //class used to display a color palette axis for 2-d plots
74 };
75 
76 #endif
77 
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition: TAttLine.h:49
Int_t GetBinColor(Int_t i, Int_t j)
Returns the color index of the bin (i,j).
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
void Copy(TObject &palette) const
Copy a palette to a palette.
Option_t * GetName() const
Returns name of object.
Definition: TPaletteAxis.h:56
#define BIT(n)
Definition: Rtypes.h:120
TH1 * h
Definition: legend2.C:5
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
A TBox with a bordersize and a shadow option.
Definition: TPave.h:23
void SetTitleSize(Float_t titlesize)
Definition: TGaxis.h:132
static const double x2[5]
TH1 * GetHistogram()
Definition: TPaletteAxis.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual ~TPaletteAxis()
Palette destructor.
virtual void SetLabelColor(Int_t labelcolor)
Definition: TPaletteAxis.h:63
void SetLabelSize(Float_t labelsize)
Definition: TGaxis.h:114
short Color_t
Definition: RtypesCore.h:79
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Check if mouse on the axis region.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Check if mouse on the axis region.
TGaxis fAxis
Definition: TPaletteAxis.h:36
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition: TAttLine.h:46
virtual void SetLineColor(Color_t linecolor)
Set the line color.
Definition: TPaletteAxis.h:69
virtual void UnZoom()
Unzoom the palette.
The axis painter class.
Definition: TGaxis.h:30
virtual void SetTitleOffset(Float_t titleoffset=1)
Definition: TPaletteAxis.h:67
short Width_t
Definition: RtypesCore.h:78
virtual void SetName(const char *name="")
Definition: TPaletteAxis.h:62
TPaletteAxis()
Palette default constructor.
void SetLabelOffset(Float_t labeloffset)
Definition: TGaxis.h:113
static const double x1[5]
TPaletteAxis & operator=(const TPaletteAxis &)
Assignment operator.
double Double_t
Definition: RtypesCore.h:55
virtual void SetLineWidth(Width_t linewidth)
Set the line width.
Definition: TPaletteAxis.h:70
virtual void SetLabelFont(Int_t labelfont)
Definition: TPaletteAxis.h:64
void SetLabelFont(Int_t labelfont)
Definition: TGaxis.h:112
The TH1 histogram class.
Definition: TH1.h:80
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual void SetTitleSize(Float_t titlesize)
Definition: TPaletteAxis.h:68
TString fName
pointer to parent histogram
Definition: TPaletteAxis.h:38
Mother of all ROOT objects.
Definition: TObject.h:37
Int_t GetValueColor(Double_t zc)
Returns the color index of the given z value.
void SetLabelColor(Int_t labelcolor)
Definition: TGaxis.h:111
virtual void Paint(Option_t *option="")
Paint the palette.
void SetTitleOffset(Float_t titleoffset=1)
Definition: TGaxis.h:131
The palette painting class.
Definition: TPaletteAxis.h:33
void SetHistogram(TH1 *h)
Definition: TPaletteAxis.h:61
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Displays the z value corresponding to cursor position py.
char name[80]
Definition: TGX11.cxx:109
virtual void SetLabelOffset(Float_t labeloffset)
Definition: TPaletteAxis.h:65
virtual void SetLabelSize(Float_t labelsize)
Definition: TPaletteAxis.h:66
const char * Data() const
Definition: TString.h:349
TGaxis * GetAxis()
Definition: TPaletteAxis.h:53