Logo ROOT   6.14/05
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 #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();
42  TPaletteAxis(const TPaletteAxis &palette);
43  virtual ~TPaletteAxis();
44  void Copy(TObject &palette) const;
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;}
51  TH1* GetHistogram(){return fH;}
52  Option_t *GetName() const {return fName.Data();}
53  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
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 
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition: TAttLine.h:43
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:52
#define BIT(n)
Definition: Rtypes.h:78
Basic string class.
Definition: TString.h:131
int Int_t
Definition: RtypesCore.h:41
A TBox with a bordersize and a shadow option.
Definition: TPave.h:19
void SetTitleSize(Float_t titlesize)
Definition: TGaxis.h:126
static const double x2[5]
TH1 * GetHistogram()
Definition: TPaletteAxis.h:51
#define ClassDef(name, id)
Definition: Rtypes.h:320
virtual ~TPaletteAxis()
Palette destructor.
virtual void SetLabelColor(Int_t labelcolor)
Definition: TPaletteAxis.h:59
void SetLabelSize(Float_t labelsize)
Definition: TGaxis.h:108
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:32
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition: TAttLine.h:40
virtual void SetLineColor(Color_t linecolor)
Set the line color.
Definition: TPaletteAxis.h:65
virtual void UnZoom()
Unzoom the palette.
The axis painter class.
Definition: TGaxis.h:24
virtual void SetTitleOffset(Float_t titleoffset=1)
Definition: TPaletteAxis.h:63
#define h(i)
Definition: RSha256.hxx:106
short Width_t
Definition: RtypesCore.h:78
virtual void SetName(const char *name="")
Definition: TPaletteAxis.h:58
TPaletteAxis()
Palette default constructor.
void SetLabelOffset(Float_t labeloffset)
Definition: TGaxis.h:107
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:66
EStatusBits
Definition: TObject.h:57
virtual void SetLabelFont(Int_t labelfont)
Definition: TPaletteAxis.h:60
void SetLabelFont(Int_t labelfont)
Definition: TGaxis.h:106
The TH1 histogram class.
Definition: TH1.h:56
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:64
TString fName
pointer to parent histogram
Definition: TPaletteAxis.h:34
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:105
virtual void Paint(Option_t *option="")
Paint the palette.
void SetTitleOffset(Float_t titleoffset=1)
Definition: TGaxis.h:125
The palette painting class.
Definition: TPaletteAxis.h:29
void SetHistogram(TH1 *h)
Definition: TPaletteAxis.h:57
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:61
virtual void SetLabelSize(Float_t labelsize)
Definition: TPaletteAxis.h:62
const char * Data() const
Definition: TString.h:364
TGaxis * GetAxis()
Definition: TPaletteAxis.h:49