Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include "TH1.h"
27
28class TPaletteAxis : public TPave {
29
30protected:
31 TGaxis fAxis; ///< Palette axis
32 TH1 *fH; ///<! Pointer to parent histogram
33
34public:
35 // TPaletteAxis status bits
36 enum EStatusBits { kHasView = BIT(11) };
37
42 TPaletteAxis(const TPaletteAxis &palette);
43 ~TPaletteAxis() override;
44 void Copy(TObject &palette) const override;
46
47 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
48 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
49 TGaxis *GetAxis() {return &fAxis;}
51 TH1* GetHistogram(){return fH;}
52 char *GetObjectInfo(Int_t px, Int_t py) const override;
54 void Paint(Option_t *option="") override;
55 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
56 void SetHistogram(TH1* h) {fH = h;}
57 virtual void SetNdivisions(Int_t ndiv=10) {if (fH) fH->GetZaxis()->SetNdivisions(ndiv); else fAxis.SetNdivisions(ndiv);} // *MENU*
58 virtual void SetLabelColor(Int_t color=1) {if (fH) fH->GetZaxis()->SetLabelColor(color); else fAxis.SetLabelColor(color);} // *MENU*
59 virtual void SetLabelFont(Int_t font=42) {if (fH) fH->GetZaxis()->SetLabelFont(font); else fAxis.SetLabelFont(font);} // *MENU*
60 virtual void SetLabelOffset(Float_t offset=0.005) {if (fH) fH->GetZaxis()->SetLabelOffset(offset); else fAxis.SetLabelOffset(offset);} // *MENU*
61 virtual void SetLabelSize(Float_t size=0.035) {if (fH) fH->GetZaxis()->SetLabelSize(size); else fAxis.SetLabelSize(size);} // *MENU*
62 virtual void SetMaxDigits(Float_t maxdigits=5) {if (fH) fH->GetZaxis()->SetMaxDigits(maxdigits); else fAxis.SetMaxDigits(maxdigits);} // *MENU*
63 virtual void SetTickLength(Float_t length=0.03) {if (fH) fH->GetZaxis()->SetTickLength(length); else fAxis.SetTickLength(length);} // *MENU*
65 virtual void SetTitleSize(Float_t size=0.035) {if (fH) fH->GetZaxis()->SetTitleSize(size); else fAxis.SetTitleSize(size);} // *MENU*
66 virtual void SetTitleColor(Int_t color=1) {if (fH) fH->GetZaxis()->SetTitleColor(color); else fAxis.SetTitleColor(color);} // *MENU*
67 virtual void SetTitleFont(Int_t font=42) {if (fH) fH->GetZaxis()->SetTitleFont(font); else fAxis.SetTitleFont(font);} // *MENU*
68 virtual void SetTitle(const char *title="") {if (fH) fH->GetZaxis()->SetTitle(title); else fAxis.SetTitle(title);} // *MENU*
69 virtual void SetAxisColor(Int_t color=1, Float_t alpha=1) {if (fH) fH->GetZaxis()->SetAxisColor(color,alpha);} // *MENU*
70 void SetLineWidth(Width_t width) override {fAxis.SetLineWidth(width);} // *MENU*
71
72 virtual void UnZoom(); // *MENU*
73
74 ClassDefOverride(TPaletteAxis,4) //class used to display a color palette axis for 2-d plots
75};
76
77#endif
78
#define h(i)
Definition RSha256.hxx:106
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Definition RtypesCore.h:45
short Width_t
Definition RtypesCore.h:84
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:90
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
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 width
Option_t Option_t TPoint TPoint const char y1
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
Definition TAttAxis.cxx:298
virtual void SetAxisColor(Color_t color=1, Float_t alpha=1.)
Set color of the line axis and tick marks.
Definition TAttAxis.cxx:160
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
Definition TAttAxis.cxx:203
virtual void SetTitleFont(Style_t font=62)
Set the title font.
Definition TAttAxis.cxx:327
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels.
Definition TAttAxis.cxx:191
virtual void SetLabelFont(Style_t font=62)
Set labels' font.
Definition TAttAxis.cxx:180
virtual void SetTitleSize(Float_t size=0.04)
Set size of axis title.
Definition TAttAxis.cxx:309
virtual void SetTitleColor(Color_t color=1)
Set color of axis title.
Definition TAttAxis.cxx:318
virtual void SetMaxDigits(Int_t maxDigits=5)
This function sets the maximum number of digits permitted for the axis labels above which the notatio...
Definition TAttAxis.cxx:268
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length.
Definition TAttAxis.cxx:284
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
Definition TAttAxis.cxx:233
virtual void SetLabelColor(Color_t color=1, Float_t alpha=1.)
Set color of labels.
Definition TAttAxis.cxx:170
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition TAttLine.h:43
Class to manage histogram axis.
Definition TAxis.h:32
The axis painter class.
Definition TGaxis.h:24
void SetTitleOffset(Float_t titleoffset=1)
Definition TGaxis.h:128
void SetLabelFont(Int_t labelfont)
Definition TGaxis.h:105
void SetTitleSize(Float_t titlesize)
Definition TGaxis.h:129
void SetTitleFont(Int_t titlefont)
Definition TGaxis.h:130
virtual void SetTitle(const char *title="")
Change the title of the axis.
Definition TGaxis.cxx:2942
void SetLabelOffset(Float_t labeloffset)
Definition TGaxis.h:106
static void SetMaxDigits(Int_t maxd=5)
Static function to set fgMaxDigits for axis.
Definition TGaxis.cxx:2896
virtual void SetNdivisions(Int_t ndiv)
Definition TGaxis.h:118
void SetLabelColor(Int_t labelcolor)
Definition TGaxis.h:104
void SetTickLength(Float_t ticklength)
Definition TGaxis.h:123
void SetTitleColor(Int_t titlecolor)
Definition TGaxis.h:131
void SetLabelSize(Float_t labelsize)
Definition TGaxis.h:107
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
TAxis * GetZaxis()
Definition TH1.h:327
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:164
Mother of all ROOT objects.
Definition TObject.h:41
The palette painting class.
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 SetAxisColor(Int_t color=1, Float_t alpha=1)
virtual void SetNdivisions(Int_t ndiv=10)
TGaxis fAxis
Palette axis.
void SetHistogram(TH1 *h)
TGaxis * GetAxis()
TPaletteAxis & operator=(const TPaletteAxis &)
Assignment operator.
~TPaletteAxis() override
Palette destructor.
void SetLineWidth(Width_t width) override
Set the line width.
char * GetObjectInfo(Int_t px, Int_t py) const override
Displays the z value corresponding to cursor position py.
virtual void SetTitle(const char *title="")
virtual void SetMaxDigits(Float_t maxdigits=5)
TPaletteAxis()
Palette default constructor.
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
virtual void SetTitleColor(Int_t color=1)
virtual void SetLabelFont(Int_t font=42)
virtual void SetTickLength(Float_t length=0.03)
virtual void UnZoom()
Unzoom the palette.
virtual void SetLabelOffset(Float_t offset=0.005)
virtual void SetTitleOffset(Float_t offset=1)
TH1 * GetHistogram()
virtual void SetLabelColor(Int_t color=1)
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Check if mouse on the axis region.
virtual void SetTitleFont(Int_t font=42)
virtual void SetTitleSize(Float_t size=0.035)
Int_t GetValueColor(Double_t zc)
Returns the color index of the given z value.
virtual void SetLabelSize(Float_t size=0.035)
A TBox with a bordersize and a shadow option.
Definition TPave.h:19