#include <ColorAxis.h>
Inheritance diagram for ColorAxis:

Public Member Functions | |
| ColorAxis (int ncolors, double width, double x1, double y1, double x2, double y2, int ndiv=505, Option_t *option="") | |
| ColorAxis (int ncolors, double width, RangeDouble *range, double x1, double y1, double x2, double y2, int ndiv=505, Option_t *option="") | |
| virtual | ~ColorAxis () |
| void | SetScale (double s) |
| double | GetScale () |
| virtual void | PaintAxis (double xmin, double ymin, double xmax, double ymax, double &wmin, double &wmax, int &ndiv, Option_t *chopt="", double unused1=0, bool unused2=kFALSE) |
| void | PaintPalette () |
Private Member Functions | |
| ColorAxis (const ColorAxis &rhs) | |
| ColorAxis & | operator= (const ColorAxis &rhs) |
Private Attributes | |
| int | fNcolors |
| double | fWidth |
| double | fScale |
Midad/Base
Similar to ROOT's color scale when you plot a histogram with "colz".
Contact: bv@bnl.gov
Created on: Mon Sep 9 15:05:25 2002
Definition at line 25 of file ColorAxis.h.
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 14 of file ColorAxis.cxx. 00016 : RangeAxis(x1,y1,x2,y2,ndiv,option) 00017 , fNcolors(ncolors) 00018 , fWidth(width) 00019 , fScale(1.0) 00020 { 00021 }
|
|
||||||||||||||||||||||||||||||||||||||||
|
Definition at line 22 of file ColorAxis.cxx. References option, and RangeDouble. 00025 : RangeAxis(range,x1,y1,x2,y2,ndiv,option) 00026 , fNcolors(ncolors) 00027 , fWidth(width) 00028 , fScale(1.0) 00029 { 00030 }
|
|
|
Definition at line 31 of file ColorAxis.cxx. 00032 {
00033 }
|
|
|
|
|
|
Definition at line 43 of file ColorAxis.h. 00043 { return fScale; }
|
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
Definition at line 37 of file ColorAxis.cxx. References PaintPalette(). 00040 {
00041 // First paint colors
00042 this->PaintPalette();
00043
00044 // Then the TGaxis
00045 #if 0
00046 cerr << "(" << xmin << "," << ymin << ") --> "
00047 << "(" << xmax << "," << ymax << "), "
00048 << "[" << wmin << "," << wmax << "]\n";
00049 #endif
00050
00051 if (wmax < wmin) {
00052 cerr << "Warning: wmax(" << wmax << ") < wmin(" << wmin <<"), reversing\n";
00053 std::swap(wmin,wmax);
00054 }
00055 if (wmin == wmax) {
00056 wmin /= 2.0;
00057 if (wmax == 0.0) wmax = 1.0;
00058 else wmax *= 2.0;
00059 }
00060
00061 wmin /= fScale;
00062 wmax /= fScale;
00063
00064 this->RangeAxis::PaintAxis(xmin,ymin,xmax,ymax,wmin,wmax,ndiv,chopt);
00065 }
|
|
|
Definition at line 67 of file ColorAxis.cxx. References Rainbow::GetRelativeColor(). Referenced by EVD::Init(), and PaintAxis(). 00068 {
00069 static Rainbow rainbow;
00070
00071 const char* opt = this->GetOption();
00072 int sign = 1;
00073
00074 // Attempt to deal with TGaxis inconsistent options
00075 if (strstr(opt,"-")) sign = -1;
00076 if (strstr(opt,"+") && strstr(opt,"L")) sign = -1;
00077
00078 double dx=0,dy=0, width=0, height=0;
00079 if (fX1 == fX2) { // vertical
00080 dy = (fY2-fY1)/(1.0*fNcolors);
00081 width = sign*fWidth;
00082 }
00083 else { // horizontal
00084 dx = (fX2-fX1)/(1.0*fNcolors);
00085 height = sign*fWidth;
00086 }
00087
00088
00089 // cerr << "[" << dx << "," << dy << "] --> [" << width << "," << height << "]\n";
00090
00091 TBox box;
00092 for (int i = 0; i < fNcolors; ++i) {
00093 double x1 = fX1 + i*dx;
00094 double x2 = fX1 + (i+1)*dx + width;
00095 double y1 = fY1 + i*dy;
00096 double y2 = fY1 + (i+1)*dy + height;
00097
00098 // cerr << x1 << "," << y1 << " --> " << x2 << "," << y2 << endl;
00099
00100 double rel = (1.0*i)/(1.0*fNcolors);
00101 int col = rainbow.GetRelativeColor(rel);
00102
00103 box.SetFillColor(col);
00104 box.TAttFill::Modify();
00105
00106 gPad->PaintBox(x1,y1,x2,y2);
00107 }
00108 }
|
|
|
Definition at line 42 of file ColorAxis.h. References fScale. Referenced by MultiPage::ColorSemanticHandler(), EVD::ColorSemanticHandler(), MultiPage::Init(), and EVD::Init(). 00042 { fScale = s; }
|
|
|
Definition at line 58 of file ColorAxis.h. |
|
|
Definition at line 60 of file ColorAxis.h. Referenced by SetScale(). |
|
|
Definition at line 59 of file ColorAxis.h. |
1.3.9.1