Logo ROOT  
Reference Guide
TColorWheel.h
Go to the documentation of this file.
1 // @(#)root/gpad:$Id$
2 // Author: Rene Brun 10/03/2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, 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_TColorWheel
13 #define ROOT_TColorWheel
14 
15 
16 #include "TNamed.h"
17 
18 class TCanvas;
19 class TArc;
20 class TLine;
21 class TText;
22 class TGraph;
23 
24 class TColorWheel : public TNamed {
25 
26 private:
27  Double_t fRmin; ///<Minimum radius for rectangles
28  Double_t fRmax; ///<Maximum radius for rectangles
29  Double_t fR0; ///<Minimum radius for circles
30  Double_t fDr; ///<Circles radius
31  Double_t fRgray; ///<Maximum radius of gray circle
32  Double_t fX[15]; ///<X coordinates of the center of circles
33  Double_t fY[15]; ///<Y coordinates of the center of circles
34  TCanvas *fCanvas; ///<! Canvas used to draw the Color Wheel
35  TArc *fArc; ///<! pointer to utility arc
36  TLine *fLine; ///<! pointer to utility line
37  TText *fText; ///<! pointer to utility text
38  TGraph *fGraph; ///<! pointer to utility graph
39 
40  TColorWheel(const TColorWheel &org); // no copy, use TObject::Clone()
41  TColorWheel &operator=(const TColorWheel &rhs); // idem
42 
43 protected:
44  Int_t InCircles(Double_t x, Double_t y, Int_t coffset, Double_t angle) const;
45  Int_t InGray(Double_t x, Double_t y) const;
46  Int_t InRectangles(Double_t x, Double_t y, Int_t coffset, Double_t angle) const;
47  void PaintCircle(Int_t coffset,Int_t n,Double_t x, Double_t y, Double_t ang) const;
48  void PaintCircles(Int_t coffset, Double_t angle) const ;
49  void PaintGray() const;
50  void PaintRectangles(Int_t coffset, Double_t angle) const;
51  void Rotate(Double_t x, Double_t y, Double_t &u, Double_t &v, Double_t ang) const;
52 
53 public:
54  TColorWheel();
55  virtual ~TColorWheel();
56  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
57  virtual void Draw(Option_t *option="");
58  TCanvas *GetCanvas() const {return fCanvas;}
59  virtual Int_t GetColor(Int_t px, Int_t py) const;
60  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
61  virtual void Paint(Option_t *option="");
62  virtual void SetCanvas(TCanvas *can) {fCanvas = can;}
63 
64  ClassDef(TColorWheel,1) //The ROOT Color Wheel
65 };
66 
67 #endif
68 
TColorWheel::fX
Double_t fX[15]
X coordinates of the center of circles.
Definition: TColorWheel.h:32
TColorWheel::DistancetoPrimitive
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
always return the color wheel
Definition: TColorWheel.cxx:111
TColorWheel::fGraph
TGraph * fGraph
! pointer to utility graph
Definition: TColorWheel.h:38
n
const Int_t n
Definition: legend1.C:16
TColorWheel::GetObjectInfo
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Return the color number pointed by the mouse.
Definition: TColorWheel.cxx:160
TColorWheel::fArc
TArc * fArc
! pointer to utility arc
Definition: TColorWheel.h:35
TColorWheel::~TColorWheel
virtual ~TColorWheel()
destructor
Definition: TColorWheel.cxx:99
TArc
Definition: TArc.h:26
TLine
Definition: TLine.h:22
TColorWheel::TColorWheel
TColorWheel()
constructor
Definition: TColorWheel.cxx:65
TColorWheel::fText
TText * fText
! pointer to utility text
Definition: TColorWheel.h:37
TColorWheel::InGray
Int_t InGray(Double_t x, Double_t y) const
Return the color number when the mouse point to the gray circle.
Definition: TColorWheel.cxx:199
TNamed.h
TColorWheel::PaintCircle
void PaintCircle(Int_t coffset, Int_t n, Double_t x, Double_t y, Double_t ang) const
Draw one color of type circle.
Definition: TColorWheel.cxx:263
TColorWheel::fLine
TLine * fLine
! pointer to utility line
Definition: TColorWheel.h:36
TColorWheel::fY
Double_t fY[15]
Y coordinates of the center of circles.
Definition: TColorWheel.h:33
Int_t
int Int_t
Definition: RtypesCore.h:45
x
Double_t x[n]
Definition: legend1.C:17
TColorWheel::Draw
virtual void Draw(Option_t *option="")
Paint the color wheel.
Definition: TColorWheel.cxx:120
TColorWheel::PaintGray
void PaintGray() const
Draw the gray colors + white + black.
Definition: TColorWheel.cxx:394
TColorWheel::SetCanvas
virtual void SetCanvas(TCanvas *can)
Definition: TColorWheel.h:62
TColorWheel::operator=
TColorWheel & operator=(const TColorWheel &rhs)
v
@ v
Definition: rootcling_impl.cxx:3635
TColorWheel::InRectangles
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.
Definition: TColorWheel.cxx:215
TColorWheel::Rotate
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.
Definition: TColorWheel.cxx:433
TColorWheel::fRgray
Double_t fRgray
Maximum radius of gray circle.
Definition: TColorWheel.h:31
TColorWheel::InCircles
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.
Definition: TColorWheel.cxx:182
TColorWheel
Definition: TColorWheel.h:24
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TNamed
Definition: TNamed.h:29
TColorWheel::fCanvas
TCanvas * fCanvas
! Canvas used to draw the Color Wheel
Definition: TColorWheel.h:34
TColorWheel::Paint
virtual void Paint(Option_t *option="")
Paint the color wheel.
Definition: TColorWheel.cxx:230
y
Double_t y[n]
Definition: legend1.C:17
org
#define org(otri, vertexptr)
Definition: triangle.c:1037
TColorWheel::fRmax
Double_t fRmax
Maximum radius for rectangles.
Definition: TColorWheel.h:28
TColorWheel::GetColor
virtual Int_t GetColor(Int_t px, Int_t py) const
Return the color number pointed by the mouse.
Definition: TColorWheel.cxx:135
TColorWheel::PaintCircles
void PaintCircles(Int_t coffset, Double_t angle) const
Draw all colors of type circle.
Definition: TColorWheel.cxx:284
TColorWheel::PaintRectangles
void PaintRectangles(Int_t coffset, Double_t angle) const
Draw all colors of type rectangle.
Definition: TColorWheel.cxx:311
TText
Definition: TText.h:22
TColorWheel::fRmin
Double_t fRmin
Minimum radius for rectangles.
Definition: TColorWheel.h:27
Double_t
double Double_t
Definition: RtypesCore.h:59
TGraph
Definition: TGraph.h:41
TCanvas
Definition: TCanvas.h:23
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TColorWheel::fDr
Double_t fDr
Circles radius.
Definition: TColorWheel.h:30
TColorWheel::GetCanvas
TCanvas * GetCanvas() const
Definition: TColorWheel.h:58
TColorWheel::fR0
Double_t fR0
Minimum radius for circles.
Definition: TColorWheel.h:29
int