Logo ROOT   6.08/07
Reference Guide
TGraphPolargram.h
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Sebastian Boser, 02/02/06
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_TGraphPolargram
13 #define ROOT_TGraphPolargram
14 
15 #ifndef ROOT_Riosfwd
16 #include "Riosfwd.h"
17 #endif
18 #ifndef ROOT_TAttText
19 #include "TAttText.h"
20 #endif
21 #ifndef ROOT_TAttLine
22 #include "TAttLine.h"
23 #endif
24 #ifndef ROOT_TNamed
25 #include "TNamed.h"
26 #endif
27 
28 
29 class TGraphPolargram: public TNamed, public TAttText, public TAttLine {
30 
31 private:
35 
36  Color_t fPolarLabelColor; ///< Set color of the angular labels
37  Color_t fRadialLabelColor; ///< Set color of the radial labels
38 
39  Double_t fAxisAngle; ///< Set angle of the radial axis
40  Double_t fPolarOffset; ///< Offset for Polar labels
41  Double_t fPolarTextSize; ///< Set Polar text size
42  Double_t fRadialOffset; ///< Offset for radial labels
44  Double_t fRwrmin; ///< Minimal radial value (real world)
45  Double_t fRwrmax; ///< Maximal radial value (real world)
46  Double_t fRwtmin; ///< Minimal angular value (real world)
47  Double_t fRwtmax; ///< Minimal angular value (real world)
48  Double_t fTickpolarSize; ///< Set size of Tickmarks
49 
50  Font_t fPolarLabelFont; ///< Set font of angular labels
51  Font_t fRadialLabelFont; ///< Set font of radial labels
52 
53  Int_t fCutRadial; ///< if fCutRadial = 0, circles are cut by radial axis
54  ///< if fCutRadial = 1, circles are not cut
55  Int_t fNdivRad; ///< Number of radial divisions
56  Int_t fNdivPol; ///< Number of polar divisions
57 
58  TString* fPolarLabels; ///<! [fNdivPol] Specified polar labels
59 
60  void Paint(Option_t* options="");
61  void PaintRadialDivisions(Bool_t drawaxis);
62  void PaintPolarDivisions(Bool_t noLabels);
63  void ReduceFraction(Int_t Num, Int_t Denom, Int_t &rnum, Int_t &rden);
64  void Init();
65  Int_t FindAlign(Double_t angle);
67 
68 public:
69  // TGraphPolarGram status bits
70  enum { kLabelOrtho = BIT(14)
71  };
72 
73  TGraphPolargram(const char* name, Double_t rmin, Double_t rmax,
74  Double_t tmin, Double_t tmax);
75  TGraphPolargram(const char* name="");
76  virtual ~TGraphPolargram();
77 
80 
86  Double_t GetRMin() { return fRwrmin;};
87  Double_t GetRMax() { return fRwrmax;};
89  Double_t GetTMin() { return fRwtmin;};
90  Double_t GetTMax() { return fRwtmax;};
91 
94 
96  Int_t GetNdivPolar() { return fNdivPol;};
98 
99  Bool_t IsDegree() {return fDegree;};
100  Bool_t IsRadian() {return fRadian;};
101  Bool_t IsGrad() {return fGrad;};
102 
103  void ChangeRangePolar(Double_t tmin, Double_t tmax);
104  void Draw(Option_t* options="");
105  void ExecuteEvent(Int_t event, Int_t px, Int_t py);
107  Double_t phimin, Double_t phimax, Double_t theta);
108  void SetAxisAngle(Double_t angle = 0); //*MENU*
109  void SetNdivPolar(Int_t Ndiv = 508); //*MENU*
110  void SetNdivRadial(Int_t Ndiv = 508); //*MENU*
111  void SetPolarLabel(Int_t div, const TString & label);
112  void SetPolarLabelSize(Double_t angularsize = 0.04); //*MENU*
113  void SetPolarLabelColor(Color_t tcolorangular = 1); //*MENU*
114  void SetPolarLabelFont(Font_t tfontangular = 62); //*MENU*
115  void SetPolarOffset(Double_t PolarOffset=0.04); //*MENU*
116  void SetRadialOffset(Double_t RadialOffset=0.025); //*MENU*
117  void SetRadialLabelSize (Double_t radialsize = 0.035); //*MENU*
118  void SetRadialLabelColor(Color_t tcolorradial = 1); //*MENU*
119  void SetRadialLabelFont(Font_t tfontradial = 62); //*MENU*
120  void SetRangePolar(Double_t tmin, Double_t tmax); //*MENU*
121  void SetRangeRadial(Double_t rmin, Double_t rmax); //*MENU*
122  void SetTickpolarSize(Double_t tickpolarsize = 0.02); //*MENU*
123  void SetToDegree(); //*MENU*
124  void SetToGrad(); //*MENU*
125  void SetToRadian(); //*MENU*
126  void SetTwoPi();
127 
128  ClassDef(TGraphPolargram,1); // Polar axis
129 };
130 
131 #endif
void SetToRadian()
The Polar circle is labelled using radian.
void SetTickpolarSize(Double_t tickpolarsize=0.02)
Set polar ticks size.
Font_t fPolarLabelFont
Set font of angular labels.
void SetTwoPi()
Set range from 0 to 2*pi.
Color_t fPolarLabelColor
Set color of the angular labels.
Double_t fPolarOffset
Offset for Polar labels.
void Init()
Initialize some of the fields of TGraphPolargram.
void SetRadialLabelSize(Double_t radialsize=0.035)
Set radial labels size.
Double_t GetRMin()
const char Option_t
Definition: RtypesCore.h:62
void PaintCircle(Double_t x, Double_t y, Double_t r, Double_t phimin, Double_t phimax, Double_t theta)
This is simplified from TEllipse::PaintEllipse.
void SetToDegree()
The Polar circle is labelled using degree.
#define BIT(n)
Definition: Rtypes.h:120
void Draw(Option_t *options="")
Draw Polargram.
Double_t fTickpolarSize
Set size of Tickmarks.
Double_t GetPolarLabelSize()
Double_t GetRadialOffset()
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Double_t fRadialTextSize
Double_t fRwrmax
Maximal radial value (real world)
short Font_t
Definition: RtypesCore.h:75
Int_t fNdivPol
Number of polar divisions.
Int_t FindAlign(Double_t angle)
Find the alignement rule to apply for TText::SetTextAlign(Short_t).
Double_t fRadialOffset
Offset for radial labels.
void ChangeRangePolar(Double_t tmin, Double_t tmax)
Set the Polar range.
Double_t GetTMin()
void SetRadialLabelFont(Font_t tfontradial=62)
Set radial label font.
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Indicate that there is something to click here.
void Paint(Option_t *options="")
Paint TGraphPolargram.
Int_t fCutRadial
if fCutRadial = 0, circles are cut by radial axis if fCutRadial = 1, circles are not cut ...
Double_t GetPolarOffset()
void PaintPolarDivisions(Bool_t noLabels)
Draw Polar divisions.
void SetPolarOffset(Double_t PolarOffset=0.04)
Set the labels offset.
void SetNdivRadial(Int_t Ndiv=508)
Set the number of radial divisions: enter a number ij with 0<i<99 and 0<j<99.
void SetAxisAngle(Double_t angle=0)
Set axis angle.
TGraphPolargram(const char *name, Double_t rmin, Double_t rmax, Double_t tmin, Double_t tmax)
TGraphPolargram Constructor.
short Color_t
Definition: RtypesCore.h:79
Color_t fRadialLabelColor
Set color of the radial labels.
Int_t fNdivRad
Number of radial divisions.
TRandom2 r(17)
void PaintRadialDivisions(Bool_t drawaxis)
Paint radial divisions.
void SetRangeRadial(Double_t rmin, Double_t rmax)
Set the radial range.
Double_t GetTickpolarSize()
void ReduceFraction(Int_t Num, Int_t Denom, Int_t &rnum, Int_t &rden)
Reduce fractions.
Text Attributes class.
Definition: TAttText.h:24
To draw polar axis.
Font_t GetPolarLabelFont()
Double_t fRwtmin
Minimal angular value (real world)
Double_t GetTMax()
void SetPolarLabelSize(Double_t angularsize=0.04)
Set angular labels size.
Double_t fPolarTextSize
Set Polar text size.
virtual ~TGraphPolargram()
TGraphPolargram destructor.
void SetPolarLabel(Int_t div, const TString &label)
Set some specified polar labels, used in the case of a spider plot.
TString * fPolarLabels
! [fNdivPol] Specified polar labels
Double_t fRwtmax
Minimal angular value (real world)
double Double_t
Definition: RtypesCore.h:55
Double_t fAxisAngle
Set angle of the radial axis.
Double_t y[n]
Definition: legend1.C:17
Double_t GetRMax()
Double_t fRwrmin
Minimal radial value (real world)
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Everything within the circle belongs to the TGraphPolargram.
void SetToGrad()
The Polar circle is labelled using gradian.
void SetNdivPolar(Int_t Ndiv=508)
Set the number of Polar divisions: enter a number ij with 0<i<99 and 0<j<99.
void SetPolarLabelColor(Color_t tcolorangular=1)
Set Polar labels color.
Color_t GetRadialColorLabel()
Font_t fRadialLabelFont
Set font of radial labels.
void SetRadialOffset(Double_t RadialOffset=0.025)
Set the labels offset.
Color_t GetPolarColorLabel()
Line Attributes class.
Definition: TAttLine.h:24
void SetRangePolar(Double_t tmin, Double_t tmax)
Allows to change range Polar.
void SetRadialLabelColor(Color_t tcolorradial=1)
Set radial labels color.
Double_t FindTextAngle(Double_t theta)
Determine the orientation of the polar labels according to their angle.
char name[80]
Definition: TGX11.cxx:109
Font_t GetRadialLabelFont()
Double_t GetRadialLabelSize()
Double_t GetAngle()
void SetPolarLabelFont(Font_t tfontangular=62)