132 fPadPointer =
nullptr;
133 fPrimitives =
nullptr;
148 fPadView3D =
nullptr;
178 fFixedAspectRatio =
kFALSE;
181 fNumPaletteColor = 0;
182 fNextPaletteColor = 0;
183 fCollideGrid =
nullptr;
197 fUxmin = fUymin = fUxmax = fUymax = 0;
246 :
TVirtualPad(
name,title,xlow,ylow,xup,yup,color,bordersize,bordermode)
330 Error(
"TPad",
"You must create a TCanvas before creating a TPad");
337 if ((xlow < 0) || (xlow > 1) || (ylow < 0) || (ylow > 1)) {
338 Error(
"TPad",
"illegal bottom left position: x=%f, y=%f", xlow, ylow);
341 if ((xup < 0) || (xup > 1) || (yup < 0) || (yup > 1)) {
342 Error(
"TPad",
"illegal top right position: x=%f, y=%f", xup, yup);
353 SetPad(
name, title, xlow, ylow, xup, yup, color, bordersize, bordermode);
451 while ((exec = (
TExec*)next())) {
492 const char* title,
Option_t *option)
501 while( (o=next()) ) {
507 mes = ((
TNamed *)o)->GetTitle();
512 if (strlen(option)) {
523 TIter nextgraph(grlist);
526 while ((obj = nextgraph())) {
531 if (strlen(option)) opt = option;
533 leg->AddEntry( obj, mes.
Data(), opt );
538 TIter nexthist(hlist);
541 while ((obj = nexthist())) {
546 if (strlen(option)) opt = option;
548 leg->AddEntry( obj, mes.
Data(), opt );
559 Info(
"BuildLegend(void)",
"No object to build a TLegend.");
602 while ((obj = next())) {
605 if (
n == subpadnumber) {
606 return ((
TPad*)obj)->
cd();
675 for (
Int_t i=0;i<2;i++) {
688 while(code1 + code2) {
699 if (ic == 0) ic = code2;
701 yt =
y[0] + (
y[1]-
y[0])*(xclipl-
x[0])/(
x[1]-
x[0]);
705 yt =
y[0] + (
y[1]-
y[0])*(xclipr-
x[0])/(
x[1]-
x[0]);
709 xt =
x[0] + (
x[1]-
x[0])*(yclipb-
y[0])/(
y[1]-
y[0]);
713 xt =
x[0] + (
x[1]-
x[0])*(yclipt-
y[0])/(
y[1]-
y[0]);
719 code1 =
ClippingCode(xt,yt,xclipl,yclipb,xclipr,yclipt);
723 code2 =
ClippingCode(xt,yt,xclipl,yclipb,xclipr,yclipt);
746 for (
Int_t i=0;i<2;i++) {
755 if (
x[0] < xclipl) code1 = code1 | 0x1;
756 if (
x[0] > xclipr) code1 = code1 | 0x2;
757 if (
y[0] < yclipb) code1 = code1 | 0x4;
758 if (
y[0] > yclipt) code1 = code1 | 0x8;
760 if (
x[1] < xclipl) code2 = code2 | 0x1;
761 if (
x[1] > xclipr) code2 = code2 | 0x2;
762 if (
y[1] < yclipb) code2 = code2 | 0x4;
763 if (
y[1] > yclipt) code2 = code2 | 0x8;
767 while(code1 + code2) {
778 if (ic == 0) ic = code2;
780 yt =
y[0] + (
y[1]-
y[0])*(xclipl-
x[0])/(
x[1]-
x[0]);
784 yt =
y[0] + (
y[1]-
y[0])*(xclipr-
x[0])/(
x[1]-
x[0]);
788 xt =
x[0] + (
x[1]-
x[0])*(yclipb-
y[0])/(
y[1]-
y[0]);
792 xt =
x[0] + (
x[1]-
x[0])*(yclipt-
y[0])/(
y[1]-
y[0]);
798 code1 =
ClippingCode(xt,yt,xclipl,yclipb,xclipr,yclipt);
802 code2 =
ClippingCode(xt,yt,xclipl,yclipb,xclipr,yclipt);
815 if (
x < xcl1) code = code | 0x1;
816 if (
x > xcl2) code = code | 0x2;
817 if (
y < ycl1) code = code | 0x4;
818 if (
y > ycl2) code = code | 0x8;
873 for (i=0; i<
n; i++) {
874 x2 =
x[i]; y2 =
y[i];
878 slope = (y2-y1)/(
x2-
x1);
882 xc2[nc2] = xclipl; yc2[nc2++] = slope*(xclipl-
x1)+y1;
884 xc2[nc2] =
x2; yc2[nc2++] = y2;
888 xc2[nc2] = xclipl; yc2[nc2++] = slope*(xclipl-
x1)+y1;
889 xc2[nc2] =
x2; yc2[nc2++] = y2;
896 x1 = xc2[nc2-1]; y1 = yc2[nc2-1];
898 for (i=0; i<nc2; i++) {
899 x2 = xc2[i]; y2 = yc2[i];
903 slope = (
x2-
x1)/(y2-y1);
907 xc[nc] =
x1+(yclipt-y1)*slope; yc[nc++] = yclipt;
909 xc[nc] =
x2; yc[nc++] = y2;
913 xc[nc] =
x1+(yclipt-y1)*slope; yc[nc++] = yclipt;
914 xc[nc] =
x2; yc[nc++] = y2;
923 x1 = xc[nc-1]; y1 = yc[nc-1];
925 for (i=0; i<nc; i++) {
926 x2 = xc[i]; y2 = yc[i];
930 slope = (y2-y1)/(
x2-
x1);
934 xc2[nc2] = xclipr; yc2[nc2++] = slope*(xclipr-
x1)+y1;
936 xc2[nc2] =
x2; yc2[nc2++] = y2;
940 xc2[nc2] = xclipr; yc2[nc2++] = slope*(xclipr-
x1)+y1;
941 xc2[nc2] =
x2; yc2[nc2++] = y2;
948 x1 = xc2[nc2-1]; y1 = yc2[nc2-1];
950 for (i=0; i<nc2; i++) {
951 x2 = xc2[i]; y2 = yc2[i];
955 slope = (
x2-
x1)/(y2-y1);
959 xc[nc] =
x1+(yclipb-y1)*slope; yc[nc++] = yclipb;
961 xc[nc] =
x2; yc[nc++] = y2;
965 xc[nc] =
x1+(yclipb-y1)*slope; yc[nc++] = yclipb;
966 xc[nc] =
x2; yc[nc++] = y2;
1008 if (!
gPad->IsBatch())
1013 if (!
gROOT->GetListOfCanvases())
return;
1015 gROOT->GetListOfCanvases()->Remove(
this);
1036 if (
gROOT->GetSelectedPad() ==
this)
gROOT->SetSelectedPad(
nullptr);
1061 while ((obj = next())) {
1063 ((
TPad*)obj)->CopyPixmap();
1064 ((
TPad*)obj)->CopyPixmaps();
1090 Int_t pxl, pyl, pxt, pyt;
1095 if (px1 < px2) {pxl = px1; pxt = px2;}
1096 else {pxl = px2; pxt = px1;}
1097 if (py1 < py2) {pyl = py1; pyt = py2;}
1098 else {pyl = py2; pyt = py1;}
1102 if ( (px > pxl && px < pxt) && (py > pyl && py < pyt) ) {
1109 if (py < pyl) dxl += pyl - py;
1110 if (py > pyt) dxl += py - pyt;
1112 if (py < pyl) dxt += pyl - py;
1113 if (py > pyt) dxt += py - pyt;
1115 if (px < pxl) dyl += pxl - px;
1116 if (px > pxt) dyl += px - pxt;
1118 if (px < pxl) dyt += pxl - px;
1119 if (px > pxt) dyt += px - pxt;
1121 Int_t distance = dxl;
1122 if (dxt < distance) distance = dxt;
1123 if (dyl < distance) distance = dyl;
1124 if (dyt < distance) distance = dyt;
1170 arr[1] =
this; arr[2] = (
void*)&nx;arr[3] = (
void*)& ny;
1171 arr[4] = (
void*)&xmargin; arr[5] = (
void *)& ymargin; arr[6] = (
void *)&color;
1172 if ((*
gThreadXAR)(
"PDCD", 7, arr, 0))
return;
1177 if (nx <= 0) nx = 1;
1178 if (ny <= 0) ny = 1;
1185 char *
name =
new char [nchname];
1186 char *title =
new char [nchtitle];
1189 if (xmargin > 0 && ymargin > 0) {
1193 for (iy=0;iy<ny;iy++) {
1194 y2 = 1 - iy*dy - ymargin;
1195 y1 = y2 - dy + 2*ymargin;
1197 if (y1 > y2)
continue;
1198 for (ix=0;ix<nx;ix++) {
1199 x1 = ix*dx + xmargin;
1200 x2 =
x1 +dx -2*xmargin;
1201 if (
x1 >
x2)
continue;
1226 for (
Int_t i=0;i<nx;i++) {
1230 if (i == nx-1)
x2 = 1-xr;
1231 for (
Int_t j=0;j<ny;j++) {
1232 number = j*nx + i +1;
1235 if (j == 0) y2 = 1-yt;
1236 if (j == ny-1) y1 = 0;
1255 if (padsav) padsav->
cd();
1276 Divide( w,
h, xmargin, ymargin, color);
1286 gROOT->MakeDefCanvas();
1324 Int_t nd,nf,nc,nkd,nkf,i,j;
1337 Range(0,0,xpad,ypad);
1342 clevel[nlevel] = obj;
1351 if (nlevel >= maxlev-1)
break;
1355 Int_t ilevel, nelem;
1356 for (ilevel=nlevel;ilevel>=0;ilevel--) {
1357 cl = clevel[ilevel];
1359 if (nelem > maxelem) maxelem = nelem;
1360 nc = (nelem/50) + 1;
1370 if (dx < 1.3) dx = 1.3;
1371 tsizcm = tsizcm - 0.03*
Double_t(ncdraw-5);
1372 if (tsizcm < 0.27) tsizcm = 0.27;
1377 for (ilevel=nlevel;ilevel>=0;ilevel--) {
1378 cl = clevel[ilevel];
1380 if (nelem > maxelem) maxelem = nelem;
1381 nc = (nelem/50) + 1;
1383 if (ilevel < nlevel)
x1 =
x2 + 0.5;
1414 if (
box)
box->SetFillColor(17);
1427 if (i >= nkd) { i = 1;
y = y1 - 0.5*dy;
x += 1/
Double_t(nc); }
1428 else { i++;
y -= dy; }
1432 Int_t dim =
d->GetArrayDim();
1436 while (indx < dim ){
1437 ldname = strlen(dname);
1438 snprintf(&dname[ldname],256-ldname,
"[%d]",
d->GetMaxIndex(indx));
1459 while ((
m = (
TMethod *) nextm())) {
1461 !strcmp(
m->GetName(),
"Dictionary" ) ||
1462 !strcmp(
m->GetName(),
"Class_Version" ) ||
1463 !strcmp(
m->GetName(),
"DeclFileName" ) ||
1464 !strcmp(
m->GetName(),
"DeclFileLine" ) ||
1465 !strcmp(
m->GetName(),
"ImplFileName" ) ||
1466 !strcmp(
m->GetName(),
"ImplFileLine" )
1469 if (fcount > nf)
break;
1470 if (i >= nkf) { i = 1;
y = ysep - 0.5*dy;
x += 1/
Double_t(nc); }
1471 else { i++;
y -= dy; }
1476 for (j=ilevel-1;j>=0;j--) {
1477 if (cl == clevel[ilevel]) {
1478 if (clevel[j]->GetMethodAny((
char*)
m->GetName())) {
1525 Int_t pxmin,pxmax,pymin,pymax,pxold,pyold,px,py;
1537 pxmax = canvas->
GetWw();
1539 pymax = cpad->
GetWh();
1541 if(pxold)
gVirtualX->DrawLine(pxold,pymin,pxold,pymax);
1542 if(pyold)
gVirtualX->DrawLine(pxmin,pyold,pxmax,pyold);
1588 if (
this != padsav) {
1589 Warning(
"DrawFrame",
"Must be called for the current pad only");
1596 if (hframe)
delete hframe;
1606 for (
Int_t i=1;i<=nbins;i++) {
1609 hframe =
new TH1F(
"hframe",title,nbins,xbins);
1622 if (padsav) padsav->
cd();
1638 gPad->SetFillColor(0);
1652 for (i=0;i<10;i++) {
1659 box->SetFillStyle(1001);
1660 box->SetFillColor(color);
1661 box->DrawBox(xlow, ylow, xup, yup);
1662 box->SetFillStyle(0);
1663 box->SetLineColor(1);
1664 box->DrawBox(xlow, ylow, xup, yup);
1694 const Int_t kMaxDiff = 5;
1695 const Int_t kMinSize = 20;
1696 static Int_t pxorg, pyorg;
1697 static Int_t px1, px2, py1, py2, pxl, pyl, pxt, pyt, pxold, pyold;
1698 static Int_t px1p, px2p, py1p, py2p, pxlp, pylp, pxtp, pytp;
1699 static Bool_t pA, pB, pC, pD, pTop, pL, pR, pBot, pINSIDE;
1722 pA = pB = pC = pD = pTop = pL = pR = pBot = pINSIDE =
kFALSE;
1766 if (newcode)
return;
1833 pA = pB = pC = pD = pTop = pL = pR = pBot = pINSIDE =
kFALSE;
1837 pxold = pxl; pyold = pyl; pA =
kTRUE;
1842 pxold = pxt; pyold = pyl; pB =
kTRUE;
1847 pxold = pxt; pyold = pyt; pC =
kTRUE;
1852 pxold = pxl; pyold = pyt; pD =
kTRUE;
1856 if ((px > pxl+kMaxDiff && px < pxt-kMaxDiff) &&
1858 pxold = pxl; pyold = pyl; pTop =
kTRUE;
1862 if ((px > pxl+kMaxDiff && px < pxt-kMaxDiff) &&
1864 pxold = pxt; pyold = pyt; pBot =
kTRUE;
1868 if ((py > pyl+kMaxDiff && py < pyt-kMaxDiff) &&
1870 pxold = pxl; pyold = pyl; pL =
kTRUE;
1874 if ((py > pyl+kMaxDiff && py < pyt-kMaxDiff) &&
1876 pxold = pxt; pyold = pyt; pR =
kTRUE;
1880 if ((px > pxl+kMaxDiff && px < pxt-kMaxDiff) &&
1881 (py > pyl+kMaxDiff && py < pyt-kMaxDiff)) {
1882 pxold = px; pyold = py; pINSIDE =
kTRUE;
1890 if (pA || pB || pC || pD || pTop || pL || pR || pBot)
1893 if (!pA && !pB && !pC && !pD && !pTop && !pL && !pR && !pBot && !pINSIDE)
1906 if (px > pxt-kMinSize) { px = pxt-kMinSize; wx = px; }
1907 if (py > pyt-kMinSize) { py = pyt-kMinSize; wy = py; }
1908 if (px < pxlp) { px = pxlp; wx = px; }
1909 if (py < pylp) { py = pylp; wy = py; }
1927 if (px < pxl+kMinSize) { px = pxl+kMinSize; wx = px; }
1928 if (py > pyt-kMinSize) { py = pyt-kMinSize; wy = py; }
1929 if (px > pxtp) { px = pxtp; wx = px; }
1930 if (py < pylp) { py = pylp; wy = py; }
1948 if (px < pxl+kMinSize) { px = pxl+kMinSize; wx = px; }
1949 if (py < pyl+kMinSize) { py = pyl+kMinSize; wy = py; }
1950 if (px > pxtp) { px = pxtp; wx = px; }
1951 if (py > pytp) { py = pytp; wy = py; }
1969 if (px > pxt-kMinSize) { px = pxt-kMinSize; wx = px; }
1970 if (py < pyl+kMinSize) { py = pyl+kMinSize; wy = py; }
1971 if (px < pxlp) { px = pxlp; wx = px; }
1972 if (py > pytp) { py = pytp; wy = py; }
1991 if (py2 > py1-kMinSize) { py2 = py1-kMinSize; wy = py2; }
1992 if (py2 < py2p) { py2 = py2p; wy = py2; }
2007 if (py1 < py2+kMinSize) { py1 = py2+kMinSize; wy = py1; }
2008 if (py1 > py1p) { py1 = py1p; wy = py1; }
2023 if (px1 > px2-kMinSize) { px1 = px2-kMinSize; wx = px1; }
2024 if (px1 < px1p) { px1 = px1p; wx = px1; }
2040 if (px2 < px1+kMinSize) { px2 = px1+kMinSize; wx = px2; }
2041 if (px2 > px2p) { px2 = px2p; wx = px2; }
2056 Int_t dx = px - pxold;
2057 Int_t dy = py - pyold;
2058 px1 += dx; py1 += dy; px2 += dx; py2 += dy;
2059 if (px1 < px1p) { dx = px1p - px1; px1 += dx; px2 += dx; wx = px+dx; }
2060 if (px2 > px2p) { dx = px2 - px2p; px1 -= dx; px2 -= dx; wx = px-dx; }
2061 if (py1 > py1p) { dy = py1 - py1p; py1 -= dy; py2 -= dy; wy = py-dy; }
2062 if (py2 < py2p) { dy = py2p - py2; py1 += dy; py2 += dy; wy = py+dy; }
2076 x1 =
x2 = y1 = y2 = 0;
2103 if (pTop || pBot || pL || pR || pINSIDE) {
2110 if (px != pxorg || py != pyorg) {
2134 if (pINSIDE)
gPad->ShowGuidelines(
this, event);
2135 if (pTop)
gPad->ShowGuidelines(
this, event,
't',
true);
2136 if (pBot)
gPad->ShowGuidelines(
this, event,
'b',
true);
2137 if (pL)
gPad->ShowGuidelines(
this, event,
'l',
true);
2138 if (pR)
gPad->ShowGuidelines(
this, event,
'r',
true);
2139 if (pA)
gPad->ShowGuidelines(
this, event,
'1',
true);
2140 if (pB)
gPad->ShowGuidelines(
this, event,
'2',
true);
2141 if (pC)
gPad->ShowGuidelines(
this, event,
'3',
true);
2142 if (pD)
gPad->ShowGuidelines(
this, event,
'4',
true);
2151 if (
gROOT->IsEscaped()) {
2156 if (opaque||ropaque) {
2159 x1 =
x2 = y1 = y2 = 0;
2185 if (pTop || pBot || pL || pR || pINSIDE) {
2192 if (pA || pB || pC || pD || pTop || pL || pR || pBot)
2198 if (px != pxorg || py != pyorg) {
2235 event =
gVirtualX->RequestLocator(1, 1, px, py);
2274 static Int_t axisNumber;
2276 static Int_t px1old, py1old, px2old, py2old;
2280 static TBox *zoombox;
2281 Double_t zbx1=0,zbx2=0,zby1=0,zby2=0;
2288 if (strstr(opt,
"cont4")) {
2297 if (!strcmp(axis->
GetName(),
"xaxis")) {
2301 if (!strcmp(axis->
GetName(),
"yaxis")) {
2305 if (!strcmp(axis->
GetName(),
"zaxis")) {
2311 if (axisNumber == 1) {
2317 }
else if (axisNumber == 2) {
2333 if (axisNumber == 1) {
2338 }
else if (axisNumber == 2) {
2352 zoombox =
new TBox(zbx1, zby1, zbx2, zby2);
2363 if (!opaque)
gVirtualX->SetLineColor(-1);
2371 if (axisNumber == 1) {
2381 if (axisNumber == 1) {
2386 }
else if (axisNumber == 2) {
2401 zoombox->
SetX1(zbx1);
2402 zoombox->
SetY1(zby1);
2403 zoombox->
SetX2(zbx2);
2404 zoombox->
SetY2(zby2);
2437 if (
gROOT->IsEscaped()) {
2439 if (opaque && zoombox) {
2448 if (ratio1 > ratio2) {
2453 if (ratio2 - ratio1 > 0.05) {
2455 if (axisNumber == 3 && hobj && hobj->
GetDimension() != 3) {
2464 Float_t newmin = zmin + (zmax-zmin)*ratio1;
2465 Float_t newmax = zmin + (zmax-zmin)*ratio2;
2489 if (axisNumber == 1) {
2497 }
else if (axisNumber == 2) {
2525 xmin = ((
xmin-xmi)/(xma-xmi))*(up-low)+low;
2526 xmax = ((
xmax-xmi)/(xma-xmi))*(up-low)+low;
2529 if (!strcmp(axis->
GetName(),
"xaxis")) axisNumber = 1;
2530 if (!strcmp(axis->
GetName(),
"yaxis")) axisNumber = 2;
2531 if (ratio2 - ratio1 > 0.05) {
2538 if (axisNumber == 1) axis->
SetRange(bin1,bin2);
2539 if (axisNumber == 2 && hobj1) {
2556 while ((obj= next())) {
2559 if (hobj == hobj1)
continue;
2562 if (axisNumber == 1) {
2564 }
else if (axisNumber == 2) {
2607 if (found)
return found;
2610 while ((cur = next())) {
2613 if (found)
return found;
2628 if (found)
return found;
2631 while ((cur = next())) {
2634 if (found)
return found;
2709 if (
fCanvas ==
this)
return nullptr;
2718 if (
fCanvas ==
this)
return nullptr;
2727 if (
fCanvas ==
this)
return nullptr;
2870 while ((obj=next())) {
2874 if (found)
return found;
2884 if (!subpadnumber) {
2891 while ((obj = next())) {
2894 if (pad->
GetNumber() == subpadnumber)
return pad;
2941 if (color <= 0)
return;
2959 gROOT->SetSelectedPad(
this);
2976 <<
" Name= "<<
GetName()<<
" Title= "<<
GetTitle()<<
" Option="<<option<<std::endl;
2988 if (opt.
Index(
"pfc")>=0 || opt.
Index(
"plc")>=0 || opt.
Index(
"pmc")>=0) {
3006 if (i>=ncolors) i = ncolors-1;
3018 Int_t const cellSize = 10;
3037 for (
int i = 0; i<
fCGnx; i++) {
3038 for (
int j = 0; j<
fCGny; j++) {
3049 for (
int i=0; i<np; i++) {
3058 TIter nextgraph(grlist);
3064 TIter nexthist(hlist);
3066 while ((oh = nexthist())) {
3080 for (
int r=i;
r<w+i;
r++) {
3081 for (
int c=j;
c<
h+j;
c++) {
3108 for (
Int_t i = 0; i<nxmax; i++) {
3109 for (
Int_t j = 0; j<=nymax; j++) {
3122#define NotFree(i, j) fCollideGrid[TMath::Max(TMath::Min(i+j*fCGnx,fCGnx*fCGny),0)] = kFALSE;
3149 yt = y1; y1 = y2; y2 = yt;
3151 for (i=
x1+1; i<
x2; i++) {
3158 yt = y1; y1 = y2; y2 = yt;
3161 for (j=y1+1; j<y2; j++) {
3181 for (
int i =
x1; i<=
x2; i++) {
3182 for (
int j = y1; j<=y2; j++)
NotFree(i, j);
3200 for (i =
x1; i<=
x2; i++) {
3205 for (i = y1; i<=y2; i++) {
3223 for (
Int_t i=1; i<
n; i++) {
3224 g->GetPoint(i-1,
x1,y1);
3225 g->GetPoint(i ,
x2,y2);
3239 (
int)((y1-
fY1)/ys), (
int)((y2-
fY1)/ys));
3252 if (
name.Index(
"hframe") >= 0)
return;
3257 bool haserrors =
false;
3258 TString drawOption =
h->GetDrawOption();
3262 if (drawOption.
Index(
"hist") < 0) {
3263 if (drawOption.
Index(
"e") >= 0) haserrors =
true;
3266 Int_t nx =
h->GetNbinsX();
3271 for (i = 1; i<nx; i++) {
3273 x1l =
h->GetBinCenter(i);
3279 y1l =
h->GetBinContent(i)-
h->GetBinErrorLow(i);
3285 y2l =
h->GetBinContent(i)+
h->GetBinErrorUp(i);
3291 for (j=y1; j<=y2; j++) {
3295 x1l =
h->GetBinLowEdge(i);
3301 y1l =
h->GetBinContent(i);
3308 x1l =
h->GetBinLowEdge(i)+
h->GetBinWidth(i);
3313 x1 = (int)((x1l-
fX1)/xs);
3329 box->SetFillColorAlpha(
kRed,0.5);
3340 for (
int i = 0; i<
fCGnx; i++) {
3343 for (
int j = 0; j<
fCGny; j++) {
3344 if (
gPad->GetLogx()) {
3351 if (
gPad->GetLogy()) {
3360 box->DrawBox(X1L, Y1L, X2L, Y2L);
3362 box->SetFillColorAlpha(
kRed,t);
3363 box->DrawBox(X1L, Y1L, X2L, Y2L);
3367 if (t==0.15) t = 0.1;
3461 began3DScene =
kTRUE;
3468 if (padsav) padsav->
cd();
3497 if (color < 0) color = -color;
3504 if (bordersize <= 0) bordersize = 2;
3525 if (px1 < px2) {xl =
fX1; xt =
fX2; }
3526 else {xl =
fX2; xt =
fX1;}
3527 if (py1 > py2) {yl =
fY1; yt =
fY2;}
3528 else {yl =
fY2; yt =
fY1;}
3530 Double_t frameXs[7] = {}, frameYs[7] = {};
3534 frameXs[0] = xl; frameYs[0] = yl;
3535 frameXs[1] = xl + realBsX; frameYs[1] = yl + realBsY;
3536 frameXs[2] = frameXs[1]; frameYs[2] = yt - realBsY;
3537 frameXs[3] = xt - realBsX; frameYs[3] = frameYs[2];
3538 frameXs[4] = xt; frameYs[4] = yt;
3539 frameXs[5] = xl; frameYs[5] = yt;
3540 frameXs[6] = xl; frameYs[6] = yl;
3547 frameXs[0] = xl; frameYs[0] = yl;
3548 frameXs[1] = xl + realBsX; frameYs[1] = yl + realBsY;
3549 frameXs[2] = xt - realBsX; frameYs[2] = frameYs[1];
3550 frameXs[3] = frameXs[2]; frameYs[3] = yt - realBsY;
3551 frameXs[4] = xt; frameYs[4] = yt;
3552 frameXs[5] = xt; frameYs[5] = yl;
3553 frameXs[6] = xl; frameYs[6] = yl;
3686 ((
TPad*)obj)->PaintModified();
3698 began3DScene =
kTRUE;
3706 if (padsav) padsav->
cd();
3727 if (!
gPad->IsBatch()) {
3730 if (option[0] ==
's') {
3743 xb[0] =
x1; xb[1] =
x1; xb[2] =
x2; xb[3] =
x2;
3744 yb[0] = y1; yb[1] = y2; yb[2] = y2; yb[3] = y1;
3793 if (option[0] ==
's') {
3796 if (style0 >= 3100 && style0 < 4000) {
3798 xb[0] =
x1; xb[1] =
x1; xb[2] =
x2; xb[3] =
x2;
3799 yb[0] = y1; yb[1] = y2; yb[2] = y2; yb[3] = y1;
3805 if (option[0] ==
'l') {
3824 while ((obj = next())) {
3826 if (obj == stop)
break;
3827 ((
TPad*)obj)->CopyBackgroundPixmap(
x,
y);
3828 ((
TPad*)obj)->CopyBackgroundPixmaps((
TPad*)obj, stop,
x,
y);
3847 Warning(
"TPad::PaintFillArea",
"Float_t signature is obsolete. Use Double_t signature.");
3865 std::vector<Double_t>
x(nc, 0.);
3866 std::vector<Double_t>
y(nc, 0.);
3875 if (fillstyle >= 3100 && fillstyle < 4000) {
3880 if (!
gPad->IsBatch())
3897 for (
int i=0; i<
n; i++) {
3941 static Double_t ang1[10] = { 0., 10., 20., 30., 45.,5., 60., 70., 80., 89.99};
3942 static Double_t ang2[10] = {180.,170.,160.,150.,135.,5.,120.,110.,100., 89.99};
3947 Int_t iAng1 = fasi%10;
3955 if (!
gPad->IsBatch()) {
3968 if (!
gPad->IsBatch()) {
3980 if (ang1[iAng1] != 5.)
PaintHatches(dy, ang1[iAng1], nn, xx, yy);
3981 if (ang2[iAng2] != 5.)
PaintHatches(dy, ang2[iAng2], nn, xx, yy);
3984 if (!
gPad->IsBatch()) {
4008 const Int_t maxnbi = 100;
4009 Double_t xli[maxnbi], xlh[2], ylh[2], xt1, xt2, yt1, yt2;
4010 Double_t ll,
x,
y,
x1,
x2, y1, y2,
a,
b, xi, xip, xin, yi, yip;
4016 ratiox = 1./(rwxmax-rwxmin);
4017 ratioy = 1./(rwymax-rwymin);
4030 gPad->GetPadPar(x1p,y1p,x2p,y2p);
4039 for (i=1; i<=nn; i++) {
4040 x = wndc*ratiox*(xx[i-1]-rwxmin);
4041 y = hndc*ratioy*(yy[i-1]-rwymin);
4042 yrot = sina*
x+cosa*
y;
4048 for (ycur=
ymax; ycur>=
ymin; ycur=ycur-dy) {
4050 for (i=2; i<=nn+1; i++) {
4053 if (i == nn+1) i2=1;
4054 x1 = wndc*ratiox*(xx[i1-1]-rwxmin);
4055 y1 = hndc*ratioy*(yy[i1-1]-rwymin);
4056 x2 = wndc*ratiox*(xx[i2-1]-rwxmin);
4057 y2 = hndc*ratioy*(yy[i2-1]-rwymin);
4058 xt1 = cosa*
x1-sina*y1;
4059 yt1 = sina*
x1+cosa*y1;
4060 xt2 = cosa*
x2-sina*y2;
4061 yt2 = sina*
x2+cosa*y2;
4072 if ((yi <= ycur) && (ycur < yip)) {
4074 if (nbi >= maxnbi)
return;
4084 if (nbi >= maxnbi)
return;
4087 if (nbi >= maxnbi)
return;
4094 a = (yt1-yt2)/(xt1-xt2);
4095 b = (yt2*xt1-xt2*yt1)/(xt1-xt2);
4104 if ((xi <= xin) && (xin < xip) &&
4108 if (nbi >= maxnbi)
return;
4117 for (i=1; i<=
m; i++) {
4118 if (xli[i] < xli[i-1]) {
4126 if (
inv == 0)
goto L50;
4132 if (nbi%2 != 0)
continue;
4134 for (i=1; i<=nbi; i=i+2) {
4136 xlh[0] = cosb*xli[i-1]-sinb*ycur;
4137 ylh[0] = sinb*xli[i-1]+cosb*ycur;
4138 xlh[1] = cosb*xli[i] -sinb*ycur;
4139 ylh[1] = sinb*xli[i] +cosb*ycur;
4141 xlh[0] = (xlh[0]/wndc)*(rwxmax-rwxmin)+rwxmin;
4142 ylh[0] = (ylh[0]/hndc)*(rwymax-rwymin)+rwymin;
4143 xlh[1] = (xlh[1]/wndc)*(rwxmax-rwxmin)+rwxmin;
4144 ylh[1] = (ylh[1]/hndc)*(rwymax-rwymin)+rwymin;
4145 gPad->PaintLine(xlh[0], ylh[0], xlh[1], ylh[1]);
4156 x[0] =
x1;
x[1] =
x2;
y[0] = y1;
y[1] = y2;
4165 if (!
gPad->IsBatch())
4181 if (!
gPad->IsBatch())
4206 for (i=0;i<3;i++) temp[i] = p1[i];
4208 for (i=0;i<3;i++) temp[i] = p2[i];
4210 PaintLine(xpad[0],xpad[1],xpad[3],xpad[4]);
4224 for (i=0;i<3;i++) temp[i] = p1[i];
4226 for (i=0;i<3;i++) temp[i] = p2[i];
4228 PaintLine(xpad[0],xpad[1],xpad[3],xpad[4]);
4244 Int_t i, i1=-1,np=1;
4245 for (i=0; i<
n-1; i++) {
4257 if (iclip == 0 && i <
n-2)
continue;
4258 if (!
gPad->IsBatch())
4291 if (option && (option[0] ==
'C')) mustClip =
kFALSE;
4294 Int_t i, i1=-1, np=1, iclip=0;
4296 for (i=0; i <
n-1; i++) {
4310 if (iclip == 0 && i <
n-2)
continue;
4311 if (!
gPad->IsBatch())
4336 if (!
gPad->IsBatch())
4342 for (
Int_t i=0; i<
n; i++) {
4361 for (
Int_t i = 1; i <
n; i++)
4380 for (i=0; i<
n; i++) {
4384 if (i <
n-1)
continue;
4386 if (np == 0)
continue;
4387 if (!
gPad->IsBatch())
4411 for (i=0; i<
n; i++) {
4415 if (i <
n-1)
continue;
4417 if (np == 0)
continue;
4418 if (!
gPad->IsBatch())
4436 if (!
gPad->IsBatch())
4449 if (!
gPad->IsBatch())
4462 if (!
gPad->IsBatch())
4479 if (!
gPad->IsBatch())
4507 if (
gPad == 0)
return 0;
4514 if (
this !=
gPad->GetCanvas()) {
4523 TPad *picked =
this;
4527 pickobj = &dummyLink;
4556 pick = ((
TPad*)obj)->
Pick(px, py, pickobj);
4561 }
else if (!
gROOT->GetEditorMode()) {
4568 if (
dist == 0)
break;
4583 if (
fView && !gotPrim) {
4607 if (picked ==
this) {
4630 while ((obj = next()))
4659 ((
TPad*)
this)->SaveAs(filename);
4671 while ((obj = next())) {