250 :
TVirtualPad(
name,title,xlow,ylow,xup,yup,color,bordersize,bordermode)
333 Error(
"TPad",
"You must create a TCanvas before creating a TPad");
342 if ((xlow < 0) || (xlow > 1) || (ylow < 0) || (ylow > 1)) {
343 Error(
"TPad",
"illegal bottom left position: x=%f, y=%f", xlow, ylow);
345 }
else if ((xup < 0) || (xup > 1) || (yup < 0) || (yup > 1)) {
346 Error(
"TPad",
"illegal top right position: x=%f, y=%f", xup, yup);
348 }
else if (xup-xlow <= 0) {
349 Error(
"TPad",
"illegal width: %f", xup-xlow);
351 }
else if (yup-ylow <= 0) {
352 Error(
"TPad",
"illegal height: %f", yup-ylow);
370 SetPad(
name, title, xlow, ylow, xup, yup, color, bordersize, bordermode);
517 while (
auto exec = (
TExec*)next())
557 const char* title,
Option_t *option)
560 if (!lop)
return nullptr;
561 TList *lof =
nullptr;
568 auto AddEntryFromListOfFunctions = [&]() {
570 while ((obj = nextobj())) {
579 leg->AddEntry(obj, mes.
Data(),
"lpf");
583 while(
auto o = next()) {
589 if (o->InheritsFrom(
TNamed::Class()) && strlen(o->GetTitle()))
591 else if (strlen(o->GetName()))
594 mes = o->ClassName();
595 if (option && strlen(option)) {
607 lof = ((
TH1 *)o)->GetListOfFunctions();
608 AddEntryFromListOfFunctions();
611 lof = ((
TGraph *)o)->GetListOfFunctions();
612 AddEntryFromListOfFunctions();
618 TIter nextgraph(grlist);
620 while ((obj = nextgraph())) {
622 if (strlen(
gr->GetTitle()))
623 mes =
gr->GetTitle();
624 else if (strlen(
gr->GetName()))
627 mes =
gr->ClassName();
628 if (option && strlen(option))
632 leg->AddEntry(obj, mes.
Data(), opt);
635 AddEntryFromListOfFunctions();
640 TIter nexthist(hlist);
641 while ((obj = nexthist())) {
645 else if (strlen(hist->
GetName()))
649 if (option && strlen(option))
653 leg->AddEntry( obj, mes.
Data(), opt );
662 Info(
"BuildLegend",
"No object(s) to build a TLegend.");
705 while (
auto obj = next()) {
708 if (
n == subpadnumber) {
709 return ((
TPad*)obj)->cd();
749 if (pp && pp->GetPS())
776 for (
Int_t i=0;i<2;i++) {
789 while(code1 + code2) {
800 if (ic == 0) ic = code2;
802 yt =
y[0] + (
y[1]-
y[0])*(xclipl-
x[0])/(
x[1]-
x[0]);
806 yt =
y[0] + (
y[1]-
y[0])*(xclipr-
x[0])/(
x[1]-
x[0]);
810 xt =
x[0] + (
x[1]-
x[0])*(yclipb-
y[0])/(
y[1]-
y[0]);
814 xt =
x[0] + (
x[1]-
x[0])*(yclipt-
y[0])/(
y[1]-
y[0]);
820 code1 =
ClippingCode(xt,yt,xclipl,yclipb,xclipr,yclipt);
824 code2 =
ClippingCode(xt,yt,xclipl,yclipb,xclipr,yclipt);
838 for (
Int_t i=0;i<2;i++) {
847 if (
x[0] < xclipl) code1 = code1 | 0x1;
848 if (
x[0] > xclipr) code1 = code1 | 0x2;
849 if (
y[0] < yclipb) code1 = code1 | 0x4;
850 if (
y[0] > yclipt) code1 = code1 | 0x8;
852 if (
x[1] < xclipl) code2 = code2 | 0x1;
853 if (
x[1] > xclipr) code2 = code2 | 0x2;
854 if (
y[1] < yclipb) code2 = code2 | 0x4;
855 if (
y[1] > yclipt) code2 = code2 | 0x8;
859 while(code1 + code2) {
870 if (ic == 0) ic = code2;
872 yt =
y[0] + (
y[1]-
y[0])*(xclipl-
x[0])/(
x[1]-
x[0]);
876 yt =
y[0] + (
y[1]-
y[0])*(xclipr-
x[0])/(
x[1]-
x[0]);
880 xt =
x[0] + (
x[1]-
x[0])*(yclipb-
y[0])/(
y[1]-
y[0]);
884 xt =
x[0] + (
x[1]-
x[0])*(yclipt-
y[0])/(
y[1]-
y[0]);
890 code1 =
ClippingCode(xt,yt,xclipl,yclipb,xclipr,yclipt);
894 code2 =
ClippingCode(xt,yt,xclipl,yclipb,xclipr,yclipt);
907 if (
x < xcl1) code = code | 0x1;
908 if (
x > xcl2) code = code | 0x2;
909 if (
y < ycl1) code = code | 0x4;
910 if (
y > ycl2) code = code | 0x8;
961 std::vector<Double_t> xc2(nn), yc2(nn);
968 for (i = 0; i <
n; i++) {
969 x2 =
x[i]; y2 =
y[i];
973 slope = (y2-y1)/(x2-x1);
977 xc2[nc2] = xclipl; yc2[nc2++] = slope*(xclipl-x1)+y1;
979 xc2[nc2] = x2; yc2[nc2++] = y2;
983 xc2[nc2] = xclipl; yc2[nc2++] = slope*(xclipl-x1)+y1;
984 xc2[nc2] = x2; yc2[nc2++] = y2;
996 for (i = 0; i < nc2; i++) {
997 x2 = xc2[i]; y2 = yc2[i];
1001 slope = (x2-x1)/(y2-y1);
1005 xc[nc] = x1+(yclipt-y1)*slope; yc[nc++] = yclipt;
1007 xc[nc] = x2; yc[nc++] = y2;
1011 xc[nc] = x1+(yclipt-y1)*slope; yc[nc++] = yclipt;
1012 xc[nc] = x2; yc[nc++] = y2;
1023 for (i = 0; i < nc; i++) {
1024 x2 = xc[i]; y2 = yc[i];
1028 slope = (y2-y1)/(x2-x1);
1032 xc2[nc2] = xclipr; yc2[nc2++] = slope*(xclipr-x1)+y1;
1034 xc2[nc2] = x2; yc2[nc2++] = y2;
1038 xc2[nc2] = xclipr; yc2[nc2++] = slope*(xclipr-x1)+y1;
1039 xc2[nc2] = x2; yc2[nc2++] = y2;
1051 for (i = 0; i < nc2; i++) {
1052 x2 = xc2[i]; y2 = yc2[i];
1056 slope = (x2-x1)/(y2-y1);
1060 xc[nc] = x1+(yclipb-y1)*slope; yc[nc++] = yclipb;
1062 xc[nc] = x2; yc[nc++] = y2;
1066 xc[nc] = x1+(yclipb-y1)*slope; yc[nc++] = yclipb;
1067 xc[nc] = x2; yc[nc++] = y2;
1112 if (!
gROOT->GetListOfCanvases())
return;
1114 gROOT->GetListOfCanvases()->Remove(
this);
1126 if (
fCanvas->GetPadSave() ==
this)
1128 if (
fCanvas->GetSelectedPad() ==
this)
1129 fCanvas->SetSelectedPad(
nullptr);
1130 if (
fCanvas->GetClickSelectedPad() ==
this)
1131 fCanvas->SetClickSelectedPad(
nullptr);
1136 if (
gROOT->GetSelectedPad() ==
this)
1137 gROOT->SetSelectedPad(
nullptr);
1161 while (
auto obj = next()) {
1162 if (
auto pad =
dynamic_cast<TPad*
>(obj)) {
1193 Int_t pxl, pyl, pxt, pyt;
1198 if (px1 < px2) {pxl = px1; pxt = px2;}
1199 else {pxl = px2; pxt = px1;}
1200 if (py1 < py2) {pyl = py1; pyt = py2;}
1201 else {pyl = py2; pyt = py1;}
1205 if ( (px > pxl && px < pxt) && (py > pyl && py < pyt) ) {
1212 if (py < pyl) dxl += pyl - py;
1213 if (py > pyt) dxl += py - pyt;
1215 if (py < pyl) dxt += pyl - py;
1216 if (py > pyt) dxt += py - pyt;
1218 if (px < pxl) dyl += pxl - px;
1219 if (px > pxt) dyl += px - pxt;
1221 if (px < pxl) dyt += pxl - px;
1222 if (px > pxt) dyt += px - pxt;
1224 Int_t distance = dxl;
1225 if (dxt < distance) distance = dxt;
1226 if (dyl < distance) distance = dyl;
1227 if (dyt < distance) distance = dyt;
1301 arr[1] =
this; arr[2] = (
void*)&nx;arr[3] = (
void*)& ny;
1302 arr[4] = (
void*)&xmargin; arr[5] = (
void *)& ymargin; arr[6] = (
void *)&color;
1303 if ((*
gThreadXAR)(
"PDCD", 7, arr,
nullptr))
return;
1309 if (nx <= 0) nx = 1;
1310 if (ny <= 0) ny = 1;
1317 if (xmargin >= 0 && ymargin >= 0) {
1321 for (iy=0;iy<ny;iy++) {
1322 y2 = 1 - iy*dy - ymargin;
1323 y1 = y2 - dy + 2*ymargin;
1325 if (y1 > y2)
continue;
1326 for (ix=0;ix<nx;ix++) {
1327 x1 = ix*dx + xmargin;
1328 x2 = x1 +dx -2*xmargin;
1329 if (x1 > x2)
continue;
1332 pad =
new TPad(
name.Data(),
name.Data(), x1, y1, x2, y2, color);
1354 for (
Int_t i=0;i<nx;i++) {
1358 if (i == nx-1) x2 = 1-xr;
1359 for (
Int_t j=0;j<ny;j++) {
1360 number = j*nx + i +1;
1363 if (j == 0) y2 = 1-yt;
1364 if (j == ny-1) y1 = 0;
1366 title.Form(
"%s_%d",
GetTitle(), number);
1367 pad =
new TPad(
name.Data(), title.Data(), x1, y1, x2, y2, color);
1395 const std::vector<double>& widthRatios,
1396 const std::vector<double>& heightRatios,
1397 const double canvasTopMargin,
1398 const double canvasLeftMargin
1403 int wrs = widthRatios.size();
1404 int hrs = heightRatios.size();
1407 if (wrs==0) nxl = nx;
1408 if (hrs==0) nyl = ny;
1415 double x1, y1, x2, y2;
1418 if (canvasTopMargin <0 || canvasTopMargin >1 ) {
1419 Error(
"DivideRatios",
"The canvas top margin must be >= 0 and <= 1");
1422 y = 1.- canvasTopMargin;
1424 if (canvasLeftMargin <0 || canvasLeftMargin >1 ) {
1425 Error(
"DivideRatios",
"The canvas left margin must be >= 0 and <= 1");
1430 double sumOfHeightRatios = canvasTopMargin;
1432 for (
int i=0; i<nyl; i++) {
1433 yr = heightRatios[i];
1434 sumOfHeightRatios = sumOfHeightRatios + yr;
1435 if (yr <0 || yr >1 ) {
1436 Error(
"DivideRatios",
"Y ratios plus the top margin must be >= 0 and <= 1");
1441 if (sumOfHeightRatios > 1.) {
1442 Error(
"DivideRatios",
"The sum of Y ratios plus the top margin must be <= 1 %g",sumOfHeightRatios);
1445 double sumOfWidthRatios = canvasLeftMargin;
1447 for (
int j=0; j<nxl; j++) {
1448 xr = widthRatios[j];
1449 sumOfWidthRatios = sumOfWidthRatios +xr;
1450 if (xr <0 || xr >1 ) {
1451 Error(
"DivideRatios",
"X ratios must be >= 0 and <= 1");
1456 if (sumOfWidthRatios > 1.) {
1457 Error(
"DivideRatios",
"The sum of X ratios must be <= 1 %g ",sumOfWidthRatios);
1462 for (
int i=0; i<nyl; i++) {
1463 x = canvasLeftMargin;
1464 if (hrs) yr = heightRatios[i];
1466 for (
int j=0; j<nxl; j++) {
1467 if (wrs) xr = widthRatios[j];
1493 Error(
"DivideSquare",
"No canvas associated with this pad.");
1506 Divide( w,
h, xmargin, ymargin, color);
1516 gROOT->MakeDefCanvas();
1553 if (!classobj)
return;
1558 TText *ptext =
nullptr;
1561 Int_t nd,nf,nc,nkd,nkf,i,j;
1574 Range(0,0,xpad,ypad);
1579 clevel[nlevel] = obj;
1588 if (nlevel >= maxlev-1)
break;
1592 Int_t ilevel, nelem;
1593 for (ilevel=nlevel;ilevel>=0;ilevel--) {
1594 cl = clevel[ilevel];
1596 if (nelem > maxelem) maxelem = nelem;
1597 nc = (nelem/50) + 1;
1607 if (dx < 1.3) dx = 1.3;
1608 tsizcm = tsizcm - 0.03*
Double_t(ncdraw-5);
1609 if (tsizcm < 0.27) tsizcm = 0.27;
1614 for (ilevel=nlevel;ilevel>=0;ilevel--) {
1615 cl = clevel[ilevel];
1617 if (nelem > maxelem) maxelem = nelem;
1618 nc = (nelem/50) + 1;
1620 if (ilevel < nlevel) x1 = x2 + 0.5;
1644 pt->SetFillColor(19);
1646 pt->SetTextColor(4);
1647 pt->SetTextFont(61);
1648 pt->SetTextAlign(12);
1649 pt->SetTextSize(tsiz);
1651 if (
box)
box->SetFillColor(17);
1652 pt->AddLine(0,(y1-
v1)/dv,0,(y1-
v1)/dv);
1654 title->SetTextAlign(22);
1655 title->SetTextSize(0.6*(
v2-y1)/ypad);
1664 if (i >= nkd) { i = 1;
y = y1 - 0.5*dy;
x += 1/
Double_t(nc); }
1665 else { i++;
y -= dy; }
1669 Int_t dim =
d->GetArrayDim();
1673 while (indx < dim ){
1674 ldname = strlen(dname);
1675 snprintf(&dname[ldname],256-ldname,
"[%d]",
d->GetMaxIndex(indx));
1678 pt->AddText(
x,(
y-
v1)/dv,dname);
1685 pt->AddLine(0,(ysep-
v1)/dv,0,(ysep-
v1)/dv);
1696 while ((
m = (
TMethod *) nextm())) {
1698 !strcmp(
m->GetName(),
"Dictionary" ) ||
1699 !strcmp(
m->GetName(),
"Class_Version" ) ||
1700 !strcmp(
m->GetName(),
"DeclFileName" ) ||
1701 !strcmp(
m->GetName(),
"DeclFileLine" ) ||
1702 !strcmp(
m->GetName(),
"ImplFileName" ) ||
1703 !strcmp(
m->GetName(),
"ImplFileLine" )
1706 if (fcount > nf)
break;
1707 if (i >= nkf) { i = 1;
y = ysep - 0.5*dy;
x += 1/
Double_t(nc); }
1708 else { i++;
y -= dy; }
1710 ptext =
pt->AddText(
x,(
y-
v1)/dv,
m->GetName());
1713 for (j=ilevel-1;j>=0;j--) {
1714 if (cl == clevel[ilevel]) {
1715 if (clevel[j]->GetMethodAny((
char*)
m->GetName())) {
1783 pp->SetAttLine({1,1,1});
1789 u = 1. * pxold / canvas->
GetWw();
1790 v = 1. - 1. * pyold / canvas->
GetWh();
1791 pp->DrawLineNDC(umin,
v, umax,
v);
1792 pp->DrawLineNDC(u, vmin, u, vmax);
1802 u = 1. * px / canvas->
GetWw();
1803 v = 1. - 1. * py / canvas->
GetWh();
1804 pp->DrawLineNDC(umin,
v, umax,
v);
1805 pp->DrawLineNDC(u, vmin, u, vmax);
1846 Warning(
"DrawFrame",
"Must be called for the current pad only");
1853 if (hframe)
delete hframe;
1861 std::vector<Double_t> xbins(nbins+1);
1863 for (
Int_t i=1;i<=nbins;i++) {
1866 hframe =
new TH1F(
"hframe",title,nbins,xbins.data());
1889 Double_t xlow, ylow, xup, yup, hs, ws;
1894 gPad->SetFillColor(0);
1896 gPad->Range(x1,y1,x2,y2);
1899 text.SetTextFont(61);
1900 text.SetTextSize(0.07);
1901 text.SetTextAlign(22);
1908 for (i=0;i<10;i++) {
1915 box.SetFillStyle(1001);
1916 box.SetFillColor(color);
1917 box.DrawBox(xlow, ylow, xup, yup);
1918 box.SetFillStyle(0);
1919 box.SetLineColor(1);
1920 box.DrawBox(xlow, ylow, xup, yup);
1921 if (color == 1)
text.SetTextColor(0);
1922 else text.SetTextColor(1);
1950 constexpr Int_t kMaxDiff = 5;
1951 constexpr Int_t kMinSize = 20;
1952 static Int_t px1, px2, py1, py2, dpx1, dpy2;
1953 static Int_t px1p, px2p, py1p, py2p;
1954 static enum { pNone, pA, pB, pC, pD, pTop, pL, pR, pBot, pINSIDE } mode = pNone;
2017 auto paint_or_set = [
this, &parent](
Bool_t paint)
2041 }
else if (firstPaint) {
2051 Int_t prevpx1 = px1, prevpx2 = px2, prevpy1 = py1, prevpy2 = py2;
2054 auto adjustRatio = [
this, &parent](
int choise = 11) ->
bool
2061 Int_t npx1 = (px1 + px2) / 2 - dx / 2;
2062 Int_t npx2 = npx1 + dx;
2063 if ((npx1 >= px1p) && (npx2 <= px2p)) {
2064 px1 = npx1; px2 = npx2;
2072 case -1: npy2 = py1 - dy;
break;
2073 case 0: npy2 = (py1 + py2) / 2 - dy / 2; npy1 = npy2 + dy;
break;
2074 case 1: npy1 = py2 + dy;
break;
2076 if ((npy1 <= py1p) && (npy2 >= py2p)) {
2077 py1 = npy1; py2 = npy2;
2108 std::swap(px1, px2);
2111 std::swap(py1, py2);
2119 std::swap(px1p, px2p);
2122 std::swap(py1p, py2p);
2137 }
else if ((px > px1 + kMaxDiff && px < px2 - kMaxDiff) &&
TMath::Abs(py - py2) < kMaxDiff) {
2140 }
else if ((px > px1 + kMaxDiff && px < px2 - kMaxDiff) &&
TMath::Abs(py - py1) < kMaxDiff) {
2143 }
else if ((py > py2 + kMaxDiff && py < py1 - kMaxDiff) &&
TMath::Abs(px - px1) < kMaxDiff) {
2146 }
else if ((py > py2 + kMaxDiff && py < py1 - kMaxDiff) &&
TMath::Abs(px - px2) < kMaxDiff) {
2149 }
else if ((px > px1+kMaxDiff && px < px2-kMaxDiff) && (py > py2+kMaxDiff && py < py1-kMaxDiff)) {
2159 fResizing = (mode != pNone) && (mode != pINSIDE);
2177 if (!ropaque) paint_or_set(
kTRUE);
2180 if (!adjustRatio(-1)) {
2184 paint_or_set(!ropaque);
2187 if (!ropaque) paint_or_set(
kTRUE);
2190 if (!adjustRatio(-1)) {
2194 paint_or_set(!ropaque);
2197 if (!ropaque) paint_or_set(
kTRUE);
2200 if (!adjustRatio(1)) {
2204 paint_or_set(!ropaque);
2207 if (!ropaque) paint_or_set(
kTRUE);
2210 if (!adjustRatio(1)) {
2214 paint_or_set(!ropaque);
2217 if (!ropaque) paint_or_set(
kTRUE);
2219 if (!adjustRatio(11))
2221 paint_or_set(!ropaque);
2224 if (!ropaque) paint_or_set(
kTRUE);
2226 if (!adjustRatio(11))
2228 paint_or_set(!ropaque);
2231 if (!ropaque) paint_or_set(
kTRUE);
2233 if (!adjustRatio(0))
2235 paint_or_set(!ropaque);
2238 if (!ropaque) paint_or_set(
kTRUE);
2240 if (!adjustRatio(0))
2242 paint_or_set(!ropaque);
2245 if (!opaque) paint_or_set(
kTRUE);
2246 px2 += px - dpx1 - px1;
2248 py1 += py - dpy2 - py2;
2250 if (px1 < px1p) { px2 += px1p - px1; px1 = px1p; }
2251 if (px2 > px2p) { px1 -= px2 - px2p; px2 = px2p; }
2252 if (py1 > py1p) { py2 -= py1 - py1p; py1 = py1p; }
2253 if (py2 < py2p) { py1 += py2p - py2; py2 = py2p; }
2254 paint_or_set(!opaque);
2258 if ((mode == pINSIDE && opaque) || (
fResizing && ropaque)) {
2262 case pINSIDE:
gPad->ShowGuidelines(
this, event);
break;
2263 case pTop:
gPad->ShowGuidelines(
this, event,
't',
true);
break;
2264 case pBot:
gPad->ShowGuidelines(
this, event,
'b',
true);
break;
2265 case pL:
gPad->ShowGuidelines(
this, event,
'l',
true);
break;
2266 case pR:
gPad->ShowGuidelines(
this, event,
'r',
true);
break;
2267 case pA:
gPad->ShowGuidelines(
this, event,
'1',
true);
break;
2268 case pB:
gPad->ShowGuidelines(
this, event,
'2',
true);
break;
2269 case pC:
gPad->ShowGuidelines(
this, event,
'3',
true);
break;
2270 case pD:
gPad->ShowGuidelines(
this, event,
'4',
true);
break;
2281 if (opaque || ropaque)
2284 if (
gROOT->IsEscaped()) {
2291 if ((mode == pINSIDE && !opaque) || (
fResizing && !ropaque)) {
2354 static Int_t axisNumber;
2356 static Double_t px1old, py1old, px2old, py2old;
2357 Int_t nbd, inc, bin1, bin2, first, last;
2360 bool resetAxisRange =
false;
2361 static std::unique_ptr<TBox> zoombox;
2362 Double_t zbx1=0,zbx2=0,zby1=0,zby2=0;
2369 if (strstr(opt,
"cont4")) {
2380 if (!strcmp(axis->
GetName(),
"xaxis"))
2382 if (!strcmp(axis->
GetName(),
"yaxis"))
2384 if (!strcmp(axis->
GetName(),
"zaxis"))
2389 if (axisNumber == 1) {
2395 }
else if (axisNumber == 2) {
2411 if (axisNumber == 1) {
2416 }
else if (axisNumber == 2) {
2430 zoombox = std::make_unique<TBox>(zbx1, zby1, zbx2, zby2);
2433 if (!pp->IsSupportAlpha() || !zoomcolor)
2434 zoombox->SetFillStyle(3002);
2437 zoombox->SetFillColor(ci);
2444 pp->SetAttLine({-1, 1, 1});
2453 if (axisNumber == 1) {
2463 if (axisNumber == 1) {
2468 }
else if (axisNumber == 2) {
2483 zoombox->SetX1(zbx1);
2484 zoombox->SetY1(zby1);
2485 zoombox->SetX2(zbx2);
2486 zoombox->SetY2(zby2);
2528 if (
gROOT->IsEscaped()) {
2530 if (opaque && zoombox)
2537 if (ratio1 > ratio2) {
2542 if (ratio2 - ratio1 > 0.05) {
2544 if (axisNumber == 3 && hobj && hobj->
GetDimension() != 3) {
2553 Float_t newmin = zmin + (zmax-zmin)*ratio1;
2554 Float_t newmax = zmin + (zmax-zmin)*ratio2;
2567 bin1 = first +
Int_t((last-first+1)*ratio1);
2568 bin2 = first +
Int_t((last-first+1)*ratio2);
2578 if (axisNumber == 1) {
2586 }
else if (axisNumber == 2) {
2614 xmin = ((
xmin-xmi)/(xma-xmi))*(up-low)+low;
2615 xmax = ((
xmax-xmi)/(xma-xmi))*(up-low)+low;
2618 if (!strcmp(axis->
GetName(),
"xaxis")) axisNumber = 1;
2619 if (!strcmp(axis->
GetName(),
"yaxis")) axisNumber = 2;
2620 if (ratio2 - ratio1 > 0.05) {
2627 if (axisNumber == 1) axis->
SetRange(bin1,bin2);
2628 if (axisNumber == 2 && hobj1) {
2645 while ((obj= next())) {
2648 if (hobj == hobj1)
continue;
2651 if (axisNumber == 1) {
2653 }
else if (axisNumber == 2) {
2676 pp->SetAttLine({-1, 1, 1});
2697 if (found)
return found;
2699 while (
auto cur = next()) {
2702 if (found)
return found;
2717 if (found)
return found;
2719 while (
auto cur = next()) {
2722 if (found)
return found;
2797 if (
fCanvas ==
this)
return nullptr;
2806 if (
fCanvas ==
this)
return nullptr;
2815 if (
fCanvas ==
this)
return nullptr;
2992 fFrame->SetFillColor(framecolor);
3015 while ((obj=next())) {
3019 if (found)
return found;
3029 if (!subpadnumber) {
3036 while ((obj = next())) {
3039 if (pad->
GetNumber() == subpadnumber)
return pad;
3107 gROOT->SetSelectedPad(
this);
3122 <<
" Name= "<<
GetName()<<
" Title= "<<
GetTitle()<<
" Option="<<option<<std::endl;
3134 if (opt.
Index(
"pfc")>=0 || opt.
Index(
"plc")>=0 || opt.
Index(
"pmc")>=0) {
3152 if (i>=ncolors) i = ncolors-1;
3156 return gStyle->GetColorPalette(i);
3164 Int_t const cellSize = 10;
3171 for (
int i = 0; i <
fCGnx; i++)
3172 for (
int j = 0; j <
fCGny; j++)
3178 while(
auto o = iter()) {
3191 while (
auto og = nextgraph())
3195 while (
auto oh = nexthist()) {
3209 for (
int r = i;
r < w + i;
r++) {
3210 for (
int c = j;
c <
h + j;
c++) {
3245 bool isFirstVertical =
false;
3246 bool isFirstHorizontal =
false;
3248 for (std::size_t i = 0; option[i] !=
'\0'; ++i) {
3249 char letter = std::tolower(option[i]);
3250 if (letter ==
'w') {
3255 }
else if (letter ==
't' || letter ==
'b') {
3256 isFirstVertical = !isFirstHorizontal;
3258 dy = letter ==
't' ? -1 : 1;
3259 }
else if (letter ==
'l' || letter ==
'r') {
3260 isFirstHorizontal = !isFirstVertical;
3262 dx = letter ==
'r' ? -1 : 1;
3266 if(dx < 0) std::swap(nxbeg, nxend);
3267 if(dy < 0) std::swap(nybeg, nyend);
3269 auto attemptPlacement = [&](
Int_t i,
Int_t j) {
3279 if(!isFirstVertical) {
3280 for (
Int_t i = nxbeg; i != nxend; i += dx) {
3281 for (
Int_t j = nybeg; j != nyend; j += dy) {
3282 if (attemptPlacement(i, j))
return true;
3287 for (
Int_t j = nybeg; j != nyend; j += dy) {
3288 for (
Int_t i = nxbeg; i != nxend; i += dx) {
3289 if (attemptPlacement(i, j))
return true;
3297#define NotFree(i, j) fCollideGrid[TMath::Max(TMath::Min(i+j*fCGnx,fCGnx*fCGny),0)] = kFALSE;
3310 for (i=x1+1; i<x2; i++)
NotFree(i,y1);
3316 for (i=y1+1; i<y2; i++)
NotFree(x1,i);
3323 xt = x1; x1 = x2; x2 = xt;
3324 yt = y1; y1 = y2; y2 = yt;
3326 for (i=x1+1; i<x2; i++) {
3333 yt = y1; y1 = y2; y2 = yt;
3334 xt = x1; x1 = x2; x2 = xt;
3336 for (j=y1+1; j<y2; j++) {
3356 for (
int i = x1; i<=x2; i++) {
3357 for (
int j = y1; j<=y2; j++)
NotFree(i, j);
3375 for (i = x1; i<=x2; i++) {
3380 for (i = y1; i<=y2; i++) {
3398 for (
Int_t i=s; i<
n; i=i+s) {
3400 g->GetPoint(i ,x2,y2);
3414 (
int)((y1-
fY1)/ys), (
int)((y2-
fY1)/ys));
3427 if (
name.Index(
"hframe") >= 0)
return;
3432 bool haserrors =
false;
3433 TString drawOption =
h->GetDrawOption();
3437 if (drawOption.
Index(
"hist") < 0) {
3438 if (drawOption.
Index(
"e") >= 0) haserrors =
true;
3441 Int_t nx =
h->GetNbinsX();
3446 for (i = 1; i<nx; i++) {
3448 x1l =
h->GetBinCenter(i);
3454 y1l =
h->GetBinContent(i)-
h->GetBinErrorLow(i);
3460 y2l =
h->GetBinContent(i)+
h->GetBinErrorUp(i);
3466 for (j=y1; j<y2; j++) {
3470 x1l =
h->GetBinLowEdge(i);
3476 y1l =
h->GetBinContent(i);
3483 x1l =
h->GetBinLowEdge(i)+
h->GetBinWidth(i);
3488 x1 = (
int)((x1l-
fX1)/xs);
3508 box.SetFillColorAlpha(
kRed,0.5);
3519 for (
int i = 0; i<
fCGnx; i++) {
3522 for (
int j = 0; j<
fCGny; j++) {
3539 box.DrawBox(X1L, Y1L, X2L, Y2L);
3541 box.SetFillColorAlpha(
kRed,t);
3542 box.DrawBox(X1L, Y1L, X2L, Y2L);
3546 if (t==0.15) t = 0.1;
3647 TObject *obj = lnk->GetObject();
3657 began3DScene =
kTRUE;
3660 obj->
Paint(lnk->GetOption());
3700 if (!
IsBatch() && (pp->IsCocoa() || (pp->IsNative() && (
style > 3000) && (
style < 3026))))
3701 pp->ClearDrawable();
3714 fMother->CopyBackgroundPixmaps(
this, px, py);
3715 pp->SetAttFill({color, 1001});
3716 pp->SetOpacity(
style - 4000);
3718 }
else if ((color == 10) && (
style > 3000) && (
style < 3100))
3722 pp->SetAttFill({color,
style});
3723 pp->SetAttLine(*
this);
3736 box.SetFillColor(color);
3751 gVirtualPS->DrawFrame(xl, yl, xt, yt, bmode,bsize,dark,light);
3761 if (
gStyle->GetOptDate()) {
3765 if (
gStyle->GetOptDate() < 10) {
3768 }
else if (
gStyle->GetOptDate() < 20) {
3828 auto lnk = pList ? pList->
FirstLink() :
nullptr;
3830 auto obj = lnk->GetObject();
3832 ((
TPad*)obj)->PaintModified();
3861 auto lnk = pList ? pList->
FirstLink() :
nullptr;
3864 TObject *obj = lnk->GetObject();
3866 ((
TPad*)obj)->PaintModified();
3878 began3DScene =
kTRUE;
3881 obj->
Paint(lnk->GetOption());
3917 if (option && *option ==
's')
3918 skip_fill = draw_border =
kTRUE;
3919 else if (option && *option ==
'l')
3920 draw_border =
kTRUE;
3927 draw_border =
kTRUE;
3931 draw_fill =
style < 3026;
3934 draw_fill =
style > 4000;
3935 }
else if (
style > 0)
3936 draw_border =
kTRUE;
3938 if (draw_fill && !skip_fill)
3960 while (
auto obj = next()) {
3963 if (
auto pad =
dynamic_cast<TPad *
>(obj))
3964 pad->CopyBackgroundPixmaps(stop,
x,
y);
3972 Warning(
"TPad::PaintFillArea",
"Float_t signature is obsolete. Use Double_t signature.");
3990 std::vector<Double_t>
x(nc, 0.);
3991 std::vector<Double_t>
y(nc, 0.);
4004 Int_t fillstyle = pp->GetFillStyle();
4005 if (fillstyle >= 3100 && fillstyle < 4000)
4008 pp->DrawFillArea(
n,
x.data(),
y.data());
4018 std::vector<Double_t> xw(
n), yw(
n);
4019 for (
int i=0; i<
n; i++) {
4061 static Double_t ang1[10] = { 0., 10., 20., 30., 45.,5., 60., 70., 80., 89.99};
4062 static Double_t ang2[10] = {180.,170.,160.,150.,135.,5.,120.,110.,100., 89.99};
4064 Int_t fasi = FillStyle % 1000;
4065 Int_t idSPA = fasi / 100;
4066 Int_t iAng2 = (fasi - 100 * idSPA) / 10;
4067 Int_t iAng1 = fasi % 10;
4075 TAttLine saveatt = pp->GetAttLine();
4077 pp->SetAttLine({ pp->GetAttFill().GetFillColor(), 1, lw });
4080 if (ang1[iAng1] != 5.)
4082 if (ang2[iAng2] != 5.)
4085 pp->SetAttLine(saveatt);
4096 Int_t i, i1, i2, nbi;
4101 std::vector<Double_t> xli;
4102 std::vector<Double_t> yli;
4105 Double_t x,
y, x1, x2, y1, y2,
a,
b, xi, xip, xin, yi, yip;
4111 ratiox = 1./(rwxmax-rwxmin);
4112 ratioy = 1./(rwymax-rwymin);
4125 gPad->GetPadPar(x1p,y1p,x2p,y2p);
4134 for (i=1; i<=nn; i++) {
4135 x = wndc*ratiox*(xx[i-1]-rwxmin);
4136 y = hndc*ratioy*(yy[i-1]-rwymin);
4137 yrot = sina*
x+cosa*
y;
4144 while (dy * yindx >=
ymin) {
4145 ycur = dy * yindx--;
4151 for (i=2; i<=nn+1; i++) {
4154 if (i == nn+1) i2=1;
4156 x1 = wndc*ratiox*(xx[i1-1]-rwxmin);
4157 y1 = hndc*ratioy*(yy[i1-1]-rwymin);
4158 x2 = wndc*ratiox*(xx[i2-1]-rwxmin);
4159 y2 = hndc*ratioy*(yy[i2-1]-rwymin);
4161 xt1 = cosa*x1-sina*y1;
4162 yt1 = sina*x1+cosa*y1;
4163 xt2 = cosa*x2-sina*y2;
4164 yt2 = sina*x2+cosa*y2;
4175 if ((yi <= ycur) && (ycur < yip)) {
4194 a = (yt1-yt2)/(xt1-xt2);
4195 b = (yt2*xt1-xt2*yt1)/(xt1-xt2);
4207 if ((xi <= xin) && (xin < xip) &&
4216 std::sort(xli.begin(), xli.end());
4219 if ((nbi%2 != 0) || (nbi == 0))
4222 for (i=0; i<nbi; ++i) {
4224 Double_t ytmp = sinb*xli[i] + cosb*ycur;
4225 xli[i] = cosb*xli[i] - sinb*ycur;
4227 xli[i] = (xli[i]/wndc)*(rwxmax-rwxmin)+rwxmin;
4228 ytmp = (ytmp/hndc)*(rwymax-rwymin)+rwymin;
4229 yli.push_back(ytmp);
4232 gPad->PaintSegments(nbi/2, xli.data(), yli.data());
4252 pp->DrawLine(
x[0],
y[0],
x[1],
y[1]);
4265 pp->DrawLineNDC(u1,
v1, u2,
v2);
4282 for (i=0;i<3;i++) temp[i] = p1[i];
4283 fView->WCtoNDC(temp, &xpad[0]);
4284 for (i=0;i<3;i++) temp[i] = p2[i];
4285 fView->WCtoNDC(temp, &xpad[3]);
4286 PaintLine(xpad[0],xpad[1],xpad[3],xpad[4]);
4300 for (i=0;i<3;i++) temp[i] = p1[i];
4301 fView->WCtoNDC(temp, &xpad[0]);
4302 for (i=0;i<3;i++) temp[i] = p2[i];
4303 fView->WCtoNDC(temp, &xpad[3]);
4304 PaintLine(xpad[0],xpad[1],xpad[3],xpad[4]);
4315 fView->GetRange(rmin, rmax);
4323 if (
x<rmin[0] ||
x>rmax[0])
return;
4324 if (
y<rmin[1] ||
y>rmax[1])
return;
4325 if (z<rmin[2] || z>rmax[2])
return;
4326 fView->WCtoNDC(temp, &xpad[0]);
4343 Int_t i, i1=-1,np=1;
4344 for (i=0; i<
n-1; i++) {
4357 if (iclip == 0 && i <
n-2)
4361 pp->DrawPolyLine(np, &
x[i1], &
y[i1]);
4391 if (option && (option[0] ==
'C')) mustClip =
kFALSE;
4394 Int_t i, i1=-1, np = 1, iclip = 0;
4396 for (i=0; i <
n-1; i++) {
4411 if (iclip == 0 && i <
n-2)
4415 pp->DrawPolyLine(np, &
x[i1], &
y[i1]);
4440 pp->DrawPolyLineNDC(
n,
x,
y);
4454 for (
Int_t i = 1; i <
n; i++)
4473 for (i=0; i<
n; i++) {
4477 if (i <
n-1)
continue;
4483 pp->DrawPolyMarker(np, &
x[i1], &
y[i1]);
4504 for (i=0; i<
n; i++) {
4508 if (i <
n-1)
continue;
4514 pp->DrawPolyMarker(np, &
x[i1], &
y[i1]);
4538 if (option && *option ==
'C') mustClip =
kFALSE;
4544 for (
Int_t i = 0; i < 2*
n; i+=2) {
4547 x[i] =
y[i] =
x[i+1] =
y[i+1] = 0;
4556 pp->DrawSegments(
n,
x,
y);
4572 pp->DrawSegmentsNDC(
n, u,
v);
4614 pp->DrawTextUrl(
x,
y,
text, url);
4662 if (!
gPad)
return nullptr;
4669 if (
this !=
gPad->GetCanvas()) {
4678 TPad *pick =
nullptr;
4679 TPad *picked =
this;
4683 pickobj = &dummyLink;
4712 pick = ((
TPad*)obj)->
Pick(px, py, pickobj);
4717 }
else if (!
gROOT->GetEditorMode()) {
4724 if (dist == 0)
break;
4739 if (
fView && !gotPrim) {
4758 if (!button->
IsEditable()) pickobj =
nullptr;
4763 if (picked ==
this) {
4782 if (
this ==
fMother->GetListOfPrimitives()->Last())
4786 while (
auto obj = next())
4800 ((
TPad*)
this)->SaveAs(filename);
4811 while (
auto obj = next()) {
4985 TString psname, fs1 = filename;
5002 const char *opt_default =
"ps";
5004 TString opt = !option ? opt_default : option;
5008 if (strstr(opt,
"Title:")) title =
kTRUE;
5022 psname.
Prepend(
gEnv->GetValue(
"Canvas.PrintDirectory",
"."));
5027 if (!title && strstr(opt,
"gif+")) {
5030 }
else if (!title && strstr(opt,
"gif")) {
5033 }
else if (!title && strstr(opt,
"png")) {
5036 }
else if (!title && strstr(opt,
"jpg")) {
5039 }
else if (!title && strstr(opt,
"tiff")) {
5042 }
else if (!title && strstr(opt,
"xpm")) {
5045 }
else if (!title && strstr(opt,
"bmp")) {
5060 if (!
gROOT->IsBatch() && image) {
5063 Color_t hc =
gPad->GetCanvas()->GetHighLightColor();
5064 gPad->GetCanvas()->SetHighLightColor(-1);
5072 Info(
"Print",
"GIF file %s has been created", psname.
Data());
5074 gPad->GetCanvas()->SetHighLightColor(hc);
5078 Color_t hc =
gPad->GetCanvas()->GetHighLightColor();
5079 gPad->GetCanvas()->SetHighLightColor(-1);
5082 gPad->GetCanvasImp()->UpdateDisplay(1,
kTRUE);
5085 if (!
gSystem->AccessPathName(psname)) {
5086 Info(
"Print",
"file %s has been created", psname.
Data());
5088 gPad->GetCanvas()->SetHighLightColor(hc);
5090 Warning(
"Print",
"Unsupported image format %s", psname.
Data());
5096 if (!title && strstr(opt,
"cxx")) {
5102 if (!title && strstr(opt,
"root")) {
5108 if (!title && strstr(opt,
"xml")) {
5115 if (!title && strstr(opt,
"json")) {
5121 if (!title && strstr(opt,
"svg")) {
5134 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualPS",
"svg")) {
5135 if (
h->LoadPlugin() == -1)
5152 if (wasModified && !
IsBatch())
5155 if (!
gSystem->AccessPathName(psname))
5156 Info(
"Print",
"SVG file %s has been created", psname.
Data());
5165 if (!title && (strstr(opt,
"tex") || strstr(opt,
"Standalone"))) {
5178 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualPS",
"tex")) {
5179 if (
h->LoadPlugin() == -1)
5186 if (strstr(opt,
"Standalone")) standalone =
kTRUE;
5191 if (standalone)
gVirtualPS->SetTitle(
"Standalone");
5199 if (wasModified && !
IsBatch())
5202 if (!
gSystem->AccessPathName(psname)) {
5204 Info(
"Print",
"Standalone TeX file %s has been created", psname.
Data());
5206 Info(
"Print",
"TeX file %s has been created", psname.
Data());
5225 copen = psname.
EndsWith(
"(");
if (copen) psname[psname.
Length()-1] = 0;
5226 cclose = psname.
EndsWith(
")");
if (cclose) psname[psname.
Length()-1] = 0;
5227 copenb = psname.
EndsWith(
"[");
if (copenb) psname[psname.
Length()-1] = 0;
5228 ccloseb = psname.
EndsWith(
"]");
if (ccloseb) psname[psname.
Length()-1] = 0;
5232 if (copen || copenb) mustClose =
kFALSE;
5233 if (cclose || ccloseb) mustClose =
kTRUE;
5244 if (ratio < 1) pstype = 112;
5245 if (strstr(opt,
"Portrait")) pstype = 111;
5246 if (strstr(opt,
"Landscape")) pstype = 112;
5247 if (strstr(opt,
"eps")) pstype = 113;
5248 if (strstr(opt,
"Preview")) pstype = 113;
5255 const char *pluginName =
"ps";
5256 if (strstr(opt,
"pdf") || title || strstr(opt,
"EmbedFonts"))
5259 pluginName =
"image";
5261 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualPS", pluginName)) {
5262 if (
h->LoadPlugin() == -1)
5271 if (titlePos !=
kNPOS) {
5281 if (!strstr(opt,
"pdf") || image) {
5297 if (!
gSystem->AccessPathName(psname)) {
5298 if (!copen)
Info(
"Print",
"%s file %s has been created", opt.
Data(), psname.
Data());
5299 else Info(
"Print",
"%s file %s has been created using the current canvas", opt.
Data(), psname.
Data());
5308 if (titlePos !=
kNPOS) {
5311 }
else if (!ccloseb) {
5315 if (cclose)
Info(
"Print",
"Current canvas added to %s file %s and file closed", opt.
Data(), psname.
Data());
5316 else Info(
"Print",
"%s file %s has been closed", opt.
Data(), psname.
Data());
5321 Info(
"Print",
"Current canvas added to %s file %s", opt.
Data(), psname.
Data());
5326 if (wasModified && !
IsBatch())
5329 if (strstr(opt,
"Preview"))
5331 if (strstr(opt,
"EmbedFonts")) {
5332 gSystem->Exec(
TString::Format(
"gs -quiet -dSAFER -dNOPLATFONTS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=pdf_temp.pdf -f %s",
5333 psname.
Data()).Data());
5346 if ((x1 >= x2) || (y1 >= y2)) {
5347 Error(
"Range",
"illegal world coordinates range: x1=%f, y1=%f, x2=%f, y2=%f",x1,y1,x2,y2);
5356 if (
fX1 == x1 &&
fY1 == y1 &&
fX2 == x2 &&
fY2 == y2)
return;
5385 Error(
"RangeAxis",
"illegal axis coordinates range: xmin=%f, ymin=%f, xmax=%f, ymax=%f",
5405 if (obj ==
fCanvas->GetSelected())
fCanvas->SetSelected(
nullptr);
5406 if (obj ==
fCanvas->GetClickSelected())
fCanvas->SetClickSelected(
nullptr);
5425 if (res && modified)
5470 TH1 *hobj =
nullptr;
5476 while ((obj = next())) {
5488 if (
g) hobj =
g->GetHistogram();
5505 gPad->GetUxmax(),
gPad->GetUymax());
5507 b->SetLineStyle(
gPad->GetFrameLineStyle());
5508 b->SetLineWidth(
gPad->GetFrameLineWidth());
5509 b->SetLineColor(
gPad->GetFrameLineColor());
5641 Error(
"ResizePad",
"Cannot resize pad. No current pad available.");
5644 if (
gPad->GetWw()==0.0||
gPad->GetWh()==0.0) {
5645 Warning(
"ResizePad",
"gPad has at least one zero dimension.");
5649 Warning(
"ResizePad",
"The pad has at least one zero dimension.");
5654 if (
this ==
gPad->GetCanvas()) {
5662 Warning(
"ResizePad",
"The parent pad has at least one zero dimension.");
5711 while (
auto obj = next()) {
5713 ((
TPad *)obj)->ResizePad(option);
5717 if (
gPad->IsBatch())
5720 if (pp->IsNative()) {
5722 auto attl = pp->GetAttLine();
5723 attl.SetLineColor(-1);
5724 pp->SetAttLine(attl);
5725 auto attt = pp->GetAttText();
5726 attt.SetTextSize(-1);
5728 pp->SetAttText(attt);
5739 Warning(
"ResizePad",
"Inf/NaN propagated to the pad. Check drawn objects.");
5740 if (w <= 0 || w > 10000) {
5741 Warning(
"ResizePad",
"%s width changed from %d to %d\n",
GetName(),w,10);
5745 Warning(
"ResizePad",
"%s height changed from %d to %d\n",
GetName(),
h,10);
5750 else if (pp->ResizeDrawable(
fPixmapID, w,
h)) {
5800 Int_t lenfil = filename ? strlen(filename) : 0;
5803 else psname = filename;
5810 psname.
Prepend(
gEnv->GetValue(
"Canvas.PrintDirectory",
"."));
5814 ((
TPad*)
this)->Print(psname,
"gif");
5816 ((
TPad*)
this)->Print(psname,
"gif+");
5818 ((
TPad*)
this)->Print(psname,
"cxx");
5820 ((
TPad*)
this)->Print(psname,
"root");
5822 ((
TPad*)
this)->Print(psname,
"xml");
5824 ((
TPad*)
this)->Print(psname,
"json");
5826 ((
TPad*)
this)->Print(psname,
"eps");
5828 ((
TPad*)
this)->Print(psname,
"pdf");
5830 ((
TPad*)
this)->Print(psname,
"pdf");
5832 ((
TPad*)
this)->Print(psname,
"pdf");
5834 ((
TPad*)
this)->Print(psname,
"pdf");
5836 ((
TPad*)
this)->Print(psname,
"pdf");
5838 ((
TPad*)
this)->Print(psname,
"svg");
5840 ((
TPad*)
this)->Print(psname,
"tex");
5842 ((
TPad*)
this)->Print(psname,
"xpm");
5844 ((
TPad*)
this)->Print(psname,
"png");
5846 ((
TPad*)
this)->Print(psname,
"jpg");
5848 ((
TPad*)
this)->Print(psname,
"jpg");
5850 ((
TPad*)
this)->Print(psname,
"bmp");
5852 ((
TPad*)
this)->Print(psname,
"tiff");
5854 ((
TPad*)
this)->Print(psname,
"ps");
5867 auto p = padName.
Index(
" ");
5873 static Int_t pcounter = 0;
5878 const char *pname = padName.
Data();
5879 const char *cname = padName.
Data();
5881 if (padName.
Length() == 0) {
5883 if (
this ==
gPad->GetCanvas())
5890 if (
this !=
gPad->GetCanvas()) {
5892 out <<
"// ------------>Primitives in pad: " <<
GetName() <<
"\n";
5893 out <<
" TPad *" << cname <<
" = new TPad(\"" <<
GetName() <<
"\", \""
5896 out <<
" " << cname <<
"->Draw();\n";
5897 out <<
" " << cname <<
"->cd();\n";
5899 out <<
" " << cname <<
"->Range(" <<
fX1 <<
"," <<
fY1 <<
"," <<
fX2 <<
"," <<
fY2 <<
");\n";
5904 out <<
" TView::CreateView(1)->SetRange(" << rmin[0] <<
", " << rmin[1] <<
", " << rmin[2] <<
", " << rmax[0]
5905 <<
", " << rmax[1] <<
", " << rmax[2] <<
");\n";
5911 out <<
" " << cname <<
"->SetBorderMode(" <<
GetBorderMode() <<
");\n";
5913 out <<
" " << cname <<
"->SetBorderSize(" <<
GetBorderSize() <<
");\n";
5915 out <<
" " << cname <<
"->SetLogx();\n";
5917 out <<
" " << cname <<
"->SetLogy();\n";
5919 out <<
" " << cname <<
"->SetLogz();\n";
5921 out <<
" " << cname <<
"->SetGridx();\n";
5923 out <<
" " << cname <<
"->SetGridy();\n";
5925 out <<
" " << cname <<
"->SetTickx(" <<
GetTickx() <<
");\n";
5927 out <<
" " << cname <<
"->SetTicky(" <<
GetTicky() <<
");\n";
5929 out <<
" " << cname <<
"->SetTheta(" <<
GetTheta() <<
");\n";
5931 out <<
" " << cname <<
"->SetPhi(" <<
GetPhi() <<
");\n";
5933 out <<
" " << cname <<
"->SetLeftMargin(" <<
GetLeftMargin() <<
");\n";
5935 out <<
" " << cname <<
"->SetRightMargin(" <<
GetRightMargin() <<
");\n";
5937 out <<
" " << cname <<
"->SetTopMargin(" <<
GetTopMargin() <<
");\n";
5939 out <<
" " << cname <<
"->SetBottomMargin(" <<
GetBottomMargin() <<
");\n";
5963 out <<
" " << cname <<
"->SetFrameFillStyle(" << frame->
GetFillStyle() <<
");\n";
5965 out <<
" " << cname <<
"->SetFrameLineStyle(" << frame->
GetLineStyle() <<
");\n";
5969 out <<
" " << cname <<
"->SetFrameLineWidth(" << frame->
GetLineWidth() <<
");\n";
5971 out <<
" " << cname <<
"->SetFrameBorderMode(" << frame->
GetBorderMode() <<
");\n";
5973 out <<
" " << cname <<
"->SetFrameBorderSize(" << frame->
GetBorderSize() <<
");\n";
5978 while (
auto obj = next()) {
5982 out <<
" " << pname <<
"->cd();\n";
5984 out <<
" " << cname <<
"->cd();\n";
5987 out <<
" " << cname <<
"->Modified();\n";
6000 Error(
"SetAspectRatio",
"cannot fix aspect ratio, height of pad is 0");
6024 while ((obj = next())) {
6038 if (fstyle == 0) fstyle = 4000;
6101 if ((xlow < 0) || (xlow > 1) || (ylow < 0) || (ylow > 1)) {
6102 Error(
"TPad",
"illegal bottom left position: x=%f, y=%f", xlow, ylow);
6105 if ((xup < 0) || (xup > 1) || (yup < 0) || (yup > 1)) {
6106 Error(
"TPad",
"illegal top right position: x=%f, y=%f", xup, yup);
6109 if (xup-xlow <= 0) {
6110 Error(
"TPad",
"illegal width: %f", xup-xlow);
6113 if (yup-ylow <= 0) {
6114 Error(
"TPad",
"illegal height: %f", yup-ylow);
6151 SetPad(xlow, ylow, xup, yup);
6159 if (!view)
delete fView;
6172 pp->SetAttFill({color,
style});
6184 pp->SetAttLine({color,
style, lwidth});
6196 pp->SetAttMarker({color,
style, msize});
6208 if (font % 10 > 2) {
6221 pp->SetAttText({align, angle, color, font, tsize});
6233 x1 = x2 = y1 = y2 = 0;
6235 if (aBBox.
fX<bBBox.
fX) {
6251 else if (mode ==
'y') {
6252 if (aBBox.
fY<bBBox.
fY) {
6318 !
gEnv->GetValue(
"Canvas.ShowGuideLines", 0))
return;
6320 std::vector<dField> curDist;
6321 std::vector<dField> otherDist;
6331 Int_t dSizeArrow = 12;
6333 movedX = movedY =
false;
6336 if (mode !=
'i') resize =
true;
6345 static TPad *tmpGuideLinePad =
nullptr;
6348 if (tmpGuideLinePad) {
6350 auto guidePadClicked = (
object == tmpGuideLinePad);
6351 tmpGuideLinePad->
Delete();
6352 tmpGuideLinePad =
nullptr;
6353 if (guidePadClicked)
return;
6357 prims =
gPad->GetListOfPrimitives();
6364 if (!tmpGuideLinePad){
6365 tmpGuideLinePad =
new TPad(
"tmpGuideLinePad",
"tmpGuideLinePad", 0, 0, 1, 1);
6367 gPad->GetRange(x1, y1, x2, y2);
6368 tmpGuideLinePad->
Range(x1, y1, x2, y2);
6371 tmpGuideLinePad->
Draw();
6372 tmpGuideLinePad->
cd();
6373 gPad->GetRange(x1, y1, x2, y2);
6375 if (cling && !log) threshold = 7;
6388 MX =
gPad->GetX1() + 0.5 * (
gPad->GetX2()-
gPad->GetX1());
6389 MY =
gPad->GetY1() + 0.5 * (
gPad->GetY2()-
gPad->GetY1());
6390 pMX =
gPad->XtoPixel(MX);
6391 pMY =
gPad->YtoPixel(MY);
6394 if (cling && (!resize)) {
6402 L->SetLineColor(lineColor);
6406 if (cling && (!resize)) {
6414 L->SetLineColor(lineColor);
6418 for (
UInt_t i = 0; i<
n; i++) {
6424 if (cling && (!resize)) {
6431 L->SetLineColor(lineColor);
6436 if (cling && (!resize)) {
6444 L->SetLineColor(lineColor);
6451 for (
UInt_t i = 0; i<
n; i++) {
6454 aBBox =
a->GetBBox();
6455 for (
UInt_t j = i+1; j<
n; j++) {
6458 bBBox =
b->GetBBox();
6466 if ((
b != cur)&&(
a != cur)) otherDist.push_back(abDist);
6467 else curDist.push_back(abDist);
6474 if ((
b != cur)&&(
a != cur)) otherDist.push_back(abDist);
6475 else curDist.push_back(abDist);
6483 for (
UInt_t i = 0; i<curDist.size(); i++) {
6484 for (
UInt_t j = 0; j<otherDist.size(); j++) {
6485 if ((curDist[i].fdir == otherDist[j].fdir) && (otherDist[j].fdir==
'x') && (
TMath::Abs(curDist[i].fdist-otherDist[j].fdist)<threshold)) {
6486 if (cling && (!movedX) && (!resize)) {
6492 DrawDist(curDist[i].fa->GetBBox(), curDist[i].fb->GetBBox(),
'x');
6493 DrawDist(otherDist[j].fa->GetBBox(), otherDist[j].fb->GetBBox(),
'x');
6495 if ((curDist[i].fdir == otherDist[j].fdir) && (otherDist[j].fdir==
'y') && (
TMath::Abs(curDist[i].fdist-otherDist[j].fdist)<threshold)) {
6496 if (cling && (!movedY) && (!resize)) {
6502 DrawDist(curDist[i].fa->GetBBox(), curDist[i].fb->GetBBox(),
'y');
6503 DrawDist(otherDist[j].fa->GetBBox(), otherDist[j].fb->GetBBox(),
'y');
6506 for (
UInt_t j = i; j<curDist.size(); j++) {
6508 if ((curDist[i].fdir == curDist[j].fdir) && (curDist[j].fdir==
'x') && (
TMath::Abs(curDist[i].fdist-curDist[j].fdist)<threshold)) {
6509 if (cling && (!movedX) && (!resize)) {
6514 DrawDist(curDist[i].fa->GetBBox(), curDist[i].fb->GetBBox(),
'x');
6515 DrawDist(curDist[j].fa->GetBBox(), curDist[j].fb->GetBBox(),
'x');
6518 if ((curDist[i].fdir == curDist[j].fdir) && (curDist[j].fdir==
'y') && (
TMath::Abs(curDist[i].fdist-curDist[j].fdist)<threshold)) {
6519 if (cling && (!movedY) && (!resize)) {
6524 DrawDist(curDist[i].fa->GetBBox(), curDist[i].fb->GetBBox(),
'y');
6525 DrawDist(curDist[j].fa->GetBBox(), curDist[j].fb->GetBBox(),
'y');
6532 for (
UInt_t i = 0; i<
n; i++) {
6534 if (
a && (cur !=
a)) {
6535 aBBox =
a->GetBBox();
6547 gPad->PixeltoX(aBBox.
fX+aBBox.
fWidth),
gPad->PixeltoY(aBBox.
fY-dSizeArrow-
gPad->VtoPixel(0)), 0.01,
"<|>");
6589 if (tmpGuideLinePad) {
6592 tmpGuideLinePad->
Delete();
6593 tmpGuideLinePad =
nullptr;
6679 Int_t nch, nobjects;
6682 if (
b.IsReading()) {
6701 while ((obj = next())) {
6723 b >> single;
fX1 = single;
6724 b >> single;
fY1 = single;
6725 b >> single;
fX2 = single;
6726 b >> single;
fY2 = single;
6733 b >> single;
fX1 = single;
6734 b >> single;
fY1 = single;
6735 b >> single;
fX2 = single;
6736 b >> single;
fY2 = single;
6763 b >> single;
fWNDC = single;
6764 b >> single;
fHNDC = single;
6838 char drawoption[64];
6839 for (
Int_t i = 0; i < nobjects; i++) {
6842 b.ReadFastArray(drawoption,nch);
6864 b >> single;
fPhi = single;
6892 if (
gStyle->IsReading()) {
6928 while ((obj = next())) {
6934 if (
gStyle->IsReading()) {
6935 title->SetFillColor(
gStyle->GetTitleFillColor());
6936 title->SetTextFont(
gStyle->GetTitleFont(
""));
6937 title->SetTextColor(
gStyle->GetTitleTextColor());
6938 title->SetBorderSize(
gStyle->GetTitleBorderSize());
6939 if (!
gStyle->GetOptTitle())
delete title;
6941 gStyle->SetTitleFillColor(title->GetFillColor());
6942 gStyle->SetTitleFont(title->GetTextFont());
6943 gStyle->SetTitleTextColor(title->GetTextColor());
6944 gStyle->SetTitleBorderSize(title->GetBorderSize());
7015 if (emode && strlen(emode))
gROOT->SetEditorMode(emode);
7016 if (
gROOT->GetEditorMode() == 0 && pname && strlen(pname) > 2)
gROOT->SetEditorMode(&pname[1]);
7020 TObject *oldlast =
gPad->GetListOfPrimitives() ?
gPad->GetListOfPrimitives()->Last() :
nullptr;
7023 Bool_t hasname = pname && (strlen(pname) > 0);
7024 if ((!pname || !pname[0]) && (!emode || !emode[0])) testlast =
kTRUE;
7025 if (testlast)
gROOT->SetEditorMode();
7027 if (
gROOT->GetEditorMode() == 0) {
7030 if (obj)
return obj;
7033 if (!
gPad->GetListOfPrimitives())
return nullptr;
7034 obj =
gPad->GetListOfPrimitives()->Last();
7035 if (obj != oldlast)
return obj;
7056 if (
gPad->IsBatch())
return nullptr;
7080 (
size_t)tip,(
size_t)
this).Data());
7098 ::Info(
"TPad::x3d()",
"This function is deprecated. Use %s->GetViewer3D(\"x3d\") instead",this->
GetName());
7101 if (!type || !type[0]) {
7118 if ((!type || !*type || (strstr(type,
"gl") && !strstr(type,
"ogl"))) && (!
fCanvas || !
fCanvas->UseGL()))
7121 if (type && *type) {
7122 if (
gPluginMgr->FindHandler(
"TVirtualViewer3D", type))
7142 if (!strstr(type,
"pad")) {
7146 Warning(
"GetViewer3D",
"Cannot create 3D viewer of type: %s", type);
7151 if (strstr(type,
"gl") && !strstr(type,
"ogl")) {
7156 createdExternal =
kTRUE;
7174 if (createdExternal) {
7228 return fCanvas->GetCanvasPainter();
const Int_t kMaxPixel
Max value for an int.
int Int_t
Signed integer 4 bytes (int).
float Size_t
Attribute size (float).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
short Version_t
Class version identifier (short).
int Ssiz_t
String size (currently int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
short Width_t
Line width (short).
bool Bool_t
Boolean (0=false, 1=true) (bool).
short Short_t
Signed Short integer 2 bytes (short).
double Double_t
Double 8 bytes.
short Color_t
Color number (short).
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
short Style_t
Style number (short).
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
Double_t pixel_boundary(Double_t v)
Check value for valid range for pixel values.
static Bool_t ContainsTImage(TList *li)
Auxiliary function.
externTPluginManager * gPluginMgr
externTVirtualMutex * gROOTMutex
#define R__LOCKGUARD(mutex)
externTVirtualPS * gVirtualPS
externInt_t(* gThreadXAR)(const char *xact, Int_t nb, void **ar, Int_t *iret)
void Draw(Option_t *option="") override
Default Draw method for all objects.
Abstract base class for elements drawn in the editor.
virtual void SetBBoxCenterY(const Int_t y)=0
virtual void SetBBoxCenterX(const Int_t x)=0
virtual void SetBBoxX1(const Int_t x)=0
virtual void SetBBoxY1(const Int_t y)=0
virtual void SetBBoxX2(const Int_t x)=0
virtual void SetBBoxY2(const Int_t y)=0
virtual Rectangle_t GetBBox()=0
virtual TPoint GetBBoxCenter()
virtual void Streamer(TBuffer &)
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual Bool_t IsTransparent() const
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
virtual void Streamer(TBuffer &)
virtual Color_t GetLineColor() const
Return the line color.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Width_t fLineWidth
Line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
void Copy(TAttLine &attline) const
virtual void SetBottomMargin(Float_t bottommargin)
Set Pad bottom margin in fraction of the pad height.
Color_t GetFrameFillColor() const
virtual void SetLeftMargin(Float_t leftmargin)
Set Pad left margin in fraction of the pad width.
Color_t GetFrameLineColor() const
Style_t GetFrameLineStyle() const
Float_t fRightMargin
RightMargin.
Style_t GetFrameFillStyle() const
Float_t fLeftMargin
LeftMargin.
Float_t fTopMargin
TopMargin.
Float_t GetLeftMargin() const
Width_t GetFrameLineWidth() const
Float_t GetBottomMargin() const
virtual void SetRightMargin(Float_t rightmargin)
Set Pad right margin in fraction of the pad width.
Float_t GetRightMargin() const
Int_t GetFrameBorderMode() const
virtual void SetTopMargin(Float_t topmargin)
Set Pad top margin in fraction of the pad height.
Width_t GetFrameBorderSize() const
Float_t fBottomMargin
BottomMargin.
Float_t GetTopMargin() const
virtual void Streamer(TBuffer &)
Stream an object of class TAttPad.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Class to manage histogram axis.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual Int_t FindFixBin(Double_t x) const
Find bin number corresponding to abscissa x.
Int_t GetLast() const
Return last bin on the axis i.e.
virtual void SetLimits(Double_t xmin, Double_t xmax)
virtual TObject * GetParent() const
virtual void SetRange(Int_t first=0, Int_t last=0)
Set the viewing range for the axis using bin numbers.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Int_t GetFirst() const
Return first bin on the axis i.e.
Each class (see TClass) has a linked list of its base class(es).
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
virtual void SetY2(Double_t y2)
virtual void SetX1(Double_t x1)
virtual void SetX2(Double_t x2)
virtual void SetY1(Double_t y1)
Using a TBrowser one can browse all ROOT objects.
Buffer base class used for serializing objects.
ABC describing GUI independent main window (with menubar, scrollbars and a drawing area).
virtual Int_t RequestLocator(Int_t &x, Int_t &y)
Request current mouse pointer, redirect to gVirtualX.
void SaveSource(const char *filename="", Option_t *option="")
Save primitives in this canvas as a C++ macro file.
Int_t GetCanvasID() const override
void FeedbackMode(Bool_t set)
Turn rubberband feedback mode on or off.
UInt_t GetWw() const override
UInt_t GetWh() const override
void SetBatch(Bool_t batch=kTRUE) override
Toggle batch mode.
TClass instances represent classes, structs and namespaces in the ROOT type system.
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
Int_t GetNmethods()
Return the number of methods of this class Note that in case the list of methods is not yet created,...
Int_t GetNdata()
Return the number of data members of this class Note that in case the list of data members is not yet...
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
static Int_t GetColor(const char *hexcolor)
static void SetGrayscale(Bool_t set=kTRUE)
static TString SavePrimitiveColor(Int_t ci)
virtual void SetAlpha(Float_t a)
static void Pave(Int_t event, Int_t px, Int_t py, Int_t mode)
Create a new pavetext in gPad.
static void Line(Int_t event, Int_t px, Int_t py, Int_t mode)
Create a new line/arrow in this gPad.
static void PolyLine(Int_t event, Int_t px, Int_t py, Int_t mode)
Create a new PolyLine in gPad.
static void Text(Int_t event, Int_t px, Int_t py, Int_t mode)
Create a new TLatex at the cursor position in gPad.
static void Ellipse(Int_t event, Int_t px, Int_t py, Int_t mode)
Create a new arc/ellipse in this gPad.
static void Pad(Int_t event, Int_t px, Int_t py, Int_t)
Create a new pad in gPad.
All ROOT classes may have RTTI (run time type identification) support added.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * AsSQLString() const
Return the date & time in SQL compatible string format, like: 1997-01-15 20:16:28.
const char * AsString() const
Return the date & time as a string (ctime() format).
TExec is a utility class that can be used to execute a C++ command when some event happens in a pad.
void Paint(Option_t *option="") override
Paint this wbox with its current attributes.
@ kClipFrame
Clip to the frame boundary.
1-D histogram with a float per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
virtual Double_t GetNormFactor() const
virtual Int_t GetDimension() const
@ kNoStats
Don't draw stats box.
@ kIsZoomed
Bit set when zooming on Y axis.
virtual Double_t GetSumOfWeights() const
Return the sum of weights across all bins excluding under/overflows.
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
virtual void SetMaximum(Double_t maximum=-1111)
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual void SetMinimum(Double_t minimum=-1111)
virtual TH1 * DrawCopy(Option_t *option="", const char *name_postfix="_copy") const
Copy this histogram and Draw in the current pad.
virtual Int_t GetMaximumBin() const
Return location of bin with maximum value in the range.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual Int_t GetMinimumBin() const
Return location of bin with minimum value in the range.
virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Return minimum value larger than minval of bins in the range, unless the value has been overridden by...
TH1 * GetHistogram() const
Option_t * GetOption() const
Use the TLine constructor to create a simple line.
Option_t * GetOption() const override
Returns the object option stored in the list.
TObject * After(const TObject *obj) const override
Returns the object after object obj.
virtual TObjLink * LastLink() const
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
virtual TObjLink * FirstLink() const
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
void AddFirst(TObject *obj) override
Add object at the beginning of the list.
Each ROOT class (see TClass) has a linked list of methods.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Wrapper around a TObject so it can be stored in a TList.
void SetObject(TObject *obj)
TObject * GetObject() const
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Computes distance from point (px,py) to the object.
Bool_t TestBit(UInt_t f) const
virtual const char * GetName() const
Returns name of object.
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void UseCurrentStyle()
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyl...
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
virtual void Delete(Option_t *option="")
Delete this object.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * GetTitle() const
Returns title of object.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
virtual void Paint(Option_t *option="")
This method must be overridden if a class wants to paint itself.
TObject()
TObject constructor.
@ kCannotPick
if object in a pad cannot be picked
@ kCanDelete
if object in a list can be deleted
@ kMustCleanup
if object destructor must call RecursiveRemove()
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
The most important graphics class in the ROOT system.
Short_t GetBorderMode() const override
Bool_t OpaqueMoving() const override
Is pad moving in opaque mode ?
void PaintTextNDC(Double_t u, Double_t v, const char *text) override
Paint text in CurrentPad NDC coordinates.
Int_t GetTicky() const override
virtual Int_t Clip(Float_t *x, Float_t *y, Float_t xclipl, Float_t yclipb, Float_t xclipr, Float_t yclipt)
Clipping routine: Cohen Sutherland algorithm.
virtual void HideToolTip(Int_t event)
Hide tool tip depending on the event type.
Double_t fAbsYlowNDC
Absolute Y top left corner of pad in NDC [0,1].
Double_t fXtoAbsPixelk
Conversion coefficient for X World to absolute pixel.
void SetAttMarkerPS(Color_t color, Style_t style, Size_t msize) override
Set postscript marker attributes.
virtual void DivideSquare(Int_t n, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
"n" is the total number of sub-pads.
void AbsCoordinates(Bool_t set) override
Bool_t IsBatch() const override
Is pad in batch mode ?
Double_t GetUymax() const override
Returns the maximum y-coordinate value visible on the pad. If log axis the returned value is in decad...
void AddExec(const char *name, const char *command) override
Add a new TExec object to the list of Execs.
Double_t fWNDC
Width of pad along X in Normalized Coordinates (NDC).
Int_t NextPaletteColor() override
Get the next autocolor in the pad.
Int_t VtoPixel(Double_t v) const override
Convert Y NDC to pixel.
void PaintBorder(Color_t color, Bool_t tops)
Paint the pad border.
Double_t GetPhi() const override
Bool_t IsEditable() const override
void FillCollideGrid(TObject *o)
Initialise the grid used to find empty space when adding a box (Legend) in a pad.
void SetView(TView *view=nullptr) override
Set the current TView. Delete previous view if view=0.
TVirtualViewer3D * GetViewer3D(Option_t *type="") override
Create/obtain handle to 3D viewer.
Double_t fPixeltoYk
Conversion coefficient for pixel to Y World.
void PaintHatches(Double_t dy, Double_t angle, Int_t nn, Double_t *xx, Double_t *yy)
This routine draw hatches inclined with the angle "angle" and spaced of "dy" in normalized device coo...
void PaintLine3D(Float_t *p1, Float_t *p2) override
Paint 3-D line in the CurrentPad.
static Int_t fgMaxPickDistance
Maximum Pick Distance.
void ResizePad(Option_t *option="") override
Compute pad conversion coefficients.
void PaintMarker3D(Double_t x, Double_t y, Double_t z) override
Paint 3-D marker in the CurrentPad.
void PaintPolyMarker(Int_t n, Float_t *x, Float_t *y, Option_t *option="") override
Paint polymarker in CurrentPad World coordinates.
Double_t fPhi
phi angle to view as lego/surface
Double_t fPixeltoY
yworld = fPixeltoYk + fPixeltoY*ypixel
virtual void RecordLatex(const TObject *obj)
Emit RecordLatex() signal.
Double_t fAbsXlowNDC
Absolute X top left corner of pad in NDC [0,1].
Double_t fVtoPixelk
Conversion coefficient for V NDC to pixel.
Bool_t fGridx
Set to true if grid along X.
TObject * fPadView3D
! 3D View of this TPad
Double_t GetUxmax() const override
Returns the maximum x-coordinate value visible on the pad. If log axis the returned value is in decad...
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
Automatic pad generation by division.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitives in this pad on the C++ source file out.
void CopyBackgroundPixmaps(TPad *stop, Int_t x, Int_t y)
Copy pixmaps of pads laying below pad "stop" into pad "stop".
Double_t fXtoPixel
xpixel = fXtoPixelk + fXtoPixel*xworld
TList * fExecs
List of commands to be executed when a pad event occurs.
Double_t PadtoY(Double_t y) const override
Convert y from pad to Y.
Int_t fTickx
Set to 1 if tick marks along X.
void SetBBoxY1(const Int_t y) override
Set top of BoundingBox to a value (resize in y direction on top).
Int_t fTicky
Set to 1 if tick marks along Y.
Int_t GetPixmapID() const override
TPad(const TPad &pad)=delete
Bool_t GetGridx() const override
Double_t fX2
X of upper X coordinate.
Bool_t PlaceBox(TObject *o, Double_t w, Double_t h, Double_t &xl, Double_t &yb, Option_t *option="lb") override
Place a box in NDC space.
void SetLogz(Int_t value=1) override
Set Lin/Log scale for Z.
Int_t UtoAbsPixel(Double_t u) const override
Convert X NDC to absolute pixel.
void Browse(TBrowser *b) override
Browse pad.
Int_t XtoPixel(Double_t x) const override
Convert X coordinate to pixel.
void SetAttFillPS(Color_t color, Style_t style) override
Set postscript fill area attributes.
Int_t fCGnx
! Size of the collide grid along x
void SetBBoxCenterY(const Int_t y) override
Set Y coordinate of the center of the Pad.
Double_t fPixeltoX
xworld = fPixeltoXk + fPixeltoX*xpixel
~TPad() override
Pad destructor.
Double_t fYtoPixel
ypixel = fYtoPixelk + fYtoPixel*yworld
Double_t GetY2() const override
void DeleteToolTip(TObject *tip) override
Delete tool tip object.
void Close(Option_t *option="") override
Delete all primitives in pad and pad itself.
void AbsPixeltoXY(Double_t xpixel, Double_t ypixel, Double_t &x, Double_t &y) override
Convert absolute pixel into X/Y coordinates.
Double_t fAbsWNDC
Absolute Width of pad along X in NDC.
TObject * Remove(TObject *obj, Bool_t modified=kTRUE) override
Remove object from list of primitives When.
UInt_t GetWw() const override
Get canvas width.
void PaintModified() override
Traverse pad hierarchy and (re)paint only modified pads.
void SetEditable(Bool_t mode=kTRUE) override
Set pad editable yes/no If a pad is not editable:
const char * GetTitle() const override
Returns title of object.
void PaintDate()
Paint the current date and time if the option Date is set on via gStyle->SetOptDate() Paint the curre...
static void SetMaxPickDistance(Int_t maxPick=5)
static function to set the maximum Pick Distance fgMaxPickDistance This parameter is used in TPad::Pi...
void PixeltoXY(Double_t xpixel, Double_t ypixel, Double_t &x, Double_t &y) override
Convert pixel to X/Y coordinates.
void SetBBoxX2(const Int_t x) override
Set right hand side of BoundingBox to a value (resize in x direction on right).
void SetBBoxX1(const Int_t x) override
Set lefthandside of BoundingBox to a value (resize in x direction on left).
virtual Int_t ClippingCode(Double_t x, Double_t y, Double_t xcl1, Double_t ycl1, Double_t xcl2, Double_t ycl2)
Compute the endpoint codes for TPad::Clip.
Double_t GetUymin() const override
Returns the minimum y-coordinate value visible on the pad. If log axis the returned value is in decad...
Double_t fX1
X of lower X coordinate.
TList * GetListOfPrimitives() const override
void SetFillStyle(Style_t fstyle) override
Override TAttFill::FillStyle for TPad because we want to handle style=0 as style 4000.
Double_t AbsPixeltoY(Double_t py) override
TH1F * DrawFrame(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, const char *title="") override
Draw an empty pad frame with X and Y axis.
Double_t fVtoPixel
ypixel = fVtoPixelk + fVtoPixel*vndc
TCanvasImp * GetCanvasImp() const override
Get canvas implementation pointer if any.
Int_t GetEvent() const override
Get Event.
Double_t PadtoX(Double_t x) const override
Convert x from pad to X.
virtual void DrawCrosshair()
Function called to draw a crosshair in the canvas.
Double_t YtoPad(Double_t y) const override
Convert y from Y to pad.
virtual void RangeChanged()
Double_t fUymin
Minimum value on the Y axis.
void SetPad(const char *name, const char *title, Double_t xlow, Double_t ylow, Double_t xup, Double_t yup, Color_t color=35, Short_t bordersize=5, Short_t bordermode=-1) override
Set all pad parameters.
void SetCursor(ECursor cursor) override
Set cursor type.
Int_t GetCanvasID() const override
Get canvas identifier.
Int_t fLogz
(=0 if Z linear scale, =1 if log scale)
Int_t HtoAbsPixel(Double_t y1, Double_t y2) const override
Convert a vertical distance [y1,y2] to pixel.
void XYtoPixel(Double_t x, Double_t y, Int_t &xpixel, Int_t &ypixel) const override
Convert X/Y into pixel coordinates - integer.
Double_t fYtoPixelk
Conversion coefficient for Y World to pixel.
void UpdateAsync() override
Asynchronous pad update.
TPad()
Pad default constructor.
void UseCurrentStyle() override
Force a copy of current style for all objects in pad.
static Int_t GetMaxPickDistance()
Static function (see also TPad::SetMaxPickDistance).
Int_t VtoAbsPixel(Double_t v) const override
Convert Y NDC to absolute pixel.
void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Set world coordinate system for the pad.
Double_t fUtoPixelk
Conversion coefficient for U NDC to pixel.
void XYtoAbsPixel(Double_t x, Double_t y, Int_t &xpixel, Int_t &ypixel) const override
Convert X/Y into absolute pixel coordinates - integer.
Double_t fPixeltoXk
Conversion coefficient for pixel to X World.
Bool_t IsModified() const override
Double_t fY1
Y of lower Y coordinate.
Int_t GetEventY() const override
Get Y event.
Int_t fGLDevice
! OpenGL off-screen pixmap identifier
Double_t fYlowNDC
Y bottom left corner of pad in NDC [0,1].
TObject * WaitPrimitive(const char *pname="", const char *emode="") override
Loop and sleep until a primitive with name=pname is found in the pad.
void SetAttTextPS(Int_t align, Float_t angle, Color_t color, Style_t font, Float_t tsize) override
Set postscript text attributes.
Bool_t fModified
Set to true when pad is modified.
Double_t PixeltoY(Double_t py) override
Convert pixel to Y coordinate.
TLegend * BuildLegend(Double_t x1=0.3, Double_t y1=0.21, Double_t x2=0.3, Double_t y2=0.21, const char *title="", Option_t *option="") override
Build a legend from the graphical objects in the pad.
virtual TPad * Pick(Int_t px, Int_t py, TObjLink *&pickobj)
Search for an object at pixel position px,py.
void Update() override
Update pad.
virtual void SetNumber(Int_t number)
Int_t fNumber
pad number identifier
void PaintFillAreaNDC(Int_t n, Double_t *x, Double_t *y, Option_t *option="") override
Paint fill area in CurrentPad NDC coordinates.
Double_t fAbsPixeltoXk
Conversion coefficient for absolute pixel to X World.
void Clear(Option_t *option="") override
Delete all pad primitives.
Int_t YtoPixel(Double_t y) const override
Convert Y coordinate to pixel.
Int_t GetTickx() const override
void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Paint line in CurrentPad World coordinates.
Int_t GetGLDevice() override
Get GL device.
Double_t fAspectRatio
ratio of w/h in case of fixed ratio
virtual void RecordPave(const TObject *obj)
Emit RecordPave() signal.
void PaintBorderPS(Double_t xl, Double_t yl, Double_t xt, Double_t yt, Int_t bmode, Int_t bsize, Int_t dark, Int_t light) override
Paint a frame border with Postscript - no longer used.
Double_t fUymax
Maximum value on the Y axis.
void SetLogy(Int_t value=1) override
Set Lin/Log scale for Y.
virtual Int_t ClipPolygon(Int_t n, Double_t *x, Double_t *y, Int_t nn, Double_t *xc, Double_t *yc, Double_t xclipl, Double_t yclipb, Double_t xclipr, Double_t yclipt)
Clip polygon using the Sutherland-Hodgman algorithm.
void ExecuteEventAxis(Int_t event, Int_t px, Int_t py, TAxis *axis) override
Execute action corresponding to one event for a TAxis object (called by TAxis::ExecuteEvent....
void HighLight(Color_t col=kRed, Bool_t set=kTRUE) override
Highlight pad.
Double_t AbsPixeltoX(Double_t px) override
void SetBatch(Bool_t batch=kTRUE) override
Set pad in batch mode.
TCanvas * fCanvas
! Pointer to mother canvas
TVirtualPad * GetMother() const override
TVirtualViewer3D * fViewer3D
! Current 3D viewer
virtual void x3d(Option_t *type="")
Deprecated: use TPad::GetViewer3D() instead.
Bool_t HasCrosshair() const override
Return kTRUE if the crosshair has been activated (via SetCrosshair).
Bool_t IsRetained() const override
Is pad retained ?
Bool_t Collide(Int_t i, Int_t j, Int_t w, Int_t h)
Check if a box of size w and h collide some primitives in the pad at position i,j.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a box.
Bool_t fFixedAspectRatio
True if fixed aspect ratio.
void PaintFillArea(Int_t n, Float_t *x, Float_t *y, Option_t *option="") override
void Modified(Bool_t flag=true) override
Mark pad modified Will be repainted when TCanvas::Update() will be called next time.
void RecursiveRemove(TObject *obj) override
Recursively remove object from a pad and its sub-pads.
void DivideRatios(Int_t nrows, Int_t ncolumns, const std::vector< double > &widthRatios={}, const std::vector< double > &heightRatios={}, const double canvasTopMargin=0., const double canvasLeftMargin=0.)
Divide the canvas according to ratios.
Bool_t HasFixedAspectRatio() const override
void CloseToolTip(TObject *tip) override
Hide tool tip.
Double_t GetUxmin() const override
Returns the minimum x-coordinate value visible on the pad. If log axis the returned value is in decad...
void SetToolTipText(const char *text, Long_t delayms=1000) override
Set tool tip text associated with this pad.
void PaintPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="") override
Paint polyline in CurrentPad World coordinates.
Int_t WtoAbsPixel(Double_t x1, Double_t x2) const override
Convert a horizontal distance [x1,x2] to pixel.
void ls(Option_t *option="") const override
List all primitives in pad.
TView * GetView() const override
void ModifiedUpdate() override
Short cut to call Modified() and Update() in a single call.
Double_t fVtoAbsPixelk
Conversion coefficient for V NDC to absolute pixel.
UInt_t GetPadHeight() const override
Get pad height.
TVirtualPad * GetPadSave() const override
Get save pad.
void SetAttLinePS(Color_t color, Style_t style, Width_t lwidth) override
Set postscript line attributes.
TClass * IsA() const override
TVirtualPad * GetVirtCanvas() const override
Get virtual canvas.
void DeleteExec(const char *name) override
Remove TExec name from the list of Execs.
void PaintSegments(Int_t n, Double_t *x, Double_t *y, Option_t *option="") override
Paint N individual segments Provided arrays should have 2*n elements IMPORTANT!
UInt_t GetPadWidth() const override
Get pad width.
void Streamer(TBuffer &) override
Stream a class object.
void PaintSegmentsNDC(Int_t n, Double_t *u, Double_t *v) override
Paint N individual segments in NDC coordinates Provided arrays should have 2*n elements IMPORTANT!
void CopyPixmaps() override
Copy the sub-pixmaps of the pad to the canvas.
void CopyPixmap() override
Copy the pixmap of the pad to the canvas.
Double_t GetY1() const override
Int_t UtoPixel(Double_t u) const override
Convert X NDC to pixel.
TPoint GetBBoxCenter() override
Return the center of the Pad as TPoint in pixels.
void FillCollideGridTFrame(TObject *o)
Bool_t GetGridy() const override
void LineNotFree(Int_t x1, Int_t x2, Int_t y1, Int_t y2)
Mark as "not free" the cells along a line.
Double_t fAbsHNDC
Absolute Height of pad along Y in NDC.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
TObject * fTip
! tool tip associated with box
void SetCanvasSize(UInt_t ww, UInt_t wh) override
Set canvas size.
Int_t GetLogz() const override
virtual void AutoExec()
Execute the list of Execs when a pad event occurs.
Bool_t fAbsCoord
Use absolute coordinates.
Int_t fNumPaletteColor
Number of objects with an automatic color.
Int_t fCrosshairPos
Position of crosshair.
void FillCollideGridTGraph(TObject *o)
void SetFixedAspectRatio(Bool_t fixed=kTRUE) override
Fix pad aspect ratio to current value if fixed is true.
Short_t GetBorderSize() const override
void RedrawAxis(Option_t *option="") override
Redraw the frame axis.
void DrawDist(Rectangle_t aBBox, Rectangle_t bBBox, char mode)
Draw Arrows to indicated equal distances of Objects with given BBoxes.
Int_t fLogx
(=0 if X linear scale, =1 if log scale)
Double_t GetAbsWNDC() const override
Int_t YtoAbsPixel(Double_t y) const override
Convert Y coordinate to absolute pixel.
Double_t fUtoPixel
xpixel = fUtoPixelk + fUtoPixel*undc
Int_t fCrosshair
Crosshair type (0 if no crosshair requested).
void PaintFillAreaHatches(Int_t n, Double_t *x, Double_t *y, Int_t FillStyle)
This function paints hatched fill area according to the FillStyle value The convention for the Hatch ...
void RangeAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax) override
Set axis coordinate system for the pad.
Double_t fUtoAbsPixelk
Conversion coefficient for U NDC to absolute pixel.
void ResetToolTip(TObject *tip) override
Reset tool tip, i.e.
Double_t GetTheta() const override
TList * fPrimitives
->List of primitives (subpads)
UInt_t GetWh() const override
Get canvas height.
TCanvas * GetCanvas() const override
Short_t fBorderSize
pad bordersize in pixels
void Add(TObject *obj, Option_t *opt="", Bool_t modified=kTRUE) override
Add an object to list of primitives with specified draw option When.
TView * fView
! Pointer to 3-D view (if one exists)
Rectangle_t GetBBox() override
Return the bounding Box of the Pad.
void Paint(Option_t *option="") override
Paint all primitives in pad.
void FillCollideGridTBox(TObject *o)
Double_t fTheta
theta angle to view as lego/surface
void DrawCollideGrid()
This method draws the collide grid on top of the canvas.
void SetVertical(Bool_t vert=kTRUE) override
Set pad vertical (default) or horizontal.
void FillCollideGridTH1(TObject *o)
void GetPadPar(Double_t &xlow, Double_t &ylow, Double_t &xup, Double_t &yup) override
Return lower and upper bounds of the pad in NDC coordinates.
void PaintText(Double_t x, Double_t y, const char *text) override
Paint text in CurrentPad World coordinates.
Int_t fPadPaint
Set to 1 while painting the pad.
@ kCannotMove
Fixed position.
@ kClearAfterCR
Clear after CR.
@ kHori
Pad is horizontal.
@ kPrintingPS
PS Printing.
@ kFraming
Frame is requested.
static void DrawColorTable()
Static function to Display Color Table in a pad.
Double_t GetXlowNDC() const override
void SaveAs(const char *filename="", Option_t *option="") const override
Save the pad content in a file.
Int_t fPixmapID
! Off-screen pixmap identifier
Bool_t fEditable
True if canvas is editable.
Double_t GetYlowNDC() const override
TObject * FindObject(const char *name) const override
Search if object named name is inside this pad or in pads inside this pad.
Color_t GetHighLightColor() const override
Get highlight color.
Bool_t OpaqueResizing() const override
Is pad resizing in opaque mode ?
std::vector< Bool_t > fCollideGrid
! Grid used to find empty space when adding a box (Legend) in a pad
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
Int_t GetLogy() const override
void PaintLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2) override
Paint line in normalized coordinates.
void Print(const char *filename="") const override
This method is equivalent to SaveAs("filename"). See TPad::SaveAs for details.
Int_t GetEventX() const override
Get X event.
TFrame * GetFrame() override
Get frame.
Double_t fYtoAbsPixelk
Conversion coefficient for Y World to absolute pixel.
Double_t fXtoPixelk
Conversion coefficient for X World to pixel.
Int_t fLogy
(=0 if Y linear scale, =1 if log scale)
TFrame * fFrame
! Pointer to 2-D frame (if one exists)
TVirtualPadPainter * GetPainter() override
Get pad painter from TCanvas.
void Draw(Option_t *option="") override
Draw Pad in Current pad (re-parent pad if necessary).
Double_t fHNDC
Height of pad along Y in Normalized Coordinates (NDC).
void ShowGuidelines(TObject *object, const Int_t event, const char mode='i', const bool cling=true) override
Shows lines to indicate if a TAttBBox2D object is aligned to the center or to another object,...
Int_t GetCrosshair() const
Return the crosshair type (from the mother canvas) crosshair type = 0 means no crosshair.
void GetRangeAxis(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) override
Return pad axis coordinates range.
void SetBorderMode(Short_t bordermode) override
void PaintBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t *option="") override
Paint box in CurrentPad World coordinates.
void DrawClassObject(const TObject *obj, Option_t *option="") override
Draw class inheritance tree of the class to which obj belongs.
Int_t fCGny
! Size of the collide grid along y
Double_t fXlowNDC
X bottom left corner of pad in NDC [0,1].
TObject * GetPrimitive(const char *name) const override
Get primitive.
Double_t fUxmin
Minimum value on the X axis.
Double_t GetAbsHNDC() const override
void SetBBoxCenter(const TPoint &p) override
Set center of the Pad.
Bool_t IsWeb() const override
Is web ?
void SetSelected(TObject *obj) override
Set selected.
TObject * GetSelected() const override
Get selected.
void GetRange(Double_t &x1, Double_t &y1, Double_t &x2, Double_t &y2) override
Return pad world coordinates range.
Double_t PixeltoX(Double_t px) override
Convert pixel to X coordinate.
void PaintPolyLineNDC(Int_t n, Double_t *x, Double_t *y, Option_t *option="") override
Paint polyline in CurrentPad NDC coordinates.
Bool_t IsVertical() const override
Int_t IncrementPaletteColor(Int_t i, TString opt) override
Increment (i==1) or set (i>1) the number of autocolor in the pad.
void PaintPadFrame(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax) override
Paint histogram/graph frame.
Double_t GetAbsYlowNDC() const override
Double_t fUxmax
Maximum value on the X axis.
void AddFirst(TObject *obj, Option_t *opt="", Bool_t modified=kTRUE) override
Add an object as first in list of primitives with specified draw option When.
Double_t fY2
Y of upper Y coordinate.
void PaintTextUrl(Double_t x, Double_t y, const char *text, const char *url) override
Paint text with URL in CurrentPad World coordinates.
Double_t fAbsPixeltoYk
Conversion coefficient for absolute pixel to Y World.
TVirtualPad * GetSelectedPad() const override
Get selected pad.
void PaintPolyLine3D(Int_t n, Double_t *p) override
Paint 3-D polyline in the CurrentPad.
TVirtualPad * GetPad(Int_t subpadnumber) const override
Get a pointer to subpadnumber of this pad.
Short_t fBorderMode
Bordermode (-1=down, 0 = no border, 1=up).
void SetLogx(Int_t value=1) override
Set Lin/Log scale for X.
void ReleaseViewer3D(Option_t *type="") override
Release current (external) viewer.
void SetCrosshair(Int_t crhair=1) override
Set crosshair active/inactive.
void SetDoubleBuffer(Int_t mode=1) override
Set double buffer mode ON or OFF.
Int_t fNextPaletteColor
Next automatic color.
void SetBBoxCenterX(const Int_t x) override
Set X coordinate of the center of the Pad.
Int_t GetLogx() const override
TObject * fPadPointer
! free pointer
Double_t GetX2() const override
TObject * CreateToolTip(const TBox *b, const char *text, Long_t delayms) override
Create a tool tip and return its pointer.
Double_t GetWNDC() const override
Get width of pad along X in Normalized Coordinates (NDC).
void Pop() override
Pop pad to the top of the stack.
Double_t GetAbsXlowNDC() const override
Double_t GetX1() const override
Double_t GetHNDC() const override
Get height of pad along Y in Normalized Coordinates (NDC).
TPad * fMother
! pointer to mother of the list
const char * GetName() const override
Returns name of object.
Int_t XtoAbsPixel(Double_t x) const override
Convert X coordinate to absolute pixel.
Bool_t fGridy
Set to true if grid along Y.
void SetBBoxY2(const Int_t y) override
Set bottom of BoundingBox to a value (resize in y direction on bottom).
Double_t XtoPad(Double_t x) const override
Convert x from X to pad.
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
void ToLower()
Change string to lower-case.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Prepend(const char *cs)
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual void SetNDC(Bool_t isNDC=kTRUE)
void Paint(Option_t *option="") override
This method must be overridden if a class wants to paint itself.
virtual Int_t GetDistancetoAxis(Int_t axis, Int_t px, Int_t py, Double_t &ratio)=0
virtual void GetRange(Float_t *min, Float_t *max)=0
Provides 3D viewer interface (TVirtualViewer3D) support on a pad.
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
To make it possible to use GL for 2D graphic in a TPad/TCanvas.
virtual void DestroyDrawable(Int_t device)=0
virtual void SaveImage(TVirtualPad *pad, const char *fileName, Int_t type) const =0
virtual void SelectDrawable(Int_t device)=0
virtual void InvalidateCS()
Empty definition.
small helper class to store/restore gPad context in TPad methods
void PadDeleted(TVirtualPad *pad)
Inform context that pad deleted or will be deleted soon Reference on that pad should be cleared.
virtual Int_t YtoAbsPixel(Double_t y) const =0
virtual Double_t GetX2() const =0
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
virtual Int_t XtoAbsPixel(Double_t x) const =0
virtual Double_t GetY1() const =0
virtual Int_t GetNumber() const =0
void Streamer(TBuffer &) override
Stream an object of class TVirtualPad.
virtual Int_t VtoPixel(Double_t v) const =0
TVirtualPad()
VirtualPad default constructor.
virtual void RangeAxisChanged()
virtual Double_t GetY2() const =0
virtual Int_t UtoPixel(Double_t u) const =0
Bool_t fResizing
!true when resizing the pad
virtual Short_t GetBorderSize() const =0
virtual Bool_t IsEditable() const =0
virtual Double_t GetX1() const =0
Abstract 3D shapes viewer.
static TVirtualViewer3D * Viewer3D(TVirtualPad *pad=nullptr, Option_t *type="")
Create a Viewer 3D of specified type.
Short_t GetBorderSize() const
Short_t GetBorderMode() const
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
bool HasBeenDeleted(const TObject *obj)
Check if the TObject's memory has been deleted.
void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
Double_t Ceil(Double_t x)
Rounds x upward, returning the smallest integral value that is not less than x.
Int_t Finite(Double_t x)
Check if it is finite with a mask in order to be consistent in presence of fast math.
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Rectangle structure (maps to the X11 XRectangle structure).
struct used by ShowGuidelines to store the distance Field between objects in the canvas.
dField(TAttBBox2D *a, TAttBBox2D *b, Int_t dist, char direction)