152 fMother = (TPad*)
gPad;
181 fFixedAspectRatio =
kFALSE;
184 fNumPaletteColor = 0;
185 fNextPaletteColor = 0;
200 fUxmin = fUymin = fUxmax = fUymax = 0;
249 :
TVirtualPad(name,title,xlow,ylow,xup,yup,color,bordersize,bordermode)
323 Error(
"TPad",
"You must create a TCanvas before creating a TPad");
330 if ((xlow < 0) || (xlow > 1) || (ylow < 0) || (ylow > 1)) {
331 Error(
"TPad",
"illegal bottom left position: x=%f, y=%f", xlow, ylow);
334 if ((xup < 0) || (xup > 1) || (yup < 0) || (yup > 1)) {
335 Error(
"TPad",
"illegal top right position: x=%f, y=%f", xup, yup);
346 SetPad(name, title, xlow, ylow, xup, yup, color, bordersize, bordermode);
434 while ((exec = (
TExec*)next())) {
466 const char* title,
Option_t *option)
475 while( (o=next()) ) {
479 if (!leg) leg =
new TLegend(x1, y1, x2, y2, title);
486 if (strlen(option)) {
495 if (!leg) leg =
new TLegend(x1, y1, x2, y2, title);
497 TIter nextgraph(grlist);
500 while ((obj = nextgraph())) {
505 if (strlen(option)) opt = option;
510 if (!leg) leg =
new TLegend(x1, y1, x2, y2, title);
512 TIter nexthist(hlist);
515 while ((obj = nexthist())) {
520 if (strlen(option)) opt = option;
533 Info(
"BuildLegend(void)",
"No object to build a TLegend.");
576 while ((obj = next())) {
579 if (n == subpadnumber) {
580 return ((
TPad*)obj)->cd();
649 for (
Int_t i=0;i<2;i++) {
662 while(code1 + code2) {
673 if (ic == 0) ic = code2;
675 yt = y[0] + (y[1]-y[0])*(xclipl-x[0])/(x[1]-x[0]);
679 yt = y[0] + (y[1]-y[0])*(xclipr-x[0])/(x[1]-x[0]);
683 xt = x[0] + (x[1]-x[0])*(yclipb-y[0])/(y[1]-y[0]);
687 xt = x[0] + (x[1]-x[0])*(yclipt-y[0])/(y[1]-y[0]);
693 code1 =
ClippingCode(xt,yt,xclipl,yclipb,xclipr,yclipt);
697 code2 =
ClippingCode(xt,yt,xclipl,yclipb,xclipr,yclipt);
720 for (
Int_t i=0;i<2;i++) {
729 if (x[0] < xclipl) code1 = code1 | 0x1;
730 if (x[0] > xclipr) code1 = code1 | 0x2;
731 if (y[0] < yclipb) code1 = code1 | 0x4;
732 if (y[0] > yclipt) code1 = code1 | 0x8;
734 if (x[1] < xclipl) code2 = code2 | 0x1;
735 if (x[1] > xclipr) code2 = code2 | 0x2;
736 if (y[1] < yclipb) code2 = code2 | 0x4;
737 if (y[1] > yclipt) code2 = code2 | 0x8;
741 while(code1 + code2) {
752 if (ic == 0) ic = code2;
754 yt = y[0] + (y[1]-y[0])*(xclipl-x[0])/(x[1]-x[0]);
758 yt = y[0] + (y[1]-y[0])*(xclipr-x[0])/(x[1]-x[0]);
762 xt = x[0] + (x[1]-x[0])*(yclipb-y[0])/(y[1]-y[0]);
766 xt = x[0] + (x[1]-x[0])*(yclipt-y[0])/(y[1]-y[0]);
772 code1 =
ClippingCode(xt,yt,xclipl,yclipb,xclipr,yclipt);
776 code2 =
ClippingCode(xt,yt,xclipl,yclipb,xclipr,yclipt);
789 if (x < xcl1) code = code | 0x1;
790 if (x > xcl2) code = code | 0x2;
791 if (y < ycl1) code = code | 0x4;
792 if (y > ycl2) code = code | 0x8;
844 x1 = x[n-1]; y1 = y[n-1];
847 for (i=0; i<
n; i++) {
848 x2 = x[i]; y2 = y[i];
852 slope = (y2-y1)/(x2-x1);
856 xc2[nc2] = xclipl; yc2[nc2++] = slope*(xclipl-
x1)+y1;
858 xc2[nc2] =
x2; yc2[nc2++] = y2;
862 xc2[nc2] = xclipl; yc2[nc2++] = slope*(xclipl-
x1)+y1;
863 xc2[nc2] =
x2; yc2[nc2++] = y2;
870 x1 = xc2[nc2-1]; y1 = yc2[nc2-1];
872 for (i=0; i<nc2; i++) {
873 x2 = xc2[i]; y2 = yc2[i];
877 slope = (x2-
x1)/(y2-y1);
881 xc[nc] = x1+(yclipt-y1)*slope; yc[nc++] = yclipt;
883 xc[nc] =
x2; yc[nc++] = y2;
887 xc[nc] = x1+(yclipt-y1)*slope; yc[nc++] = yclipt;
888 xc[nc] =
x2; yc[nc++] = y2;
895 x1 = xc[nc-1]; y1 = yc[nc-1];
897 for (i=0; i<nc; i++) {
898 x2 = xc[i]; y2 = yc[i];
902 slope = (y2-y1)/(x2-x1);
906 xc2[nc2] = xclipr; yc2[nc2++] = slope*(xclipr-
x1)+y1;
908 xc2[nc2] =
x2; yc2[nc2++] = y2;
912 xc2[nc2] = xclipr; yc2[nc2++] = slope*(xclipr-
x1)+y1;
913 xc2[nc2] =
x2; yc2[nc2++] = y2;
920 x1 = xc2[nc2-1]; y1 = yc2[nc2-1];
922 for (i=0; i<nc2; i++) {
923 x2 = xc2[i]; y2 = yc2[i];
927 slope = (x2-
x1)/(y2-y1);
931 xc[nc] = x1+(yclipb-y1)*slope; yc[nc++] = yclipb;
933 xc[nc] =
x2; yc[nc++] = y2;
937 xc[nc] = x1+(yclipb-y1)*slope; yc[nc++] = yclipb;
938 xc[nc] =
x2; yc[nc++] = y2;
978 if (!
gPad->IsBatch()) {
985 if (!
gROOT->GetListOfCanvases())
return;
987 gROOT->GetListOfCanvases()->Remove(
this);
1008 if (
gROOT->GetSelectedPad() ==
this)
gROOT->SetSelectedPad(0);
1033 while ((obj = next())) {
1035 ((
TPad*)obj)->CopyPixmap();
1036 ((
TPad*)obj)->CopyPixmaps();
1062 Int_t pxl, pyl, pxt, pyt;
1067 if (px1 < px2) {pxl = px1; pxt = px2;}
1068 else {pxl = px2; pxt = px1;}
1069 if (py1 < py2) {pyl = py1; pyt = py2;}
1070 else {pyl = py2; pyt = py1;}
1074 if ( (px > pxl && px < pxt) && (py > pyl && py < pyt) ) {
1081 if (py < pyl) dxl += pyl - py;
1082 if (py > pyt) dxl += py - pyt;
1084 if (py < pyl) dxt += pyl - py;
1085 if (py > pyt) dxt += py - pyt;
1087 if (px < pxl) dyl += pxl - px;
1088 if (px > pxt) dyl += px - pxt;
1090 if (px < pxl) dyt += pxl - px;
1091 if (px > pxt) dyt += px - pxt;
1093 Int_t distance = dxl;
1094 if (dxt < distance) distance = dxt;
1095 if (dyl < distance) distance = dyl;
1096 if (dyt < distance) distance = dyt;
1142 arr[1] =
this; arr[2] = (
void*)&nx;arr[3] = (
void*)& ny;
1143 arr[4] = (
void*)&xmargin; arr[5] = (
void *)& ymargin; arr[6] = (
void *)&color;
1144 if ((*
gThreadXAR)(
"PDCD", 7, arr, 0))
return;
1149 if (nx <= 0) nx = 1;
1150 if (ny <= 0) ny = 1;
1157 char *
name =
new char [nchname];
1158 char *title =
new char [nchtitle];
1161 if (xmargin > 0 && ymargin > 0) {
1165 for (iy=0;iy<
ny;iy++) {
1166 y2 = 1 - iy*dy - ymargin;
1167 y1 = y2 - dy + 2*ymargin;
1169 if (y1 > y2)
continue;
1170 for (ix=0;ix<
nx;ix++) {
1171 x1 = ix*dx + xmargin;
1172 x2 = x1 +dx -2*xmargin;
1173 if (x1 > x2)
continue;
1176 pad =
new TPad(name,name,x1,y1,x2,y2,color);
1202 if (i == nx-1) x2 = 1-xr;
1204 number = j*nx + i +1;
1207 if (j == 0) y2 = 1-yt;
1208 if (j == ny-1) y1 = 0;
1211 pad =
new TPad(name,title,x1,y1,x2,y2);
1227 if (padsav) padsav->
cd();
1248 Divide( w,
h, xmargin, ymargin, color);
1258 gROOT->MakeDefCanvas();
1296 Int_t nd,nf,nc,nkd,nkf,i,j;
1309 Range(0,0,xpad,ypad);
1314 clevel[nlevel] = obj;
1323 if (nlevel >= maxlev-1)
break;
1327 Int_t ilevel, nelem;
1328 for (ilevel=nlevel;ilevel>=0;ilevel--) {
1329 cl = clevel[ilevel];
1331 if (nelem > maxelem) maxelem = nelem;
1332 nc = (nelem/50) + 1;
1342 if (dx < 1.3) dx = 1.3;
1343 tsizcm = tsizcm - 0.03*
Double_t(ncdraw-5);
1344 if (tsizcm < 0.27) tsizcm = 0.27;
1349 for (ilevel=nlevel;ilevel>=0;ilevel--) {
1350 cl = clevel[ilevel];
1352 if (nelem > maxelem) maxelem = nelem;
1353 nc = (nelem/50) + 1;
1355 if (ilevel < nlevel) x1 = x2 + 0.5;
1373 v1 = y1 -
Double_t(nkf+nkd+nc-1)*dy;
1385 TBox *
box = pt->
AddBox(0,(y1+0.01-v1)/dv,0,(v2-0.01-v1)/dv);
1387 pt->
AddLine(0,(y1-v1)/dv,0,(y1-v1)/dv);
1399 if (i >= nkd) { i = 1; y = y1 - 0.5*dy; x += 1/
Double_t(nc); }
1400 else { i++; y -= dy; }
1408 while (indx < dim ){
1409 ldname = strlen(dname);
1413 pt->
AddText(x,(y-v1)/dv,dname);
1420 pt->
AddLine(0,(ysep-v1)/dv,0,(ysep-v1)/dv);
1431 while ((m = (
TMethod *) nextm())) {
1433 !strcmp( m->
GetName(),
"Dictionary" ) ||
1434 !strcmp( m->
GetName(),
"Class_Version" ) ||
1435 !strcmp( m->
GetName(),
"DeclFileName" ) ||
1436 !strcmp( m->
GetName(),
"DeclFileLine" ) ||
1437 !strcmp( m->
GetName(),
"ImplFileName" ) ||
1438 !strcmp( m->
GetName(),
"ImplFileLine" )
1441 if (fcount > nf)
break;
1442 if (i >= nkf) { i = 1; y = ysep - 0.5*dy; x += 1/
Double_t(nc); }
1443 else { i++; y -= dy; }
1448 for (j=ilevel-1;j>=0;j--) {
1449 if (cl == clevel[ilevel]) {
1450 if (clevel[j]->GetMethodAny((
char*)m->
GetName())) {
1497 Int_t pxmin,pxmax,pymin,pymax,pxold,pyold,px,py;
1509 pxmax = canvas->
GetWw();
1511 pymax = cpad->
GetWh();
1513 if(pxold)
gVirtualX->DrawLine(pxold,pymin,pxold,pymax);
1514 if(pyold)
gVirtualX->DrawLine(pxmin,pyold,pxmax,pyold);
1541 if (
this != padsav) {
1542 Warning(
"DrawFrame",
"Must be called for the current pad only");
1543 return padsav->
DrawFrame(xmin,ymin,xmax,ymax,title);
1549 if (hframe)
delete hframe;
1553 if (
fLogx && xmin > 0 && xmax > xmin) {
1562 hframe =
new TH1F(
"hframe",title,nbins,xbins);
1565 hframe =
new TH1F(
"hframe",title,nbins,xmin,xmax);
1575 if (padsav) padsav->
cd();
1586 Double_t xlow, ylow, xup, yup, hs, ws;
1591 gPad->SetFillColor(0);
1593 gPad->Range(x1,y1,x2,y2);
1605 for (i=0;i<10;i++) {
1614 box->
DrawBox(xlow, ylow, xup, yup);
1617 box->
DrawBox(xlow, ylow, xup, yup);
1620 text->
DrawText(0.5*(xlow+xup), 0.5*(ylow+yup),
Form(
"%d",color));
1647 const Int_t kMaxDiff = 5;
1648 const Int_t kMinSize = 20;
1649 static Int_t pxorg, pyorg;
1650 static Int_t px1, px2, py1, py2, pxl, pyl, pxt, pyt, pxold, pyold;
1651 static Int_t px1p, px2p, py1p, py2p, pxlp, pylp, pxtp, pytp;
1652 static Bool_t pA, pB, pC, pD, pTop, pL, pR, pBot, pINSIDE;
1675 pA = pB = pC = pD = pTop = pL = pR = pBot = pINSIDE =
kFALSE;
1719 if (newcode)
return;
1786 pA = pB = pC = pD = pTop = pL = pR = pBot = pINSIDE =
kFALSE;
1790 pxold = pxl; pyold = pyl; pA =
kTRUE;
1795 pxold = pxt; pyold = pyl; pB =
kTRUE;
1800 pxold = pxt; pyold = pyt; pC =
kTRUE;
1805 pxold = pxl; pyold = pyt; pD =
kTRUE;
1809 if ((px > pxl+kMaxDiff && px < pxt-kMaxDiff) &&
1811 pxold = pxl; pyold = pyl; pTop =
kTRUE;
1815 if ((px > pxl+kMaxDiff && px < pxt-kMaxDiff) &&
1817 pxold = pxt; pyold = pyt; pBot =
kTRUE;
1821 if ((py > pyl+kMaxDiff && py < pyt-kMaxDiff) &&
1823 pxold = pxl; pyold = pyl; pL =
kTRUE;
1827 if ((py > pyl+kMaxDiff && py < pyt-kMaxDiff) &&
1829 pxold = pxt; pyold = pyt; pR =
kTRUE;
1833 if ((px > pxl+kMaxDiff && px < pxt-kMaxDiff) &&
1834 (py > pyl+kMaxDiff && py < pyt-kMaxDiff)) {
1835 pxold = px; pyold = py; pINSIDE =
kTRUE;
1843 if (pA || pB || pC || pD || pTop || pL || pR || pBot)
1846 if (!pA && !pB && !pC && !pD && !pTop && !pL && !pR && !pBot && !pINSIDE)
1859 if (px > pxt-kMinSize) { px = pxt-kMinSize; wx = px; }
1860 if (py > pyt-kMinSize) { py = pyt-kMinSize; wy = py; }
1861 if (px < pxlp) { px = pxlp; wx = px; }
1862 if (py < pylp) { py = pylp; wy = py; }
1880 if (px < pxl+kMinSize) { px = pxl+kMinSize; wx = px; }
1881 if (py > pyt-kMinSize) { py = pyt-kMinSize; wy = py; }
1882 if (px > pxtp) { px = pxtp; wx = px; }
1883 if (py < pylp) { py = pylp; wy = py; }
1901 if (px < pxl+kMinSize) { px = pxl+kMinSize; wx = px; }
1902 if (py < pyl+kMinSize) { py = pyl+kMinSize; wy = py; }
1903 if (px > pxtp) { px = pxtp; wx = px; }
1904 if (py > pytp) { py = pytp; wy = py; }
1922 if (px > pxt-kMinSize) { px = pxt-kMinSize; wx = px; }
1923 if (py < pyl+kMinSize) { py = pyl+kMinSize; wy = py; }
1924 if (px < pxlp) { px = pxlp; wx = px; }
1925 if (py > pytp) { py = pytp; wy = py; }
1944 if (py2 > py1-kMinSize) { py2 = py1-kMinSize; wy = py2; }
1945 if (py2 < py2p) { py2 = py2p; wy = py2; }
1960 if (py1 < py2+kMinSize) { py1 = py2+kMinSize; wy = py1; }
1961 if (py1 > py1p) { py1 = py1p; wy = py1; }
1976 if (px1 > px2-kMinSize) { px1 = px2-kMinSize; wx = px1; }
1977 if (px1 < px1p) { px1 = px1p; wx = px1; }
1993 if (px2 < px1+kMinSize) { px2 = px1+kMinSize; wx = px2; }
1994 if (px2 > px2p) { px2 = px2p; wx = px2; }
2009 Int_t dx = px - pxold;
2010 Int_t dy = py - pyold;
2011 px1 += dx; py1 += dy; px2 += dx; py2 += dy;
2012 if (px1 < px1p) { dx = px1p - px1; px1 += dx; px2 += dx; wx = px+dx; }
2013 if (px2 > px2p) { dx = px2 - px2p; px1 -= dx; px2 -= dx; wx = px-dx; }
2014 if (py1 > py1p) { dy = py1 - py1p; py1 -= dy; py2 -= dy; wy = py-dy; }
2015 if (py2 < py2p) { dy = py2p - py2; py1 += dy; py2 += dy; wy = py+dy; }
2029 x1 = x2 = y1 = y2 = 0;
2056 if (pTop || pBot || pL || pR || pINSIDE) {
2063 if (px != pxorg || py != pyorg) {
2087 if (pINSIDE)
gPad->ShowGuidelines(
this, event);
2088 if (pTop)
gPad->ShowGuidelines(
this, event,
't',
true);
2089 if (pBot)
gPad->ShowGuidelines(
this, event,
'b',
true);
2090 if (pL)
gPad->ShowGuidelines(
this, event,
'l',
true);
2091 if (pR)
gPad->ShowGuidelines(
this, event,
'r',
true);
2092 if (pA)
gPad->ShowGuidelines(
this, event,
'1',
true);
2093 if (pB)
gPad->ShowGuidelines(
this, event,
'2',
true);
2094 if (pC)
gPad->ShowGuidelines(
this, event,
'3',
true);
2095 if (pD)
gPad->ShowGuidelines(
this, event,
'4',
true);
2104 if (
gROOT->IsEscaped()) {
2109 if (opaque||ropaque) {
2112 x1 = x2 = y1 = y2 = 0;
2138 if (pTop || pBot || pL || pR || pINSIDE) {
2145 if (pA || pB || pC || pD || pTop || pL || pR || pBot)
2151 if (px != pxorg || py != pyorg) {
2188 event =
gVirtualX->RequestLocator(1, 1, px, py);
2227 static Int_t axisNumber;
2229 static Int_t px1old, py1old, px2old, py2old;
2233 static TBox *zoombox;
2234 Double_t zbx1=0,zbx2=0,zby1=0,zby2=0;
2241 if (strstr(opt,
"cont4")) {
2250 if (!strcmp(axis->
GetName(),
"xaxis")) {
2254 if (!strcmp(axis->
GetName(),
"yaxis")) {
2258 if (!strcmp(axis->
GetName(),
"zaxis")) {
2264 if (axisNumber == 1) {
2270 }
else if (axisNumber == 2) {
2286 if (axisNumber == 1) {
2291 }
else if (axisNumber == 2) {
2305 zoombox =
new TBox(zbx1, zby1, zbx2, zby2);
2316 if (!opaque)
gVirtualX->SetLineColor(-1);
2324 if (axisNumber == 1) {
2334 if (axisNumber == 1) {
2339 }
else if (axisNumber == 2) {
2354 zoombox->
SetX1(zbx1);
2355 zoombox->
SetY1(zby1);
2356 zoombox->
SetX2(zbx2);
2357 zoombox->
SetY2(zby2);
2390 if (
gROOT->IsEscaped()) {
2392 if (opaque && zoombox) {
2401 if (ratio1 > ratio2) {
2406 if (ratio2 - ratio1 > 0.05) {
2408 if (axisNumber == 3 && hobj && hobj->
GetDimension() != 3) {
2417 Float_t newmin = zmin + (zmax-zmin)*ratio1;
2418 Float_t newmax = zmin + (zmax-zmin)*ratio2;
2431 bin1 = first +
Int_t((last-first+1)*ratio1);
2432 bin2 = first +
Int_t((last-first+1)*ratio2);
2442 if (axisNumber == 1) {
2450 }
else if (axisNumber == 2) {
2478 xmin = ((xmin-xmi)/(xma-xmi))*(up-low)+low;
2479 xmax = ((xmax-xmi)/(xma-xmi))*(up-low)+low;
2482 if (!strcmp(axis->
GetName(),
"xaxis")) axisNumber = 1;
2483 if (!strcmp(axis->
GetName(),
"yaxis")) axisNumber = 2;
2484 if (ratio2 - ratio1 > 0.05) {
2491 if (axisNumber == 1) axis->
SetRange(bin1,bin2);
2492 if (axisNumber == 2 && hobj1) {
2509 while ((obj= next())) {
2512 if (hobj == hobj1)
continue;
2515 if (axisNumber == 1) {
2517 }
else if (axisNumber == 2) {
2560 if (found)
return found;
2563 while ((cur = next())) {
2566 if (found)
return found;
2581 if (found)
return found;
2584 while ((cur = next())) {
2587 if (found)
return found;
2662 if (
fCanvas ==
this)
return 0;
2671 if (
fCanvas ==
this)
return 0;
2680 if (
fCanvas ==
this)
return 0;
2823 while ((obj=next())) {
2824 if (!strcmp(name, obj->
GetName()))
return obj;
2827 if (found)
return found;
2837 if (!subpadnumber) {
2844 while ((obj = next())) {
2847 if (pad->
GetNumber() == subpadnumber)
return pad;
2894 if (color <= 0)
return;
2912 gROOT->SetSelectedPad(
this);
2929 <<
" Name= "<<
GetName()<<
" Title= "<<
GetTitle()<<
" Option="<<option<<std::endl;
2941 if (opt.
Index(
"pfc")>=0 || opt.
Index(
"plc")>=0 || opt.
Index(
"pmc")>=0) {
2959 if (i>=ncolors) i = ncolors-1;
2971 Int_t const cellSize = 10;
2990 for (
int i = 0; i<
fCGnx; i++) {
2991 for (
int j = 0; j<
fCGny; j++) {
3002 for (
int i=0; i<np; i++) {
3019 for (
int r=i;
r<w+i;
r++) {
3020 for (
int c=j; c<h+j; c++) {
3040 for (
Int_t i = 0; i<nxmax; i++) {
3041 for (
Int_t j = 0; j<=nymax; j++) {
3054 #define NotFree(i, j) fCollideGrid[TMath::Max(TMath::Min(i+j*fCGnx,fCGnx*fCGny),0)] = kFALSE; 3073 for (i=y1+1; i<y2; i++)
NotFree(x1,i);
3080 xt =
x1; x1 =
x2; x2 = xt;
3081 yt = y1; y1 = y2; y2 = yt;
3083 for (i=x1+1; i<
x2; i++) {
3090 yt = y1; y1 = y2; y2 = yt;
3091 xt =
x1; x1 =
x2; x2 = xt;
3093 for (j=y1+1; j<y2; j++) {
3113 for (
int i = x1; i<=
x2; i++) {
3114 for (
int j = y1; j<=y2; j++)
NotFree(i, j);
3132 for (i = x1; i<=
x2; i++) {
3137 for (i = y1; i<=y2; i++) {
3155 for (
Int_t i=1; i<
n; i++) {
3171 (
int)((y1-
fY1)/ys), (
int)((y2-
fY1)/ys));
3184 if (name.
Index(
"hframe") >= 0)
return;
3189 bool haserrors =
false;
3194 if (drawOption.
Index(
"hist") < 0) {
3195 if (drawOption.
Index(
"e") >= 0) haserrors =
true;
3203 for (i = 1; i<
nx; i++) {
3223 for (j=y1; j<=y2; j++) {
3245 x1 = (int)((x1l-
fX1)/xs);
3261 box->SetFillColorAlpha(
kRed,0.5);
3272 for (
int i = 0; i<
fCGnx; i++) {
3275 for (
int j = 0; j<
fCGny; j++) {
3276 if (
gPad->GetLogx()) {
3283 if (
gPad->GetLogy()) {
3292 box->DrawBox(X1L, Y1L, X2L, Y2L);
3294 box->SetFillColorAlpha(
kRed,t);
3295 box->DrawBox(X1L, Y1L, X2L, Y2L);
3299 if (t==0.15) t = 0.1;
3393 began3DScene =
kTRUE;
3400 if (padsav) padsav->cd();
3429 if (color < 0) color = -color;
3436 if (bordersize <= 0) bordersize = 2;
3457 if (px1 < px2) {xl =
fX1; xt =
fX2; }
3458 else {xl =
fX2; xt =
fX1;}
3459 if (py1 > py2) {yl =
fY1; yt =
fY2;}
3460 else {yl =
fY2; yt =
fY1;}
3462 Double_t frameXs[7] = {}, frameYs[7] = {};
3466 frameXs[0] = xl; frameYs[0] = yl;
3467 frameXs[1] = xl + realBsX; frameYs[1] = yl + realBsY;
3468 frameXs[2] = frameXs[1]; frameYs[2] = yt - realBsY;
3469 frameXs[3] = xt - realBsX; frameYs[3] = frameYs[2];
3470 frameXs[4] = xt; frameYs[4] = yt;
3471 frameXs[5] = xl; frameYs[5] = yt;
3472 frameXs[6] = xl; frameYs[6] = yl;
3479 frameXs[0] = xl; frameYs[0] = yl;
3480 frameXs[1] = xl + realBsX; frameYs[1] = yl + realBsY;
3481 frameXs[2] = xt - realBsX; frameYs[2] = frameYs[1];
3482 frameXs[3] = frameXs[2]; frameYs[3] = yt - realBsY;
3483 frameXs[4] = xt; frameYs[4] = yt;
3484 frameXs[5] = xt; frameYs[5] = yl;
3485 frameXs[6] = xl; frameYs[6] = yl;
3618 ((
TPad*)obj)->PaintModified();
3630 began3DScene =
kTRUE;
3638 if (padsav) padsav->cd();
3659 if (!
gPad->IsBatch()) {
3662 if (option[0] ==
's') {
3667 if (style > 3000 && style < 4000) {
3673 if (style >= 3100 && style < 4000) {
3675 xb[0] =
x1; xb[1] =
x1; xb[2] =
x2; xb[3] =
x2;
3676 yb[0] = y1; yb[1] = y2; yb[2] = y2; yb[3] = y1;
3686 }
else if (style >= 4000 && style <= 4100) {
3711 }
else if (style >= 1000 && style <= 1999) {
3725 if (option[0] ==
's') {
3728 if (style0 >= 3100 && style0 < 4000) {
3730 xb[0] =
x1; xb[1] =
x1; xb[2] =
x2; xb[3] =
x2;
3731 yb[0] = y1; yb[1] = y2; yb[2] = y2; yb[3] = y1;
3737 if (option[0] ==
'l') {
3756 while ((obj = next())) {
3758 if (obj == stop)
break;
3759 ((
TPad*)obj)->CopyBackgroundPixmap(x, y);
3760 ((
TPad*)obj)->CopyBackgroundPixmaps((
TPad*)obj, stop, x, y);
3779 Warning(
"TPad::PaintFillArea",
"Float_t signature is obsolete. Use Double_t signature.");
3802 n =
ClipPolygon(nn, xx, yy, nc, x, y,xmin,ymin,xmax,ymax);
3812 if (fillstyle >= 3100 && fillstyle < 4000) {
3819 if (!
gPad->IsBatch())
3866 static Double_t ang1[10] = {0., 10., 20., 30., 45.,5., 60., 70., 80., 90.};
3867 static Double_t ang2[10] = {180.,170.,160.,150.,135.,5.,120.,110.,100., 90.};
3869 Int_t fasi = FillStyle%1000;
3872 Int_t iAng1 = fasi%10;
3880 if (!
gPad->IsBatch()) {
3893 if (!
gPad->IsBatch()) {
3905 if (ang1[iAng1] != 5.)
PaintHatches(dy, ang1[iAng1], nn, xx, yy);
3906 if (ang2[iAng2] != 5.)
PaintHatches(dy, ang2[iAng2], nn, xx, yy);
3909 if (!
gPad->IsBatch()) {
3933 const Int_t maxnbi = 100;
3934 Double_t xli[maxnbi], xlh[2], ylh[2], xt1, xt2, yt1, yt2;
3935 Double_t ll,
x,
y,
x1,
x2, y1, y2,
a,
b, xi, xip, xin, yi, yip;
3941 ratiox = 1/(rwxmax-rwxmin);
3942 ratioy = 1/(rwymax-rwymin);
3955 gPad->GetPadPar(x1p,y1p,x2p,y2p);
3964 for (i=1; i<=
nn; i++) {
3965 x = wndc*ratiox*(xx[i-1]-rwxmin);
3966 y = hndc*ratioy*(yy[i-1]-rwymin);
3967 yrot = sina*x+cosa*
y;
3968 if (yrot > ymax) ymax = yrot;
3969 if (yrot < ymin) ymin = yrot;
3973 for (ycur=ymax; ycur>=
ymin; ycur=ycur-dy) {
3975 for (i=2; i<=nn+1; i++) {
3978 if (i == nn+1) i2=1;
3979 x1 = wndc*ratiox*(xx[i1-1]-rwxmin);
3980 y1 = hndc*ratioy*(yy[i1-1]-rwymin);
3981 x2 = wndc*ratiox*(xx[i2-1]-rwxmin);
3982 y2 = hndc*ratioy*(yy[i2-1]-rwymin);
3983 xt1 = cosa*x1-sina*y1;
3984 yt1 = sina*x1+cosa*y1;
3985 xt2 = cosa*x2-sina*y2;
3986 yt2 = sina*x2+cosa*y2;
3997 if ((yi <= ycur) && (ycur < yip)) {
3999 if (nbi >= maxnbi)
return;
4009 if (nbi >= maxnbi)
return;
4012 if (nbi >= maxnbi)
return;
4019 a = (yt1-yt2)/(xt1-xt2);
4020 b = (yt2*xt1-xt2*yt1)/(xt1-xt2);
4029 if ((xi <= xin) && (xin < xip) &&
4033 if (nbi >= maxnbi)
return;
4042 for (i=1; i<=
m; i++) {
4043 if (xli[i] < xli[i-1]) {
4051 if (inv == 0)
goto L50;
4057 if (nbi%2 != 0)
continue;
4059 for (i=1; i<=nbi; i=i+2) {
4061 xlh[0] = cosb*xli[i-1]-sinb*ycur;
4062 ylh[0] = sinb*xli[i-1]+cosb*ycur;
4063 xlh[1] = cosb*xli[i] -sinb*ycur;
4064 ylh[1] = sinb*xli[i] +cosb*ycur;
4066 xlh[0] = (xlh[0]/wndc)*(rwxmax-rwxmin)+rwxmin;
4067 ylh[0] = (ylh[0]/hndc)*(rwymax-rwymin)+rwymin;
4068 xlh[1] = (xlh[1]/wndc)*(rwxmax-rwxmin)+rwxmin;
4069 ylh[1] = (ylh[1]/hndc)*(rwymax-rwymin)+rwymin;
4070 gPad->PaintLine(xlh[0], ylh[0], xlh[1], ylh[1]);
4081 x[0] =
x1; x[1] =
x2; y[0] = y1; y[1] = y2;
4090 if (!
gPad->IsBatch())
4106 if (!
gPad->IsBatch())
4131 for (i=0;i<3;i++) temp[i] = p1[i];
4133 for (i=0;i<3;i++) temp[i] = p2[i];
4135 PaintLine(xpad[0],xpad[1],xpad[3],xpad[4]);
4149 for (i=0;i<3;i++) temp[i] = p1[i];
4151 for (i=0;i<3;i++) temp[i] = p2[i];
4153 PaintLine(xpad[0],xpad[1],xpad[3],xpad[4]);
4169 Int_t i, i1=-1,np=1;
4170 for (i=0; i<n-1; i++) {
4175 Int_t iclip =
Clip(&x[i],&y[i],xmin,ymin,xmax,ymax);
4182 if (iclip == 0 && i < n-2)
continue;
4183 if (!
gPad->IsBatch())
4216 if (option && (option[0] ==
'C')) mustClip =
kFALSE;
4219 Int_t i, i1=-1, np=1, iclip=0;
4221 for (i=0; i < n-1; i++) {
4227 iclip =
Clip(&x[i],&y[i],xmin,ymin,xmax,ymax);
4235 if (iclip == 0 && i < n-2)
continue;
4236 if (!
gPad->IsBatch())
4261 if (!
gPad->IsBatch())
4267 for (
Int_t i=0; i<
n; i++) {
4286 for (
Int_t i = 1; i <
n; i++)
4305 for (i=0; i<
n; i++) {
4306 if (x[i] >= xmin && x[i] <= xmax && y[i] >= ymin && y[i] <= ymax) {
4309 if (i < n-1)
continue;
4311 if (np == 0)
continue;
4312 if (!
gPad->IsBatch())
4336 for (i=0; i<
n; i++) {
4337 if (x[i] >= xmin && x[i] <= xmax && y[i] >= ymin && y[i] <= ymax) {
4340 if (i < n-1)
continue;
4342 if (np == 0)
continue;
4343 if (!
gPad->IsBatch())
4361 if (!
gPad->IsBatch())
4374 if (!
gPad->IsBatch())
4387 if (!
gPad->IsBatch())
4404 if (!
gPad->IsBatch())
4432 if (
gPad == 0)
return 0;
4439 if (
this !=
gPad->GetCanvas()) {
4440 if (!((x >=
fX1 && x <=
fX2) && (y >=
fY1 && y <=
fY2)))
return 0;
4448 TPad *picked =
this;
4452 pickobj = &dummyLink;
4481 pick = ((
TPad*)obj)->
Pick(px, py, pickobj);
4486 }
else if (!
gROOT->GetEditorMode()) {
4493 if (dist == 0)
break;
4508 if (
fView && !gotPrim) {
4532 if (picked ==
this) {
4554 while ((obj = next()))
4556 char *opt =
StrDup(next.GetOption());
4583 ((
TPad*)
this)->SaveAs(filename);
4595 while ((obj = next())) {
4740 const char *filename;
4758 filename = fs2.
Data();
4761 const char *opt_default=
"ps";
4763 Int_t lenfil = filename ? strlen(filename) : 0;
4764 TString opt = (!option) ? opt_default : option;
4786 if (strstr(opt,
"gif+")) {
4789 }
else if (strstr(opt,
"gif")) {
4792 }
else if (strstr(opt,
"png")) {
4795 }
else if (strstr(opt,
"jpg")) {
4798 }
else if (strstr(opt,
"tiff")) {
4801 }
else if (strstr(opt,
"xpm")) {
4804 }
else if (strstr(opt,
"bmp")) {
4811 if (!
gROOT->IsBatch() && image) {
4814 Color_t hc =
gPad->GetCanvas()->GetHighLightColor();
4815 gPad->GetCanvas()->SetHighLightColor(-1);
4821 Info(
"Print",
"GIF file %s has been created", psname.
Data());
4823 gPad->GetCanvas()->SetHighLightColor(hc);
4827 Color_t hc =
gPad->GetCanvas()->GetHighLightColor();
4828 gPad->GetCanvas()->SetHighLightColor(-1);
4843 Info(
"Print",
"file %s has been created", psname.
Data());
4845 gPad->GetCanvas()->SetHighLightColor(hc);
4847 Warning(
"Print",
"Unsupported image format %s", psname.
Data());
4853 if (strstr(opt,
"cxx")) {
4859 if (strstr(opt,
"root")) {
4865 if (strstr(opt,
"xml")) {
4872 if (strstr(opt,
"json")) {
4878 if (strstr(opt,
"svg")) {
4893 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualPS",
"svg"))) {
4920 if (strstr(opt,
"tex")) {
4935 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualPS",
"tex"))) {
4971 copen = psname.
EndsWith(
"(");
if (copen) psname[psname.
Length()-1] = 0;
4972 cclose = psname.
EndsWith(
")");
if (cclose) psname[psname.
Length()-1] = 0;
4973 copenb = psname.
EndsWith(
"[");
if (copenb) psname[psname.
Length()-1] = 0;
4974 ccloseb = psname.
EndsWith(
"]");
if (ccloseb) psname[psname.
Length()-1] = 0;
4978 if (copen || copenb) mustClose =
kFALSE;
4979 if (cclose || ccloseb) mustClose =
kTRUE;
4990 if (ratio < 1) pstype = 112;
4991 if (strstr(opt,
"Portrait")) pstype = 111;
4992 if (strstr(opt,
"Landscape")) pstype = 112;
4993 if (strstr(opt,
"eps")) pstype = 113;
4994 if (strstr(opt,
"Preview")) pstype = 113;
5002 if (strstr(opt,
"pdf") || strstr(opt,
"Title:")) {
5003 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualPS",
"pdf"))) {
5009 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualPS",
"image"))) {
5014 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualPS",
"ps"))) {
5023 if (titlePos !=
kNPOS) {
5030 if (!strstr(opt,
"pdf") || image) {
5047 if (!copen)
Info(
"Print",
"%s file %s has been created", opt.
Data(), psname.
Data());
5048 else Info(
"Print",
"%s file %s has been created using the current canvas", opt.
Data(), psname.
Data());
5057 if (titlePos !=
kNPOS) {
5064 if (cclose)
Info(
"Print",
"Current canvas added to %s file %s and file closed", opt.
Data(), psname.
Data());
5065 else Info(
"Print",
"%s file %s has been closed", opt.
Data(), psname.
Data());
5070 Info(
"Print",
"Current canvas added to %s file %s", opt.
Data(), psname.
Data());
5087 if ((x1 >= x2) || (y1 >= y2)) {
5088 Error(
"Range",
"illegal world coordinates range: x1=%f, y1=%f, x2=%f, y2=%f",x1,y1,x2,y2);
5097 if (
fX1 == x1 &&
fY1 == y1 &&
fX2 == x2 &&
fY2 == y2)
return;
5125 if ((xmin >= xmax) || (ymin >= ymax)) {
5126 Error(
"RangeAxis",
"illegal axis coordinates range: xmin=%f, ymin=%f, xmax=%f, ymax=%f",
5127 xmin, ymin, xmax, ymax);
5179 while ((obj = next())) {
5190 if (h1f) h1f->
DrawCopy(
"sameaxis");
5209 if (padsav) padsav->
cd();
5339 if (
this ==
gPad->GetCanvas()) {
5371 fYtoPixelk = rounding + -pyrange - pyrange*fY1/yrange;