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 Int_t fLog; ///< Log option: 0 use Logz, 1 is linear, 2 is log
34
35public:
36 // TPaletteAxis status bits
37 enum EStatusBits { kHasView = BIT(11) };
38
43 TPaletteAxis(const TPaletteAxis &palette);
44 ~TPaletteAxis() override;
45 void Copy(TObject &palette) const override;
47
49 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
50 TGaxis *GetAxis() {return &fAxis;}
52 TH1* GetHistogram(){return fH;}
53 char *GetObjectInfo(Int_t px, Int_t py) const override;
55 void Paint(Option_t *option="") override;
56 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
57 Int_t GetLog() const;
58 void SetLog(Int_t log) {fLog = log;}
59 void SetHistogram(TH1* h) {fH = h;}
60 virtual void SetNdivisions(Int_t ndiv=10) {if (fH) fH->GetZaxis()->SetNdivisions(ndiv); else fAxis.SetNdivisions(ndiv);} // *MENU*
61 virtual void SetLabelColor(Int_t color=1) {if (fH) fH->GetZaxis()->SetLabelColor(color); else fAxis.SetLabelColor(color);} // *MENU*
62 virtual void SetLabelFont(Int_t font=42) {if (fH) fH->GetZaxis()->SetLabelFont(font); else fAxis.SetLabelFont(font);} // *MENU*
63 virtual void SetLabelOffset(Float_t offset=0.005) {if (fH) fH->GetZaxis()->SetLabelOffset(offset); else fAxis.SetLabelOffset(offset);} // *MENU*
64 virtual void SetLabelSize(Float_t size=0.035) {if (fH) fH->GetZaxis()->SetLabelSize(size); else fAxis.SetLabelSize(size);} // *MENU*
65 virtual void SetMaxDigits(Float_t maxdigits=5) {if (fH) fH->GetZaxis()->SetMaxDigits(maxdigits); else fAxis.SetMaxDigits(maxdigits);} // *MENU*
66 virtual void SetTickLength(Float_t length=0.03) {if (fH) fH->GetZaxis()->SetTickLength(length); else fAxis.SetTickLength(length);} // *MENU*
67 virtual void SetTitleOffset(Float_t offset=1) {if (fH) fH->GetZaxis()->SetTitleOffset(offset); else fAxis.SetTitleOffset(offset);} // *MENU*
68 virtual void SetTitleSize(Float_t size=0.035) {if (fH) fH->GetZaxis()->SetTitleSize(size); else fAxis.SetTitleSize(size);} // *MENU*
69 virtual void SetTitleColor(Int_t color=1) {if (fH) fH->GetZaxis()->SetTitleColor(color); else fAxis.SetTitleColor(color);} // *MENU*
70 virtual void SetTitleFont(Int_t font=42) {if (fH) fH->GetZaxis()->SetTitleFont(font); else fAxis.SetTitleFont(font);} // *MENU*
71 virtual void SetTitle(const char *title="") {if (fH) fH->GetZaxis()->SetTitle(title); else fAxis.SetTitle(title);} // *MENU*
72 virtual void SetAxisColor(Int_t color=1, Float_t alpha=1) {if (fH) fH->GetZaxis()->SetAxisColor(color,alpha);} // *MENU*
73 void SetLineWidth(Width_t width) override {fAxis.SetLineWidth(width);} // *MENU*
74
75 virtual void UnZoom(); // *MENU*
76
77 ClassDefOverride(TPaletteAxis, 5) //class used to display a color palette axis for 2-d plots
78};
79
80#endif
81
#define h(i)
Definition RSha256.hxx:106
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
short Width_t
Line width (short).
Definition RtypesCore.h:98
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
float Float_t
Float 4 bytes (float).
Definition RtypesCore.h:71
const char Option_t
Option string (const char).
Definition RtypesCore.h:80
#define BIT(n)
Definition Rtypes.h:91
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
Class to manage histogram axis.
Definition TAxis.h:32
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:109
TObject()
TObject constructor.
Definition TObject.h:259
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
Compute distance from point px,py to a box.
TPaletteAxis(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t min, Double_t max)
void Paint(Option_t *option="") override
Paint this box with its current attributes.
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 &)
~TPaletteAxis() override
void SetLineWidth(Width_t width) override
Set the line width.
char * GetObjectInfo(Int_t px, Int_t py) const override
Returns string containing info about the object at position (px,py).
virtual void SetTitle(const char *title="")
virtual void SetMaxDigits(Float_t maxdigits=5)
TPaletteAxis(Double_t x1, Double_t y1, Double_t x2, Double_t y2, TH1 *h)
Int_t GetBinColor(Int_t i, Int_t j)
void Copy(TObject &palette) const override
Copy a Box.
TH1 * fH
! Pointer to parent histogram
TPaletteAxis(Double_t x1, Double_t y1, Double_t x2, Double_t y2, TAxis *ax)
virtual void SetTitleColor(Int_t color=1)
TPaletteAxis(const TPaletteAxis &palette)
virtual void SetLabelFont(Int_t font=42)
virtual void SetTickLength(Float_t length=0.03)
virtual void UnZoom()
Int_t fLog
Log option: 0 use Logz, 1 is linear, 2 is log.
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
Execute action corresponding to one event.
void SetLog(Int_t log)
virtual void SetTitleFont(Int_t font=42)
virtual void SetTitleSize(Float_t size=0.035)
Int_t GetLog() const
Int_t GetValueColor(Double_t zc)
virtual void SetLabelSize(Float_t size=0.035)
TPave()
Pave default constructor.
Definition TPave.cxx:35