TGraphPolargram.h

Go to the documentation of this file.
00001 // @(#)root/graf:$Id: TGraphPolargram.h 24706 2008-07-08 12:37:45Z brun $
00002 // Author: Sebastian Boser, 02/02/06
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
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 // TGraphPolargramgram                                                  //
00031 //                                                                      //
00032 // Creates the polar coordinate system                                  //
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;  //Set color of the angular labels
00044    Color_t  fRadialLabelColor; //Set color of the radial labels
00045 
00046    Double_t fAxisAngle;        //Set angle of the radial axis
00047    Double_t fPolarOffset;      //Offset for Polar labels
00048    Double_t fPolarTextSize;    //Set Polar text size
00049    Double_t fRadialOffset;     //Offset for radial labels
00050    Double_t fRadialTextSize;
00051    Double_t fRwrmin;           //Minimal radial value (real world)
00052    Double_t fRwrmax;           //Maximal radial value (real world)
00053    Double_t fRwtmin;           //Minimal angular value (real world)
00054    Double_t fRwtmax;           //Minimal angular value (real world)
00055    Double_t fTickpolarSize;    //Set size of Tickmarks
00056 
00057    Font_t   fPolarLabelFont;   //Set font of angular labels
00058    Font_t   fRadialLabelFont;  //Set font of radial labels
00059 
00060    Int_t    fCutRadial;        //if fCutRadial = 0, circles are cut by radial axis
00061                                //if fCutRadial = 1, circles are not cut
00062    Int_t    fNdivRad;          //Number of radial divisions
00063    Int_t    fNdivPol;          //Number of polar divisions
00064 
00065    TString* fPolarLabels;      //![fNdivPol] Specified polar labels
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    // TGraphPolarGram status bits
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); //*MENU*
00116    void     SetNdivPolar(Int_t Ndiv = 508); //*MENU*
00117    void     SetNdivRadial(Int_t Ndiv = 508); //*MENU*
00118    void     SetPolarLabel(Int_t div, const TString & label);
00119    void     SetPolarLabelSize(Double_t angularsize = 0.04); //*MENU*
00120    void     SetPolarLabelColor(Color_t tcolorangular = 1); //*MENU*
00121    void     SetPolarLabelFont(Font_t tfontangular = 62); //*MENU*
00122    void     SetPolarOffset(Double_t PolarOffset=0.04); //*MENU*
00123    void     SetRadialOffset(Double_t RadialOffset=0.025); //*MENU*
00124    void     SetRadialLabelSize (Double_t radialsize = 0.035); //*MENU*
00125    void     SetRadialLabelColor(Color_t tcolorradial = 1); //*MENU*
00126    void     SetRadialLabelFont(Font_t tfontradial = 62); //*MENU*
00127    void     SetRangePolar(Double_t tmin, Double_t tmax); //*MENU*
00128    void     SetRangeRadial(Double_t rmin, Double_t rmax); //*MENU*
00129    void     SetTickpolarSize(Double_t tickpolarsize = 0.02); //*MENU*
00130    void     SetToDegree(); //*MENU*
00131    void     SetToGrad(); //*MENU*
00132    void     SetToRadian(); //*MENU*
00133    void     SetTwoPi();
00134 
00135    ClassDef(TGraphPolargram,1); // Polar axis
00136 };
00137 
00138 #endif

Generated on Tue Jul 5 14:14:09 2011 for ROOT_528-00b_version by  doxygen 1.5.1