ROOT  6.06/09
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 // //
30 // TGraphPolargramgram //
31 // //
32 // Creates the polar coordinate system //
33 // //
34 //////////////////////////////////////////////////////////////////////////
35 
36 class TGraphPolargram: public TNamed, public TAttText, public TAttLine {
37 
38 private:
42 
43  Color_t fPolarLabelColor; //Set color of the angular labels
44  Color_t fRadialLabelColor; //Set color of the radial labels
45 
46  Double_t fAxisAngle; //Set angle of the radial axis
47  Double_t fPolarOffset; //Offset for Polar labels
48  Double_t fPolarTextSize; //Set Polar text size
49  Double_t fRadialOffset; //Offset for radial labels
51  Double_t fRwrmin; //Minimal radial value (real world)
52  Double_t fRwrmax; //Maximal radial value (real world)
53  Double_t fRwtmin; //Minimal angular value (real world)
54  Double_t fRwtmax; //Minimal angular value (real world)
55  Double_t fTickpolarSize; //Set size of Tickmarks
56 
57  Font_t fPolarLabelFont; //Set font of angular labels
58  Font_t fRadialLabelFont; //Set font of radial labels
59 
60  Int_t fCutRadial; //if fCutRadial = 0, circles are cut by radial axis
61  //if fCutRadial = 1, circles are not cut
62  Int_t fNdivRad; //Number of radial divisions
63  Int_t fNdivPol; //Number of polar divisions
64 
65  TString* fPolarLabels; //![fNdivPol] Specified polar labels
66 
67  void Paint(Option_t* options="");
68  void PaintRadialDivisions(Bool_t drawaxis);
69  void PaintPolarDivisions(Bool_t noLabels);
70  void ReduceFraction(Int_t Num, Int_t Denom, Int_t &rnum, Int_t &rden);
71  void Init();
72  Int_t FindAlign(Double_t angle);
74 
75 public:
76  // TGraphPolarGram status bits
77  enum { kLabelOrtho = BIT(14)
78  };
79 
80  TGraphPolargram(const char* name, Double_t rmin, Double_t rmax,
81  Double_t tmin, Double_t tmax);
82  TGraphPolargram(const char* name="");
83  virtual ~TGraphPolargram();
84 
87 
93  Double_t GetRMin() { return fRwrmin;};
94  Double_t GetRMax() { return fRwrmax;};
96  Double_t GetTMin() { return fRwtmin;};
97  Double_t GetTMax() { return fRwtmax;};
98 
101 
105 
106  Bool_t IsDegree() {return fDegree;};
107  Bool_t IsRadian() {return fRadian;};
108  Bool_t IsGrad() {return fGrad;};
109 
110  void ChangeRangePolar(Double_t tmin, Double_t tmax);
111  void Draw(Option_t* options="");
112  void ExecuteEvent(Int_t event, Int_t px, Int_t py);
114  Double_t phimin, Double_t phimax, Double_t theta);
115  void SetAxisAngle(Double_t angle = 0); //*MENU*
116  void SetNdivPolar(Int_t Ndiv = 508); //*MENU*
117  void SetNdivRadial(Int_t Ndiv = 508); //*MENU*
118  void SetPolarLabel(Int_t div, const TString & label);
119  void SetPolarLabelSize(Double_t angularsize = 0.04); //*MENU*
120  void SetPolarLabelColor(Color_t tcolorangular = 1); //*MENU*
121  void SetPolarLabelFont(Font_t tfontangular = 62); //*MENU*
122  void SetPolarOffset(Double_t PolarOffset=0.04); //*MENU*
123  void SetRadialOffset(Double_t RadialOffset=0.025); //*MENU*
124  void SetRadialLabelSize (Double_t radialsize = 0.035); //*MENU*
125  void SetRadialLabelColor(Color_t tcolorradial = 1); //*MENU*
126  void SetRadialLabelFont(Font_t tfontradial = 62); //*MENU*
127  void SetRangePolar(Double_t tmin, Double_t tmax); //*MENU*
128  void SetRangeRadial(Double_t rmin, Double_t rmax); //*MENU*
129  void SetTickpolarSize(Double_t tickpolarsize = 0.02); //*MENU*
130  void SetToDegree(); //*MENU*
131  void SetToGrad(); //*MENU*
132  void SetToRadian(); //*MENU*
133  void SetTwoPi();
134 
135  ClassDef(TGraphPolargram,1); // Polar axis
136 };
137 
138 #endif
void SetToRadian()
The Polar circle is labelled using radian.
void SetTickpolarSize(Double_t tickpolarsize=0.02)
Set polar ticks size.
void SetTwoPi()
Set range from 0 to 2*pi.
Color_t fPolarLabelColor
Double_t fPolarOffset
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.
ClassDef(TGraphPolargram, 1)
Double_t fTickpolarSize
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
short Font_t
Definition: RtypesCore.h:75
Int_t FindAlign(Double_t angle)
Find the alignement rule to apply for TText::SetTextAlign(Short_t).
Double_t fRadialOffset
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
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="")
[fNdivPol] Specified polar labels
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
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
ROOT::R::TRInterface & r
Definition: Object.C:4
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:32
To draw polar axis.
Font_t GetPolarLabelFont()
Double_t GetTMax()
void SetPolarLabelSize(Double_t angularsize=0.04)
Set angular labels size.
Double_t fPolarTextSize
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
double Double_t
Definition: RtypesCore.h:55
Double_t y[n]
Definition: legend1.C:17
Double_t GetRMax()
#define name(a, b)
Definition: linkTestLib0.cpp:5
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
void SetPolarLabelColor(Color_t tcolorangular=1)
Set Polar labels color.
Color_t GetRadialColorLabel()
void SetRadialOffset(Double_t RadialOffset=0.025)
Set the labels offset.
Color_t GetPolarColorLabel()
Line Attributes class.
Definition: TAttLine.h:32
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.
Font_t GetRadialLabelFont()
Double_t GetRadialLabelSize()
Double_t GetAngle()
void SetPolarLabelFont(Font_t tfontangular=62)