44 :
TPave(x1,y1,x2,y2,3,option),
TAttText(22,0,1,
gStyle->
GetTextFont(),0.99)
80 if (option && strlen(option)) opt = option;
111 const char *label ,
Option_t *option)
113 Int_t nch = strlen(label);
119 for (
Int_t i=0;i<nch;i++) {
120 if (label[i] ==
'!') nspecials += 1;
121 if (label[i] ==
'?') nspecials += 1.5;
122 if (label[i] ==
'#') nspecials += 1;
123 if (label[i] ==
'`') nspecials += 1;
124 if (label[i] ==
'^') nspecials += 1.5;
125 if (label[i] ==
'~') nspecials += 1;
126 if (label[i] ==
'&') nspecials += 2;
127 if (label[i] ==
'\\') nspecials += 3;
129 nch -=
Int_t(nspecials + 0.5);
130 if (nch <= 0)
return;
140 if (
TMath::Abs(textsize -0.99) < 0.001) automat = 1;
141 if (textsize == 0) { textsize = 0.99; automat = 1;}
143 labelsize = textsize*ypixel/hh;
144 if (wh < hh) labelsize *= hh/wh;
159 while (w > 0.99*wxlabel) {
160 labelsize *= 0.99*wxlabel/w;
169 if (wh < hh) labelsize *= hh/wh;
176 if (halign == 1) x = x1 + 0.02*(x2-
x1);
177 if (halign == 3) x = x2 - 0.02*(x2-
x1);
179 if (valign == 1) y = y1 + 0.02*(y2-y1);
180 if (valign == 3) y = y2 - 0.02*(y2-y1);
194 out<<
" TPaveLabel *";
200 <<
","<<quote<<s.
Data()<<quote<<
","<<quote<<
fOption<<quote<<
");"<<std::endl;
203 <<
","<<quote<<s.
Data()<<quote<<
","<<quote<<
fOption<<quote<<
");"<<std::endl;
206 out<<
" pl->SetBorderSize("<<
fBorderSize<<
");"<<std::endl;
212 out<<
" pl->Draw();"<<std::endl;
void Copy(TObject &pavelabel) const
Copy this pavelabel to pavelabel.
Option_t * GetOption() const
virtual void PaintPaveLabel(Double_t x1, Double_t y1, Double_t x2, Double_t y2, const char *label, Option_t *option="")
Draw this pavelabel with new coordinates.
virtual Color_t GetTextColor() const
Return the text color.
virtual Short_t GetTextAlign() const
Return the text alignment.
TString & ReplaceAll(const TString &s1, const TString &s2)
R__EXTERN TStyle * gStyle
virtual ~TPaveLabel()
Pavelabel default destructor.
virtual Float_t GetTextAngle() const
Return the text angle.
Double_t fY2
Y of 2nd point.
void Copy(TObject &pave) const
Copy this pave to pave.
TString fLabel
Label written at the center of Pave.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
if object in a list can be deleted
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
A TBox with a bordersize and a shadow option.
virtual void ConvertNDCtoPad()
Convert pave coordinates from NDC to Pad coordinates.
Double_t fY1
Y of 1st point.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
static const double x2[5]
Double_t fX1NDC
X1 point in NDC coordinates.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
virtual Float_t GetTextSize() const
Return the text size.
To draw Mathematical Formula.
virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
Main drawing function.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void DrawPaveLabel(Double_t x1, Double_t y1, Double_t x2, Double_t y2, const char *label, Option_t *option="")
Draw this pavelabel with new coordinates.
A Pave (see TPave) with a text centered in the Pave.
void Copy(TAttText &atttext) const
Copy this text attributes to a new TAttText.
const char * GetLabel() const
virtual void SaveTextAttributes(std::ostream &out, const char *name, Int_t alidef=12, Float_t angdef=0, Int_t coldef=1, Int_t fondef=61, Float_t sizdef=1)
Save text attributes as C++ statement(s) on output stream out.
virtual Font_t GetTextFont() const
Return the text font.
Double_t fX2
X of 2nd point.
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
TPaveLabel()
Pavelabel default constructor.
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
Double_t fX1
X of 1st point.
Int_t fBorderSize
window box bordersize in pixels
Double_t fY2NDC
Y2 point in NDC coordinates.
static const double x1[5]
virtual void Draw(Option_t *option="")
Draw this pavelabel with its current attributes.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
static constexpr double s
const char * GetTitle() const
Returns title of object.
Double_t fX2NDC
X2 point in NDC coordinates.
virtual void GetTextExtent(UInt_t &w, UInt_t &h, const char *text) const
Return text extent for string text.
Mother of all ROOT objects.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Double_t fY1NDC
Y1 point in NDC coordinates.
virtual void PaintPave(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t bordersize=4, Option_t *option="br")
Draw this pave with new coordinates.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
TString fOption
Pave style.
virtual void Paint(Option_t *option="")
Paint this pavelabel with its current attributes.
Int_t GetBorderSize() const
const char * Data() const