33 TPavesText::TPavesText(): TPaveText()
49 TPavesText::TPavesText(Double_t x1, Double_t y1,Double_t x2, Double_t y2, Int_t npaves,Option_t *option)
50 :TPaveText(x1,y1,x2,y2,option)
59 TPavesText::~TPavesText()
66 TPavesText::TPavesText(
const TPavesText &pavestext) : TPaveText()
68 TBufferFile b(TBuffer::kWrite);
69 TPavesText *p = (TPavesText*)(&pavestext);
79 void TPavesText::Draw(Option_t *option)
87 void TPavesText::Paint(Option_t *option)
91 Int_t bordersize = GetBorderSize();
92 const char *opt = GetOption();
93 Double_t signx, signy;
94 if (strstr(opt,
"l")) signx = -1;
96 if (strstr(opt,
"b")) signy = -1;
98 Double_t dx = 3*signx*(gPad->PixeltoX(bordersize) - gPad->PixeltoX(0));
99 Double_t dy = 3*signy*(gPad->PixeltoY(bordersize) - gPad->PixeltoY(0));
101 TPave::ConvertNDCtoPad();
103 for (Int_t ipave=fNpaves;ipave>1;ipave--) {
104 Double_t x1 = fX1 + dx*Double_t(ipave-1);
105 Double_t y1 = fY1 - dy*Double_t(ipave-1);
106 Double_t x2 = fX2 + dx*Double_t(ipave-1);
107 Double_t y2 = fY2 - dy*Double_t(ipave-1);
108 TPave::PaintPave(x1,y1,x2,y2,bordersize,option);
112 TPaveText::Paint(option);
118 void TPavesText::SavePrimitive(std::ostream &out, Option_t * )
120 if (!strcmp(GetName(),
"stats"))
return;
121 if (!strcmp(GetName(),
"title"))
return;
122 Bool_t saved = gROOT->ClassSaved(TPavesText::Class());
128 out<<
" TPavesText *";
130 out<<
"pst = new TPavesText("<<fX1<<
","<<fY1<<
","<<fX2<<
","<<fY2
131 <<
","<<fNpaves<<
","<<quote<<fOption<<quote<<
");"<<std::endl;
133 if (strcmp(GetName(),
"TPave")) {
134 out<<
" pst->SetName("<<quote<<GetName()<<quote<<
");"<<std::endl;
136 if (fLabel.Length() > 0) {
137 out<<
" pst->SetLabel("<<quote<<fLabel<<quote<<
");"<<std::endl;
139 if (fBorderSize != 4) {
140 out<<
" pst->SetBorderSize("<<fBorderSize<<
");"<<std::endl;
142 SaveFillAttributes(out,
"pst",0,1001);
143 SaveLineAttributes(out,
"pst",1,1,1);
144 SaveTextAttributes(out,
"pst",22,0,1,62,0);
145 TPaveText::SaveLines(out,
"pst",saved);
146 out<<
" pst->Draw();"<<std::endl;