ROOT  6.06/09
Reference Guide
TPaveStats.h
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Rene Brun 15/03/99
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 #ifndef ROOT_TPaveStats
12 #define ROOT_TPaveStats
13 
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TPaveStats //
18 // //
19 // a special TPaveText to draw histogram statistics //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #ifndef ROOT_TPaveText
24 #include "TPaveText.h"
25 #endif
26 
27 
28 class TPaveStats : public TPaveText {
29 
30 protected:
31  Int_t fOptFit; //option Fit
32  Int_t fOptStat; //option Stat
33  TString fFitFormat; //Printing format for fit parameters
34  TString fStatFormat; //Printing format for stats
35  TObject *fParent; //owner of this TPaveStats
36 
37 public:
38  TPaveStats();
39  TPaveStats(Double_t x1, Double_t y1,Double_t x2 ,Double_t y2, Option_t *option="br");
40  virtual ~TPaveStats();
41  virtual TBox *AddBox(Double_t , Double_t , Double_t , Double_t) {return 0;}
42  virtual TLine *AddLine(Double_t , Double_t , Double_t, Double_t) {return 0;}
43  virtual void DeleteText() { }
44  virtual void EditText() { }
45  virtual const char *GetFitFormat() const {return fFitFormat.Data();}
46  virtual const char *GetStatFormat() const {return fStatFormat.Data();}
47  Int_t GetOptFit() const;
48  Int_t GetOptStat() const;
49  TObject *GetParent() const {return fParent;}
50  virtual void Paint(Option_t *option="");
51  virtual void InsertText(const char *) { }
52  virtual void InsertLine() { }
53  virtual void ReadFile(const char *, Option_t *, Int_t, Int_t) { }
54  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
55  virtual void SaveStyle(); // *MENU*
56  virtual void SetAllWith(const char *, Option_t *, Double_t) { }
57  virtual void SetMargin(Float_t) { }
58  virtual void SetFitFormat(const char *format="5.4g"); // *MENU*
59  virtual void SetStatFormat(const char *format="6.4g"); // *MENU*
60  void SetOptFit(Int_t fit=1); // *MENU*
61  void SetOptStat(Int_t stat=1); // *MENU*
62  void SetParent(TObject*obj) {fParent = obj;}
63  virtual void UseCurrentStyle();
64 
65  ClassDef(TPaveStats,4) //A special TPaveText to draw histogram statistics.
66 };
67 
68 #endif
Int_t fOptFit
Definition: TPaveStats.h:31
void SetOptFit(Int_t fit=1)
Set the fit option.
Definition: TPaveStats.cxx:294
virtual void SetAllWith(const char *, Option_t *, Double_t)
Set attribute option for all lines containing string text.
Definition: TPaveStats.h:56
virtual TBox * AddBox(Double_t, Double_t, Double_t, Double_t)
Add a new graphics box to this pavetext.
Definition: TPaveStats.h:41
ClassDef(TAttBBox2D, 0)
virtual const char * GetFitFormat() const
Definition: TPaveStats.h:45
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
Create a Box.
Definition: TBox.h:44
Int_t fOptStat
Definition: TPaveStats.h:32
virtual void SaveStyle()
Save This TPaveStats options in current style.
Definition: TPaveStats.cxx:275
TObject * fParent
Definition: TPaveStats.h:35
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
The histogram statistics painter class.
Definition: TPaveStats.h:28
static std::string format(double x, double y, int digits, int width)
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TPaveStats.cxx:503
virtual void DeleteText()
Delete text at the mouse position.
Definition: TPaveStats.h:43
TPaveStats()
TPaveStats default constructor.
Definition: TPaveStats.cxx:226
TString fStatFormat
Definition: TPaveStats.h:34
const char * Data() const
Definition: TString.h:349
static const double x2[5]
virtual void InsertText(const char *)
Add a new Text line at the mouse position.
Definition: TPaveStats.h:51
virtual void SetStatFormat(const char *format="6.4g")
Change (i.e. set) the format for printing statistics.
Definition: TPaveStats.cxx:312
virtual ~TPaveStats()
TPaveStats default destructor.
Definition: TPaveStats.cxx:249
char * out
Definition: TBase64.cxx:29
virtual void ReadFile(const char *, Option_t *, Int_t, Int_t)
Read lines of filename in this pavetext.
Definition: TPaveStats.h:53
virtual TLine * AddLine(Double_t, Double_t, Double_t, Double_t)
Add a new graphics line to this pavetext.
Definition: TPaveStats.h:42
virtual void EditText()
Edit text at the mouse position.
Definition: TPaveStats.h:44
A simple line.
Definition: TLine.h:41
virtual void SetFitFormat(const char *format="5.4g")
Change (i.e. set) the format for printing fit parameters in statistics box.
Definition: TPaveStats.cxx:286
TObject * GetParent() const
Definition: TPaveStats.h:49
virtual const char * GetStatFormat() const
Definition: TPaveStats.h:46
static const double x1[5]
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:35
double Double_t
Definition: RtypesCore.h:55
virtual void UseCurrentStyle()
Replace current attributes by current style.
Definition: TPaveStats.cxx:568
Mother of all ROOT objects.
Definition: TObject.h:58
Int_t GetOptStat() const
Return the stat option.
Definition: TPaveStats.cxx:266
virtual void Paint(Option_t *option="")
Paint the pave stat.
Definition: TPaveStats.cxx:320
virtual void SetMargin(Float_t)
Definition: TPaveStats.h:57
virtual void InsertLine()
Add a new line at the mouse position.
Definition: TPaveStats.h:52
TString fFitFormat
Definition: TPaveStats.h:33
TObject * obj
Int_t GetOptFit() const
Return the fit option.
Definition: TPaveStats.cxx:257
void SetParent(TObject *obj)
Definition: TPaveStats.h:62
void SetOptStat(Int_t stat=1)
Set the stat option.
Definition: TPaveStats.cxx:303