75 fX[ 0] = fR0-0.2*fDr; fY[ 0] = 0;
76 fX[ 1] = fR0+fDr; fY[ 1] = 0.75*fDr;
77 fX[ 2] = fR0+fDr; fY[ 2] = -0.75*fDr;
78 fX[ 3] = fR0+2.2*fDr; fY[ 3] = 1.5*fDr;
79 fX[ 4] = fR0+2.2*fDr; fY[ 4] = 0;
80 fX[ 5] = fR0+2.2*fDr; fY[ 5] = -1.5*fDr;
81 fX[ 6] = fR0+3.4*fDr; fY[ 6] = 2.2*fDr;
82 fX[ 7] = fR0+3.4*fDr; fY[ 7] = 0.7*fDr;
83 fX[ 8] = fR0+3.4*fDr; fY[ 8] = -0.7*fDr;
84 fX[ 9] = fR0+3.4*fDr; fY[ 9] = -2.2*fDr;
85 fX[10] = fR0+4.6*fDr; fY[10] = 2.8*fDr;
86 fX[11] = fR0+4.6*fDr; fY[11] = 1.4*fDr;
87 fX[12] = fR0+4.6*fDr; fY[12] = 0;
88 fX[13] = fR0+4.6*fDr; fY[13] = -1.4*fDr;
89 fX[14] = fR0+4.6*fDr; fY[14] = -2.8*fDr;
111 if (px+py < 0)
return 1;
139 n =
InGray(x,y);
if (n >= 0)
return n;
160 static char info[50];
164 if (n < 0)
return info;
166 if (!color)
return info;
170 snprintf(info,50,
"col %d, %s, r=%3d, g=%3d, b=%3d",n,color->
GetName(),
r,
g,b);
183 for (
Int_t i=0;i<15;i++) {
186 if (dx*dx+dy*dy < r2)
return coffset+i-10;
198 if (ang < 0) ang += 360;
199 if (ang < 60)
return kWhite;
200 if (ang < 120)
return kGray;
201 if (ang < 180)
return kGray+1;
202 if (ang < 240)
return kGray+2;
203 if (ang < 300)
return kGray+3;
216 if (u < fRmin || u >
fRmax)
return -1;
218 if (v > 0)
return coffset + div+1;
219 return coffset+div-9;
291 if (angle == 240) tangle = -30;
292 if (angle == 300) tangle = 30;
298 for (
Int_t i=0;i<15;i++) {
314 Rotate(rmax+0.62*dr,0,u,v,ang);
315 Rotate(rmax-dr,0.9*dy,u0,v0,ang);
322 if (angle == 30) tangle = -60;
323 if (angle == 90) tangle = 0;
324 if (angle == 150) tangle = 60;
325 if (angle == 210) tangle = -60;
326 if (angle == 270) tangle = 0;
334 for (
Int_t j=0;j<2;j++) {
335 for (
Int_t i=0;i<10;i++) {
337 Int_t colorn = coffset +
n;
338 color =
gROOT->GetColor(colorn);
339 Rotate(rmin+i*dr, 0,x[0],y[0],ang);
340 Rotate(rmin+i*dr, dy,x[1],y[1],ang);
341 Rotate(rmin+i*dr+dr,dy,x[2],y[2],ang);
342 Rotate(rmin+i*dr+dr, 0,x[3],y[3],ang);
345 Rotate(rmin+i*dr+0.5*dr,0.5*dy,x[0],y[0],ang);
352 if (angle > 180) tang -=180;
360 Rotate(rmin,-dy,x[0],y[0],ang);
361 Rotate(rmax,-dy,x[1],y[1],ang);
362 Rotate(rmax, dy,x[2],y[2],ang);
363 Rotate(rmin, dy,x[3],y[3],ang);
364 Rotate(rmin,-dy,x[4],y[4],ang);
369 Rotate(rmin+3*dr,-dy,x[0],y[0],ang);
370 Rotate(rmin+3*dr, dy,x[1],y[1],ang);
372 Rotate(rmin+6*dr,-dy,x[0],y[0],ang);
373 Rotate(rmin+6*dr, dy,x[1],y[1],ang);
375 Rotate(rmin+9*dr,-dy,x[0],y[0],ang);
376 Rotate(rmin+9*dr, dy,x[1],y[1],ang);
378 Rotate(rmin+7*dr,-dy,x[0],y[0],ang);
379 Rotate(rmin+7*dr, dy,x[1],y[1],ang);
381 Rotate(rmin+6*dr,0,x[0],y[0],ang);
382 Rotate(rmax, 0,x[1],y[1],ang);
Int_t InCircles(Double_t x, Double_t y, Int_t coffset, Double_t angle) const
Return the color number when the mouse point to a circle.
virtual void SetLineWidth(Width_t lwidth)
virtual void PaintEllipse(Double_t x1, Double_t y1, Double_t r1, Double_t r2, Double_t phimin, Double_t phimax, Double_t theta, Option_t *option="")
Draw this ellipse with new coordinates.
virtual void ToggleEventStatus()
Toggle event statusbar.
Namespace for new ROOT classes and functions.
Int_t InGray(Double_t x, Double_t y) const
Return the color number when the mouse point to the gray circle.
Int_t InRectangles(Double_t x, Double_t y, Int_t coffset, Double_t angle) const
Return the color number when the mouse point to a rectangle.
void PaintGraph(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
Draw the (x,y) as a graph.
void Rotate(Double_t x, Double_t y, Double_t &u, Double_t &v, Double_t ang) const
Rotate point x,y with an angle=ang.
void PaintCircles(Int_t coffset, Double_t angle) const
Draw all colors of type circle.
TLine * fLine
pointer to utility arc
virtual void SetBorderMode(Short_t bordermode)
virtual ~TColorWheel()
destructor
void PaintRectangles(Int_t coffset, Double_t angle) const
Draw all colors of type rectangle.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
virtual void SetTextFont(Font_t tfont=62)
void PaintGray() const
Draw the gray colors + white + black.
virtual void Draw(Option_t *option="")
Paint the color wheel.
RooCmdArg Color(Color_t color)
The TNamed class is the base class for all named ROOT classes.
Base class for several text objects.
Double_t ATan2(Double_t, Double_t)
virtual void SetTextAlign(Short_t align=11)
virtual void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
virtual void SetLineColor(Color_t lcolor)
virtual void SetFillColor(Color_t fcolor)
virtual void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Set world coordinate system for the pad.
virtual void Paint(Option_t *option="")
Paint the color wheel.
virtual void SetTextAngle(Float_t tangle=0)
virtual Int_t GetColor(Int_t px, Int_t py) const
Return the color number pointed by the mouse.
char * Form(const char *fmt,...)
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb"...
virtual const char * GetName() const
Returns name of object.
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Return the color number pointed by the mouse.
The color creation and management class.
void PaintCircle(Int_t coffset, Int_t n, Double_t x, Double_t y, Double_t ang) const
Draw one color of type circle.
A Graph is a graphics object made of two arrays X and Y with npoints each.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
always return the color wheel
TGraph * fGraph
pointer to utility text
Double_t AbsPixeltoX(Int_t px)
virtual void SetTextColor(Color_t tcolor=1)
TArc * fArc
Canvas used to draw the Color Wheel.
virtual void SetTextSize(Float_t tsize=1)
Double_t AbsPixeltoY(Int_t py)
virtual void PaintText(Double_t x, Double_t y, const char *text)
Draw this text with new coordinates.
Draw the ROOT Color Wheel.
unsigned int r2[N_CITIES]
TText * fText
pointer to utility line