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
40 TPaletteAxis(const TPaletteAxis &palette);
41 ~TPaletteAxis() override;
42 void Copy(TObject &palette) const override;
44
45 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
46 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
47 TGaxis *GetAxis() {return &fAxis;}
49 TH1* GetHistogram(){return fH;}
50 char *GetObjectInfo(Int_t px, Int_t py) const override;
52 void Paint(Option_t *option="") override;
53 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
54 void SetHistogram(TH1* h) {fH = h;}
55 virtual void SetNdivisions(Int_t ndiv=10) {if (fH) fH->GetZaxis()->SetNdivisions(ndiv);} // *MENU*
56 virtual void SetAxisColor(Int_t color=1, Float_t alpha=1) {if (fH) fH->GetZaxis()->SetAxisColor(color,alpha);} // *MENU*
57 virtual void SetLabelColor(Int_t color=1) {if (fH) fH->GetZaxis()->SetLabelColor(color);} // *MENU*
58 virtual void SetLabelFont(Int_t font=42) {if (fH) fH->GetZaxis()->SetLabelFont(font);} // *MENU*
59 virtual void SetLabelOffset(Float_t offset=0.005) {if (fH) fH->GetZaxis()->SetLabelOffset(offset);} // *MENU*
60 virtual void SetLabelSize(Float_t size=0.035) {if (fH) fH->GetZaxis()->SetLabelSize(size);} // *MENU*
61 virtual void SetMaxDigits(Float_t maxdigits=5) {if (fH) fH->GetZaxis()->SetMaxDigits(maxdigits);} // *MENU*
62 virtual void SetTickLength(Float_t length=0.03) {if (fH) fH->GetZaxis()->SetTickLength(length);} // *MENU*
63 virtual void SetTitleOffset(Float_t offset=1) {if (fH) fH->GetZaxis()->SetTitleOffset(offset);} // *MENU*
64 virtual void SetTitleSize(Float_t size=0.035) {if (fH) fH->GetZaxis()->SetTitleSize(size);} // *MENU*
65 virtual void SetTitleColor(Int_t color=1) {if (fH) fH->GetZaxis()->SetTitleColor(color);} // *MENU*
66 virtual void SetTitleFont(Int_t font=42) {if (fH) fH->GetZaxis()->SetTitleFont(font);} // *MENU*
67 virtual void SetTitle(const char *title="") {if (fH) fH->GetZaxis()->SetTitle(title);} // *MENU*
68 void SetLineWidth(Width_t width) override {fAxis.SetLineWidth(width);} // *MENU*
69
70 virtual void UnZoom(); // *MENU*
71
72 ClassDefOverride(TPaletteAxis,4) //class used to display a color palette axis for 2-d plots
73};
74
75#endif
76
#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: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:341
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
The axis painter class.
Definition TGaxis.h:23
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:58
TAxis * GetZaxis()
Definition TH1.h:324
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