Logo ROOT  
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
27class TH1;
28
29class TPaletteAxis : public TPave {
30
31protected:
32 TGaxis fAxis; // palette axis
33 TH1 *fH; //! pointer to parent histogram
34 TString fName; // Pave name
35
36public:
37 // TPaletteAxis status bits
38 enum EStatusBits { kHasView = BIT(11) };
39
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
#define h(i)
Definition: RSha256.hxx:106
static const double x2[5]
static const double x1[5]
int Int_t
Definition: RtypesCore.h:43
short Width_t
Definition: RtypesCore.h:80
double Double_t
Definition: RtypesCore.h:57
short Color_t
Definition: RtypesCore.h:81
float Float_t
Definition: RtypesCore.h:55
const char Option_t
Definition: RtypesCore.h:64
#define ClassDef(name, id)
Definition: Rtypes.h:322
#define BIT(n)
Definition: Rtypes.h:83
char name[80]
Definition: TGX11.cxx:109
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition: TAttLine.h:43
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition: TAttLine.h:40
The axis painter class.
Definition: TGaxis.h:24
void SetTitleOffset(Float_t titleoffset=1)
Definition: TGaxis.h:125
void SetLabelFont(Int_t labelfont)
Definition: TGaxis.h:106
void SetTitleSize(Float_t titlesize)
Definition: TGaxis.h:126
void SetLabelOffset(Float_t labeloffset)
Definition: TGaxis.h:107
void SetLabelColor(Int_t labelcolor)
Definition: TGaxis.h:105
void SetLabelSize(Float_t labelsize)
Definition: TGaxis.h:108
The TH1 histogram class.
Definition: TH1.h:56
Mother of all ROOT objects.
Definition: TObject.h:37
EStatusBits
Definition: TObject.h:57
The palette painting class.
Definition: TPaletteAxis.h:29
void Copy(TObject &palette) const
Copy a palette to a palette.
virtual ~TPaletteAxis()
Palette destructor.
virtual void SetLabelSize(Float_t labelsize)
Definition: TPaletteAxis.h:62
TGaxis fAxis
Definition: TPaletteAxis.h:32
void SetHistogram(TH1 *h)
Definition: TPaletteAxis.h:57
TGaxis * GetAxis()
Definition: TPaletteAxis.h:49
TPaletteAxis & operator=(const TPaletteAxis &)
Assignment operator.
virtual void SetTitleOffset(Float_t titleoffset=1)
Definition: TPaletteAxis.h:63
TPaletteAxis()
Palette default constructor.
TString fName
pointer to parent histogram
Definition: TPaletteAxis.h:34
virtual void SetName(const char *name="")
Definition: TPaletteAxis.h:58
virtual void SetLabelOffset(Float_t labeloffset)
Definition: TPaletteAxis.h:61
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Check if mouse on the axis region.
Int_t GetBinColor(Int_t i, Int_t j)
Returns the color index of the bin (i,j).
virtual void SetLineColor(Color_t linecolor)
Set the line color.
Definition: TPaletteAxis.h:65
Option_t * GetName() const
Returns name of object.
Definition: TPaletteAxis.h:52
virtual void SetLabelColor(Int_t labelcolor)
Definition: TPaletteAxis.h:59
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Check if mouse on the axis region.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual void Paint(Option_t *option="")
Paint the palette.
virtual void SetTitleSize(Float_t titlesize)
Definition: TPaletteAxis.h:64
virtual void UnZoom()
Unzoom the palette.
virtual void SetLineWidth(Width_t linewidth)
Set the line width.
Definition: TPaletteAxis.h:66
TH1 * GetHistogram()
Definition: TPaletteAxis.h:51
virtual void SetLabelFont(Int_t labelfont)
Definition: TPaletteAxis.h:60
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Displays the z value corresponding to cursor position py.
Int_t GetValueColor(Double_t zc)
Returns the color index of the given z value.
A TBox with a bordersize and a shadow option.
Definition: TPave.h:19
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364