Warning, file /include/root/TPie.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TPie
0013 #define ROOT_TPie
0014
0015 #include <TNamed.h>
0016 #include <TAttText.h>
0017 #include <TString.h>
0018
0019 class TH1;
0020 class TPieSlice;
0021 class TLegend;
0022
0023 class TPie : public TNamed , public TAttText {
0024 private:
0025 void Init(Int_t np, Double_t ao, Double_t x, Double_t y, Double_t r);
0026 void DrawGhost();
0027
0028 Float_t fSum;
0029 Float_t *fSlices{nullptr};
0030 TLegend *fLegend{nullptr};
0031
0032 protected:
0033 Double_t fX;
0034 Double_t fY;
0035 Double_t fRadius;
0036 Double_t fAngularOffset;
0037 Float_t fLabelsOffset;
0038 TString fLabelFormat;
0039 TString fValueFormat;
0040 TString fFractionFormat;
0041 TString fPercentFormat;
0042 Int_t fNvals;
0043 TPieSlice **fPieSlices{nullptr};
0044 Bool_t fIs3D;
0045 Double_t fHeight;
0046 Float_t fAngle3D;
0047
0048 public:
0049 TPie();
0050 TPie(const char *,const char *, Int_t);
0051 TPie(const char *,const char *, Int_t, Double_t *, Int_t *cols = nullptr, const char *lbls[] = nullptr);
0052 TPie(const char *,const char *, Int_t, Float_t *, Int_t *cols = nullptr, const char *lbls[] = nullptr);
0053 TPie(const TH1 *h);
0054 TPie(const TPie&);
0055 ~TPie() override;
0056
0057 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0058 Int_t DistancetoSlice(Int_t,Int_t);
0059 void Draw(Option_t *option="l") override;
0060 void ExecuteEvent(Int_t,Int_t,Int_t) override;
0061 Float_t GetAngle3D() { return fAngle3D; }
0062 Double_t GetAngularOffset() { return fAngularOffset; }
0063 Int_t GetEntryFillColor(Int_t);
0064 Int_t GetEntryFillStyle(Int_t);
0065 const char* GetEntryLabel(Int_t);
0066 Int_t GetEntryLineColor(Int_t);
0067 Int_t GetEntryLineStyle(Int_t);
0068 Int_t GetEntryLineWidth(Int_t);
0069 Double_t GetEntryRadiusOffset(Int_t);
0070 Double_t GetEntryVal(Int_t);
0071 const char *GetFractionFormat() { return fFractionFormat.Data(); }
0072 Double_t GetHeight() { return fHeight; }
0073 const char *GetLabelFormat() { return fLabelFormat.Data(); }
0074 Float_t GetLabelsOffset() { return fLabelsOffset; }
0075 TLegend *GetLegend();
0076 Int_t GetEntries() { return fNvals; }
0077 const char *GetPercentFormat() { return fPercentFormat.Data(); }
0078 Double_t GetRadius() { return fRadius;}
0079 TPieSlice *GetSlice(Int_t i);
0080 const char *GetValueFormat() { return fValueFormat.Data(); }
0081 Double_t GetX() { return fX; }
0082 Double_t GetY() { return fY; }
0083 TLegend *MakeLegend(Double_t x1=.65,Double_t y1=.65,Double_t x2=.95, Double_t y2=.95, const char *leg_header="");
0084 void MakeSlices(Bool_t force=kFALSE);
0085 void Paint(Option_t *) override;
0086 void SavePrimitive(std::ostream &out, Option_t *opts="") override;
0087 void SetAngle3D(Float_t val = 30.);
0088 void SetAngularOffset(Double_t);
0089 void SetCircle(Double_t x=.5, Double_t y=.5, Double_t rad=.4);
0090 void SetEntryLabel(Int_t, const char *text="Slice");
0091 void SetEntryLineColor(Int_t, Int_t);
0092 void SetEntryLineStyle(Int_t, Int_t);
0093 void SetEntryLineWidth(Int_t, Int_t);
0094 void SetEntryFillColor(Int_t, Int_t);
0095 void SetEntryFillStyle(Int_t, Int_t);
0096 void SetEntryRadiusOffset(Int_t, Double_t);
0097 void SetEntryVal(Int_t, Double_t);
0098 void SetFillColors(Int_t*);
0099 void SetFractionFormat(const char*);
0100 void SetHeight(Double_t val=.08);
0101 void SetLabelFormat(const char *);
0102 void SetLabels(const char *[]);
0103 void SetLabelsOffset(Float_t);
0104 void SetPercentFormat(const char *);
0105 void SetRadius(Double_t);
0106 void SetValueFormat(const char *);
0107 void SetX(Double_t);
0108 void SetY(Double_t);
0109 void SortSlices(Bool_t amode=kTRUE,Float_t merge_thresold=.0);
0110
0111 ClassDefOverride(TPie,1)
0112 };
0113
0114 #endif