Logo ROOT  
Reference Guide
Go to the documentation of this file.
1// @(#)root/histpainter:$Id$
2// Author: Rene Brun 15/11/2002
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 *************************************************************************/
12#ifndef ROOT_TPaletteAxis
13#define ROOT_TPaletteAxis
17// //
18// TPaletteAxis //
19// //
20// class used to display a color palette axis for 2-d plots //
21// //
24#include "TPave.h"
25#include "TGaxis.h"
27class TH1;
29class TPaletteAxis : public TPave {
32 TGaxis fAxis; ///< Palette axis
33 TH1 *fH; ///<! Pointer to parent histogram
36 // TPaletteAxis status bits
37 enum EStatusBits { kHasView = BIT(11) };
41 TPaletteAxis(const TPaletteAxis &palette);
42 ~TPaletteAxis() override;
43 void Copy(TObject &palette) const override;
46 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
47 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
48 TGaxis *GetAxis() {return &fAxis;}
50 TH1* GetHistogram(){return fH;}
51 char *GetObjectInfo(Int_t px, Int_t py) const override;
53 void Paint(Option_t *option="") override;
54 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
55 void SetHistogram(TH1* h) {fH = h;}
56 virtual void SetLabelColor(Int_t labelcolor) {fAxis.SetLabelColor(labelcolor);} // *MENU*
57 virtual void SetLabelFont(Int_t labelfont) {fAxis.SetLabelFont(labelfont);} // *MENU*
58 virtual void SetLabelOffset(Float_t labeloffset) {fAxis.SetLabelOffset(labeloffset);} // *MENU*
59 virtual void SetLabelSize(Float_t labelsize) {fAxis.SetLabelSize(labelsize);} // *MENU*
60 virtual void SetTitleOffset(Float_t titleoffset=1) {fAxis.SetTitleOffset(titleoffset);} // *MENU*
61 virtual void SetTitleSize(Float_t titlesize) {fAxis.SetTitleSize(titlesize);} // *MENU*
62 void SetLineColor(Color_t linecolor) override {fAxis.SetLineColor(linecolor);} // *MENU*
63 void SetLineWidth(Width_t linewidth) override {fAxis.SetLineWidth(linewidth);} // *MENU*
64 virtual void UnZoom(); // *MENU*
66 ClassDefOverride(TPaletteAxis,4) //class used to display a color palette axis for 2-d plots
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:45
short Color_t
Definition: RtypesCore.h:92
short Width_t
Definition: RtypesCore.h:91
float Float_t
Definition: RtypesCore.h:57
double Double_t
Definition: RtypesCore.h:59
const char Option_t
Definition: RtypesCore.h:66
#define BIT(n)
Definition: Rtypes.h:85
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
Option_t Option_t option
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
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:23
void SetTitleOffset(Float_t titleoffset=1)
Definition: TGaxis.h:127
void SetLabelFont(Int_t labelfont)
Definition: TGaxis.h:108
void SetTitleSize(Float_t titlesize)
Definition: TGaxis.h:128
void SetLabelOffset(Float_t labeloffset)
Definition: TGaxis.h:109
void SetLabelColor(Int_t labelcolor)
Definition: TGaxis.h:107
void SetLabelSize(Float_t labelsize)
Definition: TGaxis.h:110
TH1 is the base class of all histogram classes in ROOT.
Definition: TH1.h:58
Mother of all ROOT objects.
Definition: TObject.h:37
Definition: TObject.h:57
The palette painting class.
Definition: TPaletteAxis.h:29
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Check if mouse on the axis region.
void Paint(Option_t *option="") override
Paint the palette.
virtual void SetLabelSize(Float_t labelsize)
Definition: TPaletteAxis.h:59
TGaxis fAxis
Palette axis.
Definition: TPaletteAxis.h:32
void SetHistogram(TH1 *h)
Definition: TPaletteAxis.h:55
TGaxis * GetAxis()
Definition: TPaletteAxis.h:48
TPaletteAxis & operator=(const TPaletteAxis &)
Assignment operator.
~TPaletteAxis() override
Palette destructor.
virtual void SetTitleOffset(Float_t titleoffset=1)
Definition: TPaletteAxis.h:60
char * GetObjectInfo(Int_t px, Int_t py) const override
Displays the z value corresponding to cursor position py.
Palette default constructor.
virtual void SetLabelOffset(Float_t labeloffset)
Definition: TPaletteAxis.h:58
Int_t GetBinColor(Int_t i, Int_t j)
Returns the color index of the bin (i,j).
void Copy(TObject &palette) const override
Copy a palette to a palette.
TH1 * fH
! Pointer to parent histogram
Definition: TPaletteAxis.h:33
virtual void SetLabelColor(Int_t labelcolor)
Definition: TPaletteAxis.h:56
virtual void SetTitleSize(Float_t titlesize)
Definition: TPaletteAxis.h:61
void SetLineColor(Color_t linecolor) override
Set the line color.
Definition: TPaletteAxis.h:62
virtual void UnZoom()
Unzoom the palette.
void SetLineWidth(Width_t linewidth) override
Set the line width.
Definition: TPaletteAxis.h:63
TH1 * GetHistogram()
Definition: TPaletteAxis.h:50
virtual void SetLabelFont(Int_t labelfont)
Definition: TPaletteAxis.h:57
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Check if mouse on the axis region.
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