#ifndef ROOT_TPie
#define ROOT_TPie
#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TNamed
#include <TNamed.h>
#endif
#ifndef ROOT_TString
#include <TString.h>
#endif
#ifndef ROOT_TAttText
#include <TAttText.h>
#endif
class TH1;
class TPieSlice;
class TLegend;
class TPie : public TNamed , public TAttText {
private:
void Init(Int_t np, Double_t ao, Double_t x, Double_t y, Double_t r);
void DrawGhost();
Float_t fSum;
Float_t *fSlices;
TLegend *fLegend;
protected:
Double_t fX;
Double_t fY;
Double_t fRadius;
Double_t fAngularOffset;
Float_t fLabelsOffset;
TString fLabelFormat;
TString fValueFormat;
TString fFractionFormat;
TString fPercentFormat;
Int_t fNvals;
TPieSlice **fPieSlices;
Bool_t fIs3D;
Double_t fHeight;
Float_t fAngle3D;
public:
TPie();
TPie(const char *,const char *, Int_t);
TPie(const char *,const char *, Int_t, Double_t *,Int_t *cols=0, const char *lbls[]=0);
TPie(const char *,const char *, Int_t, Float_t *,Int_t *cols=0, const char *lbls[]=0);
TPie(const TH1 *h);
TPie(const TPie&);
~TPie();
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
Int_t DistancetoSlice(Int_t,Int_t);
virtual void Draw(Option_t *option="l");
virtual void ExecuteEvent(Int_t,Int_t,Int_t);
Float_t GetAngle3D() { return fAngle3D; }
Double_t GetAngularOffset() { return fAngularOffset; }
Int_t GetEntryFillColor(Int_t);
Int_t GetEntryFillStyle(Int_t);
const char* GetEntryLabel(Int_t);
Int_t GetEntryLineColor(Int_t);
Int_t GetEntryLineStyle(Int_t);
Int_t GetEntryLineWidth(Int_t);
Double_t GetEntryRadiusOffset(Int_t);
Double_t GetEntryVal(Int_t);
const char *GetFractionFormat() { return fFractionFormat.Data(); }
Double_t GetHeight() { return fHeight; }
const char *GetLabelFormat() { return fLabelFormat.Data(); }
Float_t GetLabelsOffset() { return fLabelsOffset; }
TLegend *GetLegend();
Int_t GetEntries() { return fNvals; }
const char *GetPercentFormat() { return fPercentFormat.Data(); }
Double_t GetRadius() { return fRadius;}
TPieSlice *GetSlice(Int_t i);
const char *GetValueFormat() { return fValueFormat.Data(); }
Double_t GetX() { return fX; }
Double_t GetY() { return fY; }
TLegend *MakeLegend(Double_t x1=.65,Double_t y1=.65,Double_t x2=.95, Double_t y2=.95, const char *leg_header="");
void MakeSlices(Bool_t force=kFALSE);
virtual void Paint(Option_t *);
void SavePrimitive(ostream &out, Option_t *opts="");
void SetAngle3D(Float_t val = 30.);
void SetAngularOffset(Double_t);
void SetCircle(Double_t x=.5, Double_t y=.5, Double_t rad=.4);
void SetEntryLabel(Int_t, const char *text="Slice");
void SetEntryLineColor(Int_t, Int_t);
void SetEntryLineStyle(Int_t, Int_t);
void SetEntryLineWidth(Int_t, Int_t);
void SetEntryFillColor(Int_t, Int_t);
void SetEntryFillStyle(Int_t, Int_t);
void SetEntryRadiusOffset(Int_t, Double_t);
void SetEntryVal(Int_t, Double_t);
void SetFillColors(Int_t*);
void SetFractionFormat(const char*);
void SetHeight(Double_t val=.08);
void SetLabelFormat(const char *);
void SetLabels(const char *[]);
void SetLabelsOffset(Float_t);
void SetPercentFormat(const char *);
void SetRadius(Double_t);
void SetValueFormat(const char *);
void SetX(Double_t);
void SetY(Double_t);
void SortSlices(Bool_t amode=kTRUE,Float_t merge_thresold=.0);
ClassDef(TPie,1)
};
#endif // ROOT_TPie