Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGraphPolargram.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/graf:$Id$
0002 // Author: Sebastian Boser, 02/02/06
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGraphPolargram
0013 #define ROOT_TGraphPolargram
0014 
0015 #include "TAttText.h"
0016 #include "TAttLine.h"
0017 #include "TNamed.h"
0018 
0019 
0020 class TGraphPolargram: public TNamed, public TAttText, public TAttLine {
0021 
0022 private:
0023    Bool_t   fRadian;
0024    Bool_t   fDegree;
0025    Bool_t   fGrad;
0026 
0027    Color_t  fPolarLabelColor;  ///< Set color of the angular labels
0028    Color_t  fRadialLabelColor; ///< Set color of the radial labels
0029 
0030    Double_t fAxisAngle;        ///< Set angle of the radial axis
0031    Double_t fPolarOffset;      ///< Offset for Polar labels
0032    Double_t fPolarTextSize;    ///< Set Polar text size
0033    Double_t fRadialOffset;     ///< Offset for radial labels
0034    Double_t fRadialTextSize;
0035    Double_t fRwrmin;           ///< Minimal radial value (real world)
0036    Double_t fRwrmax;           ///< Maximal radial value (real world)
0037    Double_t fRwtmin;           ///< Minimal angular value (real world)
0038    Double_t fRwtmax;           ///< Minimal angular value (real world)
0039    Double_t fTickpolarSize;    ///< Set size of Tickmarks
0040 
0041    Font_t   fPolarLabelFont;   ///< Set font of angular labels
0042    Font_t   fRadialLabelFont;  ///< Set font of radial labels
0043 
0044    Int_t    fCutRadial;        ///< if fCutRadial = 0, circles are cut by radial axis
0045                                ///< if fCutRadial = 1, circles are not cut
0046    Int_t    fNdivRad;          ///< Number of radial divisions
0047    Int_t    fNdivPol;          ///< Number of polar divisions
0048 
0049    TString* fPolarLabels;      ///<! [fNdivPol] Specified polar labels
0050 
0051    void Paint(Option_t* options="") override;
0052    void PaintRadialDivisions(Bool_t drawaxis);
0053    void PaintPolarDivisions(Bool_t noLabels);
0054    void ReduceFraction(Int_t Num, Int_t Denom, Int_t &rnum, Int_t &rden);
0055    void Init();
0056    Int_t FindAlign(Double_t angle);
0057    Double_t FindTextAngle(Double_t theta);
0058 
0059 public:
0060    // TGraphPolarGram status bits
0061    enum { kLabelOrtho    = BIT(14)
0062         };
0063 
0064    TGraphPolargram(const char* name, Double_t rmin, Double_t rmax,
0065                                      Double_t tmin, Double_t tmax);
0066    TGraphPolargram(const char* name="");
0067    ~TGraphPolargram() override;
0068 
0069    Color_t  GetPolarColorLabel() { return fPolarLabelColor;}
0070    Color_t  GetRadialColorLabel() { return fRadialLabelColor;}
0071 
0072    Double_t GetAngle() { return fAxisAngle;}
0073    Double_t GetPolarLabelSize() {return fPolarTextSize;}
0074    Double_t GetPolarOffset() { return fPolarOffset; }
0075    Double_t GetRadialLabelSize() {return fRadialTextSize; }
0076    Double_t GetRadialOffset() { return fRadialOffset; }
0077    Double_t GetRMin() { return fRwrmin; }
0078    Double_t GetRMax() { return fRwrmax; }
0079    Double_t GetTickpolarSize() {return fTickpolarSize; }
0080    Double_t GetTMin() { return fRwtmin; }
0081    Double_t GetTMax() { return fRwtmax; }
0082 
0083    Font_t   GetPolarLabelFont() { return fPolarLabelFont; }
0084    Font_t   GetRadialLabelFont() { return fRadialLabelFont; }
0085 
0086    Int_t    DistancetoPrimitive(Int_t px, Int_t py) override;
0087    Int_t    GetNdivPolar() { return fNdivPol; }
0088    Int_t    GetNdivRadial() { return fNdivRad; }
0089 
0090    Bool_t   IsDegree() {return fDegree; }
0091    Bool_t   IsRadian() {return fRadian; }
0092    Bool_t   IsGrad()   {return fGrad; }
0093 
0094    void     ChangeRangePolar(Double_t tmin, Double_t tmax);
0095    void     Draw(Option_t* options="") override;
0096    void     ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0097    void     PaintCircle(Double_t x, Double_t y, Double_t r,
0098                         Double_t phimin, Double_t phimax, Double_t theta);
0099    void     SetAxisAngle(Double_t angle = 0); //*MENU*
0100    void     SetNdivPolar(Int_t Ndiv = 508); //*MENU*
0101    void     SetNdivRadial(Int_t Ndiv = 508); //*MENU*
0102    void     SetPolarLabel(Int_t div, const TString & label);
0103    void     SetPolarLabelSize(Double_t angularsize = 0.04); //*MENU*
0104    void     SetPolarLabelColor(Color_t tcolorangular = 1); //*MENU*
0105    void     SetPolarLabelFont(Font_t tfontangular = 62); //*MENU*
0106    void     SetPolarOffset(Double_t PolarOffset=0.04); //*MENU*
0107    void     SetRadialOffset(Double_t RadialOffset=0.025); //*MENU*
0108    void     SetRadialLabelSize (Double_t radialsize = 0.035); //*MENU*
0109    void     SetRadialLabelColor(Color_t tcolorradial = 1); //*MENU*
0110    void     SetRadialLabelFont(Font_t tfontradial = 62); //*MENU*
0111    void     SetRangePolar(Double_t tmin, Double_t tmax); //*MENU*
0112    void     SetRangeRadial(Double_t rmin, Double_t rmax); //*MENU*
0113    void     SetTickpolarSize(Double_t tickpolarsize = 0.02); //*MENU*
0114    void     SetToDegree(); //*MENU*
0115    void     SetToGrad(); //*MENU*
0116    void     SetToRadian(); //*MENU*
0117    void     SetTwoPi();
0118 
0119    ClassDefOverride(TGraphPolargram,1); // Polar axis
0120 };
0121 
0122 #endif