-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolorscale.h
72 lines (53 loc) · 1.74 KB
/
colorscale.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// colorscale.h
#ifndef COLORSCALE_H
#define COLORSCALE_H
#ifndef ROOT_TPave
#include "TPave.h"
#endif
#ifndef ROOT_TGaxis
#include "TGaxis.h"
#endif
struct CColor { float r, g, b; };
class CColorScale : public TPave
{
public:
enum CSMode { CS_BIN, CS_FAIL, CS_CLASS, CS_GROUP, CS_RANGE };
CColorScale(Double_t x1, Double_t y1, Double_t x2 ,Double_t y2);
~CColorScale();
void SetBin() { mode = CS_BIN; visible = false; }
void SetFail() { mode = CS_FAIL; visible = false; }
void SetClass() { mode = CS_CLASS; visible = false; }
void SetGroup() { mode = CS_GROUP; visible = false; }
void SetRange(Double_t min, Double_t max);
static Int_t GetBinColorId(Int_t w) { return colorBin[w]; };
static Int_t GetFailColorId(Int_t w) { return colorFail[w]; };
static Int_t GetClassColorId(Int_t w) { return colorClass[w]; };
static Int_t GetGroupColorId(Int_t w) { return colorGroup[w]; };
static Int_t GetBinColor(Int_t w);
static Int_t GetFailColor(Int_t w);
static Int_t GetClassColor(Int_t w);
static Int_t GetGroupColor(Int_t w);
Int_t GetColor(Double_t w);
virtual void Paint(Option_t *option="");
protected:
bool visible;
CSMode mode;
static const Int_t ndivz; // number of contour levels
Double_t xmin, xmax, ymin, ymax;
Double_t wmin;
Double_t wmax;
TGaxis *fAxis;
static void InstallColor(int colNum, float red, float green, float blue);
static void InstallColorTable();
static const Int_t SIZE_OF_COLORTABLE;
static const CColor COLOR_TABLE[];
static const Int_t nColorBin;
static const Int_t colorBin[13];
static const Int_t nColorFail;
static const Int_t colorFail[24];
static const Int_t nColorClass;
static const Int_t colorClass[5];
static const Int_t nColorGroup;
static const Int_t colorGroup[12];
};
#endif