Logo ROOT  
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 #include "TAttText.h"
16 #include "TAttLine.h"
17 #include "TNamed.h"
18 
19 
20 class TGraphPolargram: public TNamed, public TAttText, public TAttLine {
21 
22 private:
25  Bool_t fGrad;
26 
27  Color_t fPolarLabelColor; ///< Set color of the angular labels
28  Color_t fRadialLabelColor; ///< Set color of the radial labels
29 
30  Double_t fAxisAngle; ///< Set angle of the radial axis
31  Double_t fPolarOffset; ///< Offset for Polar labels
32  Double_t fPolarTextSize; ///< Set Polar text size
33  Double_t fRadialOffset; ///< Offset for radial labels
35  Double_t fRwrmin; ///< Minimal radial value (real world)
36  Double_t fRwrmax; ///< Maximal radial value (real world)
37  Double_t fRwtmin; ///< Minimal angular value (real world)
38  Double_t fRwtmax; ///< Minimal angular value (real world)
39  Double_t fTickpolarSize; ///< Set size of Tickmarks
40 
41  Font_t fPolarLabelFont; ///< Set font of angular labels
42  Font_t fRadialLabelFont; ///< Set font of radial labels
43 
44  Int_t fCutRadial; ///< if fCutRadial = 0, circles are cut by radial axis
45  ///< if fCutRadial = 1, circles are not cut
46  Int_t fNdivRad; ///< Number of radial divisions
47  Int_t fNdivPol; ///< Number of polar divisions
48 
49  TString* fPolarLabels; ///<! [fNdivPol] Specified polar labels
50 
51  void Paint(Option_t* options="");
52  void PaintRadialDivisions(Bool_t drawaxis);
53  void PaintPolarDivisions(Bool_t noLabels);
54  void ReduceFraction(Int_t Num, Int_t Denom, Int_t &rnum, Int_t &rden);
55  void Init();
56  Int_t FindAlign(Double_t angle);
58 
59 public:
60  // TGraphPolarGram status bits
61  enum { kLabelOrtho = BIT(14)
62  };
63 
64  TGraphPolargram(const char* name, Double_t rmin, Double_t rmax,
65  Double_t tmin, Double_t tmax);
66  TGraphPolargram(const char* name="");
67  virtual ~TGraphPolargram();
68 
71 
72  Double_t GetAngle() { return fAxisAngle;};
74  Double_t GetPolarOffset() { return fPolarOffset; };
77  Double_t GetRMin() { return fRwrmin;};
78  Double_t GetRMax() { return fRwrmax;};
80  Double_t GetTMin() { return fRwtmin;};
81  Double_t GetTMax() { return fRwtmax;};
82 
85 
87  Int_t GetNdivPolar() { return fNdivPol;};
88  Int_t GetNdivRadial() { return fNdivRad;};
89 
90  Bool_t IsDegree() {return fDegree;};
91  Bool_t IsRadian() {return fRadian;};
92  Bool_t IsGrad() {return fGrad;};
93 
95  void Draw(Option_t* options="");
96  void ExecuteEvent(Int_t event, Int_t px, Int_t py);
98  Double_t phimin, Double_t phimax, Double_t theta);
99  void SetAxisAngle(Double_t angle = 0); //*MENU*
100  void SetNdivPolar(Int_t Ndiv = 508); //*MENU*
101  void SetNdivRadial(Int_t Ndiv = 508); //*MENU*
102  void SetPolarLabel(Int_t div, const TString & label);
103  void SetPolarLabelSize(Double_t angularsize = 0.04); //*MENU*
104  void SetPolarLabelColor(Color_t tcolorangular = 1); //*MENU*
105  void SetPolarLabelFont(Font_t tfontangular = 62); //*MENU*
106  void SetPolarOffset(Double_t PolarOffset=0.04); //*MENU*
107  void SetRadialOffset(Double_t RadialOffset=0.025); //*MENU*
108  void SetRadialLabelSize (Double_t radialsize = 0.035); //*MENU*
109  void SetRadialLabelColor(Color_t tcolorradial = 1); //*MENU*
110  void SetRadialLabelFont(Font_t tfontradial = 62); //*MENU*
111  void SetRangePolar(Double_t tmin, Double_t tmax); //*MENU*
112  void SetRangeRadial(Double_t rmin, Double_t rmax); //*MENU*
113  void SetTickpolarSize(Double_t tickpolarsize = 0.02); //*MENU*
114  void SetToDegree(); //*MENU*
115  void SetToGrad(); //*MENU*
116  void SetToRadian(); //*MENU*
117  void SetTwoPi();
118 
119  ClassDef(TGraphPolargram,1); // Polar axis
120 };
121 
122 #endif
TAttText
Definition: TAttText.h:18
TGraphPolargram::SetRangeRadial
void SetRangeRadial(Double_t rmin, Double_t rmax)
Set the radial range.
Definition: TGraphPolargram.cxx:892
TGraphPolargram::PaintRadialDivisions
void PaintRadialDivisions(Bool_t drawaxis)
Paint radial divisions.
Definition: TGraphPolargram.cxx:624
TGraphPolargram::GetNdivPolar
Int_t GetNdivPolar()
Definition: TGraphPolargram.h:93
TGraphPolargram::SetToGrad
void SetToGrad()
The Polar circle is labelled using gradian.
Definition: TGraphPolargram.cxx:923
TGraphPolargram::GetRMax
Double_t GetRMax()
Definition: TGraphPolargram.h:84
TGraphPolargram::ExecuteEvent
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Indicate that there is something to click here.
Definition: TGraphPolargram.cxx:190
TGraphPolargram::fTickpolarSize
Double_t fTickpolarSize
Set size of Tickmarks.
Definition: TGraphPolargram.h:45
TGraphPolargram::GetPolarLabelSize
Double_t GetPolarLabelSize()
Definition: TGraphPolargram.h:79
TGraphPolargram::GetPolarLabelFont
Font_t GetPolarLabelFont()
Definition: TGraphPolargram.h:89
TGraphPolargram::PaintPolarDivisions
void PaintPolarDivisions(Bool_t noLabels)
Draw Polar divisions.
Definition: TGraphPolargram.cxx:405
TGraphPolargram::GetRMin
Double_t GetRMin()
Definition: TGraphPolargram.h:83
TAttText.h
TGraphPolargram::SetPolarLabelColor
void SetPolarLabelColor(Color_t tcolorangular=1)
Set Polar labels color.
Definition: TGraphPolargram.cxx:805
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TNamed.h
TGraphPolargram::fRwtmax
Double_t fRwtmax
Minimal angular value (real world)
Definition: TGraphPolargram.h:44
TGraphPolargram::fDegree
Bool_t fDegree
Definition: TGraphPolargram.h:30
TGraphPolargram::fGrad
Bool_t fGrad
Definition: TGraphPolargram.h:31
TGraphPolargram::fRadialLabelFont
Font_t fRadialLabelFont
Set font of radial labels.
Definition: TGraphPolargram.h:48
TGraphPolargram::SetRadialOffset
void SetRadialOffset(Double_t RadialOffset=0.025)
Set the labels offset.
Definition: TGraphPolargram.cxx:863
Int_t
int Int_t
Definition: RtypesCore.h:45
TGraphPolargram::fRadialOffset
Double_t fRadialOffset
Offset for radial labels.
Definition: TGraphPolargram.h:39
Font_t
short Font_t
Definition: RtypesCore.h:79
TGraphPolargram::SetRadialLabelColor
void SetRadialLabelColor(Color_t tcolorradial=1)
Set radial labels color.
Definition: TGraphPolargram.cxx:839
x
Double_t x[n]
Definition: legend1.C:17
TGraphPolargram::GetAngle
Double_t GetAngle()
Definition: TGraphPolargram.h:78
TGraphPolargram::SetTickpolarSize
void SetTickpolarSize(Double_t tickpolarsize=0.02)
Set polar ticks size.
Definition: TGraphPolargram.cxx:904
TGraphPolargram::SetNdivPolar
void SetNdivPolar(Int_t Ndiv=508)
Set the number of Polar divisions: enter a number ij with 0<i<99 and 0<j<99.
Definition: TGraphPolargram.cxx:773
TString
Definition: TString.h:136
TGraphPolargram::SetToRadian
void SetToRadian()
The Polar circle is labelled using radian.
Definition: TGraphPolargram.cxx:934
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
Color_t
short Color_t
Definition: RtypesCore.h:83
TGraphPolargram::SetRadialLabelSize
void SetRadialLabelSize(Double_t radialsize=0.035)
Set radial labels size.
Definition: TGraphPolargram.cxx:855
TGraphPolargram::fPolarTextSize
Double_t fPolarTextSize
Set Polar text size.
Definition: TGraphPolargram.h:38
TGraphPolargram::SetPolarOffset
void SetPolarOffset(Double_t PolarOffset=0.04)
Set the labels offset.
Definition: TGraphPolargram.cxx:830
bool
TGraphPolargram::SetNdivRadial
void SetNdivRadial(Int_t Ndiv=508)
Set the number of radial divisions: enter a number ij with 0<i<99 and 0<j<99.
Definition: TGraphPolargram.cxx:785
TGraphPolargram::SetPolarLabel
void SetPolarLabel(Int_t div, const TString &label)
Set some specified polar labels, used in the case of a spider plot.
Definition: TGraphPolargram.cxx:794
TAttLine.h
TGraphPolargram::GetPolarColorLabel
Color_t GetPolarColorLabel()
Definition: TGraphPolargram.h:75
TGraphPolargram::SetRangePolar
void SetRangePolar(Double_t tmin, Double_t tmax)
Allows to change range Polar.
Definition: TGraphPolargram.cxx:874
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TGraphPolargram::FindTextAngle
Double_t FindTextAngle(Double_t theta)
Determine the orientation of the polar labels according to their angle.
Definition: TGraphPolargram.cxx:306
TGraphPolargram::GetRadialLabelFont
Font_t GetRadialLabelFont()
Definition: TGraphPolargram.h:90
TGraphPolargram::IsGrad
Bool_t IsGrad()
Definition: TGraphPolargram.h:98
TGraphPolargram::GetRadialLabelSize
Double_t GetRadialLabelSize()
Definition: TGraphPolargram.h:81
TGraphPolargram::fRwrmin
Double_t fRwrmin
Minimal radial value (real world)
Definition: TGraphPolargram.h:41
TGraphPolargram::DistancetoPrimitive
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Everything within the circle belongs to the TGraphPolargram.
Definition: TGraphPolargram.cxx:112
TAttLine
Definition: TAttLine.h:18
TGraphPolargram::GetRadialOffset
Double_t GetRadialOffset()
Definition: TGraphPolargram.h:82
TGraphPolargram::fNdivPol
Int_t fNdivPol
Number of polar divisions.
Definition: TGraphPolargram.h:53
TNamed
Definition: TNamed.h:29
TGraphPolargram::fPolarLabelColor
Color_t fPolarLabelColor
Set color of the angular labels.
Definition: TGraphPolargram.h:33
TGraphPolargram::Init
void Init()
Initialize some of the fields of TGraphPolargram.
Definition: TGraphPolargram.cxx:326
TGraphPolargram::GetTMin
Double_t GetTMin()
Definition: TGraphPolargram.h:86
TGraphPolargram::~TGraphPolargram
virtual ~TGraphPolargram()
TGraphPolargram destructor.
Definition: TGraphPolargram.cxx:90
TGraphPolargram::IsRadian
Bool_t IsRadian()
Definition: TGraphPolargram.h:97
BIT
#define BIT(n)
Definition: Rtypes.h:85
y
Double_t y[n]
Definition: legend1.C:17
TGraphPolargram::PaintCircle
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.
Definition: TGraphPolargram.cxx:372
TGraphPolargram::IsDegree
Bool_t IsDegree()
Definition: TGraphPolargram.h:96
TGraphPolargram::Draw
void Draw(Option_t *options="")
Draw Polargram.
Definition: TGraphPolargram.cxx:181
TGraphPolargram::SetPolarLabelFont
void SetPolarLabelFont(Font_t tfontangular=62)
Definition: TGraphPolargram.cxx:812
TGraphPolargram::fCutRadial
Int_t fCutRadial
if fCutRadial = 0, circles are cut by radial axis if fCutRadial = 1, circles are not cut
Definition: TGraphPolargram.h:50
Double_t
double Double_t
Definition: RtypesCore.h:59
TGraphPolargram::fRadialLabelColor
Color_t fRadialLabelColor
Set color of the radial labels.
Definition: TGraphPolargram.h:34
TGraphPolargram::fRadialTextSize
Double_t fRadialTextSize
Definition: TGraphPolargram.h:40
TGraphPolargram::fPolarLabels
TString * fPolarLabels
! [fNdivPol] Specified polar labels
Definition: TGraphPolargram.h:55
TGraphPolargram::kLabelOrtho
@ kLabelOrtho
Definition: TGraphPolargram.h:67
TGraphPolargram::SetAxisAngle
void SetAxisAngle(Double_t angle=0)
Set axis angle.
Definition: TGraphPolargram.cxx:763
TGraphPolargram
Definition: TGraphPolargram.h:20
TGraphPolargram::GetNdivRadial
Int_t GetNdivRadial()
Definition: TGraphPolargram.h:94
TGraphPolargram::fPolarLabelFont
Font_t fPolarLabelFont
Set font of angular labels.
Definition: TGraphPolargram.h:47
TGraphPolargram::fPolarOffset
Double_t fPolarOffset
Offset for Polar labels.
Definition: TGraphPolargram.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGraphPolargram::fAxisAngle
Double_t fAxisAngle
Set angle of the radial axis.
Definition: TGraphPolargram.h:36
TGraphPolargram::FindAlign
Int_t FindAlign(Double_t angle)
Find the alignement rule to apply for TText::SetTextAlign(Short_t).
Definition: TGraphPolargram.cxx:276
TGraphPolargram::fNdivRad
Int_t fNdivRad
Number of radial divisions.
Definition: TGraphPolargram.h:52
TGraphPolargram::ChangeRangePolar
void ChangeRangePolar(Double_t tmin, Double_t tmax)
Set the Polar range.
Definition: TGraphPolargram.cxx:100
name
char name[80]
Definition: TGX11.cxx:110
TGraphPolargram::SetToDegree
void SetToDegree()
The Polar circle is labelled using degree.
Definition: TGraphPolargram.cxx:912
TGraphPolargram::SetRadialLabelFont
void SetRadialLabelFont(Font_t tfontradial=62)
Set radial label font.
Definition: TGraphPolargram.cxx:847
TGraphPolargram::ReduceFraction
void ReduceFraction(Int_t Num, Int_t Denom, Int_t &rnum, Int_t &rden)
Reduce fractions.
Definition: TGraphPolargram.cxx:737
TGraphPolargram::GetRadialColorLabel
Color_t GetRadialColorLabel()
Definition: TGraphPolargram.h:76
TGraphPolargram::GetTickpolarSize
Double_t GetTickpolarSize()
Definition: TGraphPolargram.h:85
TGraphPolargram::fRadian
Bool_t fRadian
Definition: TGraphPolargram.h:29
TGraphPolargram::GetTMax
Double_t GetTMax()
Definition: TGraphPolargram.h:87
TGraphPolargram::GetPolarOffset
Double_t GetPolarOffset()
Definition: TGraphPolargram.h:80
TGraphPolargram::Paint
void Paint(Option_t *options="")
Paint TGraphPolargram.
Definition: TGraphPolargram.cxx:348
TGraphPolargram::fRwtmin
Double_t fRwtmin
Minimal angular value (real world)
Definition: TGraphPolargram.h:43
TGraphPolargram::SetPolarLabelSize
void SetPolarLabelSize(Double_t angularsize=0.04)
Set angular labels size.
Definition: TGraphPolargram.cxx:822
TGraphPolargram::fRwrmax
Double_t fRwrmax
Maximal radial value (real world)
Definition: TGraphPolargram.h:42
TGraphPolargram::TGraphPolargram
TGraphPolargram(const char *name, Double_t rmin, Double_t rmax, Double_t tmin, Double_t tmax)
TGraphPolargram Constructor.
Definition: TGraphPolargram.cxx:57
TGraphPolargram::SetTwoPi
void SetTwoPi()
Set range from 0 to 2*pi.
Definition: TGraphPolargram.cxx:945
int