00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGraphPolargram
00013 #define ROOT_TGraphPolargram
00014
00015 #ifndef ROOT_Riosfwd
00016 #include "Riosfwd.h"
00017 #endif
00018 #ifndef ROOT_TAttText
00019 #include "TAttText.h"
00020 #endif
00021 #ifndef ROOT_TAttLine
00022 #include "TAttLine.h"
00023 #endif
00024 #ifndef ROOT_TNamed
00025 #include "TNamed.h"
00026 #endif
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 class TGraphPolargram: public TNamed, public TAttText, public TAttLine {
00037
00038 private:
00039 Bool_t fRadian;
00040 Bool_t fDegree;
00041 Bool_t fGrad;
00042
00043 Color_t fPolarLabelColor;
00044 Color_t fRadialLabelColor;
00045
00046 Double_t fAxisAngle;
00047 Double_t fPolarOffset;
00048 Double_t fPolarTextSize;
00049 Double_t fRadialOffset;
00050 Double_t fRadialTextSize;
00051 Double_t fRwrmin;
00052 Double_t fRwrmax;
00053 Double_t fRwtmin;
00054 Double_t fRwtmax;
00055 Double_t fTickpolarSize;
00056
00057 Font_t fPolarLabelFont;
00058 Font_t fRadialLabelFont;
00059
00060 Int_t fCutRadial;
00061
00062 Int_t fNdivRad;
00063 Int_t fNdivPol;
00064
00065 TString* fPolarLabels;
00066
00067 void Paint(Option_t* options="");
00068 void PaintRadialDivisions(Bool_t drawaxis);
00069 void PaintPolarDivisions(Bool_t noLabels);
00070 void ReduceFraction(Int_t Num, Int_t Denom, Int_t &rnum, Int_t &rden);
00071 void Init();
00072 Int_t FindAlign(Double_t angle);
00073 Double_t FindTextAngle(Double_t theta);
00074
00075 public:
00076
00077 enum { kLabelOrtho = BIT(14)
00078 };
00079
00080 TGraphPolargram(const char* name, Double_t rmin, Double_t rmax,
00081 Double_t tmin, Double_t tmax);
00082 TGraphPolargram(const char* name="");
00083 virtual ~TGraphPolargram();
00084
00085 Color_t GetPolarColorLabel (){ return fPolarLabelColor;};
00086 Color_t GetRadialColorLabel (){ return fRadialLabelColor;};
00087
00088 Double_t GetAngle() { return fAxisAngle;};
00089 Double_t GetPolarLabelSize() {return fPolarTextSize;};
00090 Double_t GetPolarOffset() { return fPolarOffset; };
00091 Double_t GetRadialLabelSize() {return fRadialTextSize;};
00092 Double_t GetRadialOffset() { return fRadialOffset; };
00093 Double_t GetRMin() { return fRwrmin;};
00094 Double_t GetRMax() { return fRwrmax;};
00095 Double_t GetTickpolarSize() {return fTickpolarSize;};
00096 Double_t GetTMin() { return fRwtmin;};
00097 Double_t GetTMax() { return fRwtmax;};
00098
00099 Font_t GetPolarLabelFont() { return fPolarLabelFont;};
00100 Font_t GetRadialLabelFont() { return fRadialLabelFont;};
00101
00102 Int_t DistancetoPrimitive(Int_t px, Int_t py);
00103 Int_t GetNdivPolar() { return fNdivPol;};
00104 Int_t GetNdivRadial() { return fNdivRad;};
00105
00106 Bool_t IsDegree() {return fDegree;};
00107 Bool_t IsRadian() {return fRadian;};
00108 Bool_t IsGrad() {return fGrad;};
00109
00110 void ChangeRangePolar(Double_t tmin, Double_t tmax);
00111 void Draw(Option_t* options="");
00112 void ExecuteEvent(Int_t event, Int_t px, Int_t py);
00113 void PaintCircle(Double_t x, Double_t y, Double_t r,
00114 Double_t phimin, Double_t phimax, Double_t theta);
00115 void SetAxisAngle(Double_t angle = 0);
00116 void SetNdivPolar(Int_t Ndiv = 508);
00117 void SetNdivRadial(Int_t Ndiv = 508);
00118 void SetPolarLabel(Int_t div, const TString & label);
00119 void SetPolarLabelSize(Double_t angularsize = 0.04);
00120 void SetPolarLabelColor(Color_t tcolorangular = 1);
00121 void SetPolarLabelFont(Font_t tfontangular = 62);
00122 void SetPolarOffset(Double_t PolarOffset=0.04);
00123 void SetRadialOffset(Double_t RadialOffset=0.025);
00124 void SetRadialLabelSize (Double_t radialsize = 0.035);
00125 void SetRadialLabelColor(Color_t tcolorradial = 1);
00126 void SetRadialLabelFont(Font_t tfontradial = 62);
00127 void SetRangePolar(Double_t tmin, Double_t tmax);
00128 void SetRangeRadial(Double_t rmin, Double_t rmax);
00129 void SetTickpolarSize(Double_t tickpolarsize = 0.02);
00130 void SetToDegree();
00131 void SetToGrad();
00132 void SetToRadian();
00133 void SetTwoPi();
00134
00135 ClassDef(TGraphPolargram,1);
00136 };
00137
00138 #endif