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);
517 while (
auto exec = (
TExec*)next())
560 if (!
lop)
return nullptr;
579 leg->AddEntry(obj,
mes.Data(),
"lpf");
583 while(
auto o = next()) {
591 else if (
strlen(o->GetName()))
594 mes = o->ClassName();
607 lof = ((
TH1 *)o)->GetListOfFunctions();
611 lof = ((
TGraph *)o)->GetListOfFunctions();
632 leg->AddEntry(obj,
mes.Data(), opt);
653 leg->AddEntry( obj,
mes.Data(), opt );
662 Info(
"BuildLegend",
"No object(s) to build a TLegend.");
705 while (
auto obj = next()) {
709 return ((
TPad*)obj)->
cd();
749 if (pp && pp->GetPS())
776 for (
Int_t i=0;i<2;i++) {
838 for (
Int_t i=0;i<2;i++) {
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;
968 for (i = 0; i <
n; i++) {
996 for (i = 0; i <
nc2; i++) {
1023 for (i = 0; i <
nc; i++) {
1051 for (i = 0; i <
nc2; i++) {
1112 if (!
gROOT->GetListOfCanvases())
return;
1114 gROOT->GetListOfCanvases()->Remove(
this);
1136 if (
gROOT->GetSelectedPad() ==
this)
1137 gROOT->SetSelectedPad(
nullptr);
1161 while (
auto obj = next()) {
1162 if (
auto pad =
dynamic_cast<TPad*
>(obj)) {
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) ) {
1309 if (
nx <= 0)
nx = 1;
1310 if (
ny <= 0)
ny = 1;
1321 for (iy=0;iy<
ny;iy++) {
1325 if (
y1 >
y2)
continue;
1326 for (ix=0;ix<
nx;ix++) {
1329 if (
x1 >
x2)
continue;
1358 if (i ==
nx-1)
x2 = 1-
xr;
1360 number =
j*
nx + i +1;
1363 if (
j == 0)
y2 = 1-
yt;
1364 if (
j ==
ny-1)
y1 = 0;
1368 pad->SetNumber(number);
1369 pad->SetBorderMode(0);
1370 if (i == 0)
pad->SetLeftMargin(
xl*
nx);
1371 else pad->SetLeftMargin(0);
1372 pad->SetRightMargin(0);
1373 pad->SetTopMargin(0);
1375 else pad->SetBottomMargin(0);
1419 Error(
"DivideRatios",
"The canvas top margin must be >= 0 and <= 1");
1425 Error(
"DivideRatios",
"The canvas left margin must be >= 0 and <= 1");
1432 for (
int i=0; i<
nyl; i++) {
1436 Error(
"DivideRatios",
"Y ratios plus the top margin must be >= 0 and <= 1");
1447 for (
int j=0;
j<
nxl;
j++) {
1451 Error(
"DivideRatios",
"X ratios must be >= 0 and <= 1");
1462 for (
int i=0; i<
nyl; i++) {
1466 for (
int j=0;
j<
nxl;
j++) {
1493 Error(
"DivideSquare",
"No canvas associated with this pad.");
1516 gROOT->MakeDefCanvas();
1607 if (
dx < 1.3)
dx = 1.3;
1651 if (
box)
box->SetFillColor(17);
1665 else { i++;
y -=
dy; }
1669 Int_t dim =
d->GetArrayDim();
1673 while (
indx < dim ){
1708 else { i++;
y -=
dy; }
1716 ptext->SetTextColor(15);
1783 pp->SetAttLine({1,1,1});
1802 u = 1. * px / canvas->
GetWw();
1803 v = 1. - 1. * py / canvas->
GetWh();
1846 Warning(
"DrawFrame",
"Must be called for the current pad only");
1875 hframe->SetDirectory(
nullptr);
1894 gPad->SetFillColor(0);
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);
2072 case -1:
npy2 = py1 -
dy;
break;
2074 case 1:
npy1 = py2 +
dy;
break;
2108 std::swap(px1, px2);
2111 std::swap(py1, py2);
2246 px2 += px -
dpx1 - px1;
2248 py1 += py -
dpy2 - py2;
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;
2284 if (
gROOT->IsEscaped()) {
2361 static std::unique_ptr<TBox>
zoombox;
2369 if (
strstr(opt,
"cont4")) {
2433 if (!pp->IsSupportAlpha() || !
zoomcolor)
2444 pp->SetAttLine({-1, 1, 1});
2528 if (
gROOT->IsEscaped()) {
2629 if (
hobj1->GetDimension() == 1) {
2630 if (
hobj1->GetNormFactor() != 0) {
2645 while ((obj= next())) {
2654 if (
hobj->GetDimension() == 1) {
2657 if (
hobj->GetNormFactor() != 0) {
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;
3015 while ((obj=next())) {
3019 if (found)
return found;
3036 while ((obj = next())) {
3107 gROOT->SetSelectedPad(
this);
3134 if (opt.
Index(
"pfc")>=0 || opt.
Index(
"plc")>=0 || opt.
Index(
"pmc")>=0) {
3164 Int_t const cellSize = 10;
3171 for (
int i = 0; i <
fCGnx; i++)
3178 while(
auto o = iter()) {
3209 for (
int r = i;
r <
w + i;
r++) {
3210 for (
int c =
j;
c <
h +
j;
c++) {
3248 for (std::size_t i = 0;
option[i] !=
'\0'; ++i) {
3297#define NotFree(i, j) fCollideGrid[TMath::Max(TMath::Min(i+j*fCGnx,fCGnx*fCGny),0)] = kFALSE;
3326 for (i=
x1+1; i<
x2; i++) {
3356 for (
int i =
x1; i<=
x2; i++) {
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);
3427 if (
name.Index(
"hframe") >= 0)
return;
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);
3470 x1l =
h->GetBinLowEdge(i);
3476 y1l =
h->GetBinContent(i);
3483 x1l =
h->GetBinLowEdge(i)+
h->GetBinWidth(i);
3508 box.SetFillColorAlpha(
kRed,0.5);
3519 for (
int i = 0; i<
fCGnx; i++) {
3541 box.SetFillColorAlpha(
kRed,t);
3546 if (t==0.15) t = 0.1;
3700 if (!
IsBatch() && (pp->IsCocoa() || (pp->IsNative() && (
style > 3000) && (
style < 3026))))
3701 pp->ClearDrawable();
3715 pp->SetAttFill({color, 1001});
3716 pp->SetOpacity(
style - 4000);
3718 }
else if ((
style >= 4000) && (
style <= 4100) && pp->IsCocoa() && (
this ==
fMother))
3720 else if ((color == 10) && (
style > 3000) && (
style < 3100))
3724 pp->SetAttFill({color,
style});
3725 pp->SetAttLine(*
this);
3738 box.SetFillColor(color);
3813 glist->AddFirst(frame);
3832 auto obj =
lnk->GetObject();
3834 ((
TPad*)obj)->PaintModified();
3868 ((
TPad*)obj)->PaintModified();
3937 }
else if (
style > 0)
3962 while (
auto obj = next()) {
3965 if (
auto pad =
dynamic_cast<TPad *
>(obj))
3966 pad->CopyBackgroundPixmaps(stop,
x,
y);
3974 Warning(
"TPad::PaintFillArea",
"Float_t signature is obsolete. Use Double_t signature.");
3992 std::vector<Double_t>
x(
nc, 0.);
3993 std::vector<Double_t>
y(
nc, 0.);
4010 pp->DrawFillArea(
n,
x.data(),
y.data());
4020 std::vector<Double_t>
xw(
n),
yw(
n);
4021 for (
int i=0; i<
n; i++) {
4063 static Double_t ang1[10] = { 0., 10., 20., 30., 45.,5., 60., 70., 80., 89.99};
4064 static Double_t ang2[10] = {180.,170.,160.,150.,135.,5.,120.,110.,100., 89.99};
4103 std::vector<Double_t>
xli;
4104 std::vector<Double_t>
yli;
4107 Double_t x,
y,
x1,
x2,
y1,
y2,
a,
b, xi,
xip,
xin,
yi,
yip;
4136 for (i=1; i<=
nn; i++) {
4153 for (i=2; i<=
nn+1; i++) {
4156 if (i ==
nn+1)
i2=1;
4221 if ((
nbi%2 != 0) || (
nbi == 0))
4224 for (i=0; i<
nbi; ++i) {
4254 pp->DrawLine(
x[0],
y[0],
x[1],
y[1]);
4284 for (i=0;i<3;i++) temp[i] =
p1[i];
4286 for (i=0;i<3;i++) temp[i] =
p2[i];
4302 for (i=0;i<3;i++) temp[i] =
p1[i];
4304 for (i=0;i<3;i++) temp[i] =
p2[i];
4327 if (z<
rmin[2] || z>
rmax[2])
return;
4346 for (i=0; i<
n-1; i++) {
4359 if (
iclip == 0 && i <
n-2)
4363 pp->DrawPolyLine(
np, &
x[
i1], &
y[
i1]);
4398 for (i=0; i <
n-1; i++) {
4413 if (
iclip == 0 && i <
n-2)
4417 pp->DrawPolyLine(
np, &
x[
i1], &
y[
i1]);
4442 pp->DrawPolyLineNDC(
n,
x,
y);
4456 for (
Int_t i = 1; i <
n; i++)
4475 for (i=0; i<
n; i++) {
4479 if (i <
n-1)
continue;
4485 pp->DrawPolyMarker(
np, &
x[
i1], &
y[
i1]);
4506 for (i=0; i<
n; i++) {
4510 if (i <
n-1)
continue;
4516 pp->DrawPolyMarker(
np, &
x[
i1], &
y[
i1]);
4546 for (
Int_t i = 0; i < 2*
n; i+=2) {
4549 x[i] =
y[i] =
x[i+1] =
y[i+1] = 0;
4558 pp->DrawSegments(
n,
x,
y);
4574 pp->DrawSegmentsNDC(
n,
u,
v);
4664 if (!
gPad)
return nullptr;
4671 if (
this !=
gPad->GetCanvas()) {
4719 }
else if (!
gROOT->GetEditorMode()) {
4726 if (dist == 0)
break;
4788 while (
auto obj = next())
4813 while (
auto obj = next()) {
4991 if (
fs1.EndsWith(
"[")) {
4992 fs1.Replace((
fs1.Length()-1),1,
" ");
4994 fs1.Replace((
fs1.Length()-1),1,
"[");
4995 }
else if (
fs1.EndsWith(
"]")) {
4996 fs1.Replace((
fs1.Length()-1),1,
" ");
4998 fs1.Replace((
fs1.Length()-1),1,
"]");
5012 if (!
fs1.Length()) {
5020 if (
psname.BeginsWith(
'.') && (
psname.Contains(
'/') == 0)) {
5029 if (!title &&
strstr(opt,
"gif+")) {
5032 }
else if (!title &&
strstr(opt,
"gif")) {
5035 }
else if (!title &&
strstr(opt,
"png")) {
5038 }
else if (!title &&
strstr(opt,
"jpg")) {
5041 }
else if (!title &&
strstr(opt,
"tiff")) {
5044 }
else if (!title &&
strstr(opt,
"xpm")) {
5047 }
else if (!title &&
strstr(opt,
"bmp")) {
5059 if (
strstr(opt,
"html")) {
5073 gPad->GetCanvas()->SetHighLightColor(-1);
5074 gPad->ModifiedUpdate();
5076 pp->SelectDrawable(
wid);
5080 Info(
"Print",
"GIF file %s has been created",
psname.Data());
5082 gPad->GetCanvas()->SetHighLightColor(
hc);
5087 gPad->GetCanvas()->SetHighLightColor(-1);
5088 gPad->ModifiedUpdate();
5090 if (
gPad->GetCanvas()->UseGL())
5091 gPad->UpdateAsync();
5092 gPad->GetCanvasImp()->UpdateDisplay(1,
kTRUE);
5096 Info(
"Print",
"file %s has been created",
psname.Data());
5098 gPad->GetCanvas()->SetHighLightColor(
hc);
5100 Warning(
"Print",
"Unsupported image format %s",
psname.Data());
5106 if (!title &&
strstr(opt,
"cxx")) {
5112 if (!title &&
strstr(opt,
"root")) {
5118 if (!title &&
strstr(opt,
"xml")) {
5125 if (!title &&
strstr(opt,
"json")) {
5131 if (!title &&
strstr(opt,
"svg")) {
5144 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualPS",
"svg")) {
5145 if (
h->LoadPlugin() == -1)
5166 Info(
"Print",
"SVG file %s has been created",
psname.Data());
5175 if (!title && (
strstr(opt,
"tex") ||
strstr(opt,
"Standalone"))) {
5188 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualPS",
"tex")) {
5189 if (
h->LoadPlugin() == -1)
5214 Info(
"Print",
"Standalone TeX file %s has been created",
psname.Data());
5216 Info(
"Print",
"TeX file %s has been created",
psname.Data());
5254 if (ratio < 1)
pstype = 112;
5266 if (
strstr(opt,
"pdf") || title ||
strstr(opt,
"EmbedFonts"))
5271 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualPS",
pluginName)) {
5272 if (
h->LoadPlugin() == -1)
5309 else Info(
"Print",
"%s file %s has been created using the current canvas", opt.
Data(),
psname.Data());
5325 if (
cclose)
Info(
"Print",
"Current canvas added to %s file %s and file closed", opt.
Data(),
psname.Data());
5326 else Info(
"Print",
"%s file %s has been closed", opt.
Data(),
psname.Data());
5331 Info(
"Print",
"Current canvas added to %s file %s", opt.
Data(),
psname.Data());
5339 if (
strstr(opt,
"Preview"))
5341 if (
strstr(opt,
"EmbedFonts")) {
5342 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",
5357 Error(
"Range",
"illegal world coordinates range: x1=%f, y1=%f, x2=%f, y2=%f",
x1,
y1,
x2,
y2);
5395 Error(
"RangeAxis",
"illegal axis coordinates range: xmin=%f, ymin=%f, xmax=%f, ymax=%f",
5486 while ((obj = next())) {
5498 if (
g)
hobj =
g->GetHistogram();
5510 else hobj->DrawCopy(
"sameaxis");
5515 gPad->GetUxmax(),
gPad->GetUymax());
5517 b->SetLineStyle(
gPad->GetFrameLineStyle());
5518 b->SetLineWidth(
gPad->GetFrameLineWidth());
5519 b->SetLineColor(
gPad->GetFrameLineColor());
5651 Error(
"ResizePad",
"Cannot resize pad. No current pad available.");
5654 if (
gPad->GetWw()==0.0||
gPad->GetWh()==0.0) {
5655 Warning(
"ResizePad",
"gPad has at least one zero dimension.");
5659 Warning(
"ResizePad",
"The pad has at least one zero dimension.");
5664 if (
this ==
gPad->GetCanvas()) {
5672 Warning(
"ResizePad",
"The parent pad has at least one zero dimension.");
5721 while (
auto obj = next()) {
5727 if (
gPad->IsBatch())
5730 if (pp->IsNative()) {
5732 auto attl = pp->GetAttLine();
5733 attl.SetLineColor(-1);
5734 pp->SetAttLine(
attl);
5735 auto attt = pp->GetAttText();
5736 attt.SetTextSize(-1);
5738 pp->SetAttText(
attt);
5749 Warning(
"ResizePad",
"Inf/NaN propagated to the pad. Check drawn objects.");
5751 Warning(
"ResizePad",
"%s width changed from %d to %d\n",
GetName(),
w,10);
5755 Warning(
"ResizePad",
"%s height changed from %d to %d\n",
GetName(),
h,10);
5816 if (
psname.BeginsWith(
'.') && (
psname.Contains(
'/') == 0)) {
5823 if (
psname.EndsWith(
".gif"))
5825 else if (
psname.Contains(
".gif+"))
5829 else if (
psname.EndsWith(
".root"))
5831 else if (
psname.EndsWith(
".xml"))
5833 else if (
psname.EndsWith(
".json"))
5835 else if (
psname.EndsWith(
".html"))
5837 else if (
psname.EndsWith(
".eps"))
5839 else if (
psname.EndsWith(
".pdf") ||
psname.EndsWith(
".pdf[") ||
psname.EndsWith(
".pdf]") ||
psname.EndsWith(
".pdf("))
5841 else if (
psname.EndsWith(
".svg"))
5843 else if (
psname.EndsWith(
".tex"))
5845 else if (
psname.EndsWith(
".xpm"))
5847 else if (
psname.EndsWith(
".png"))
5849 else if (
psname.EndsWith(
".jpg") ||
psname.EndsWith(
".jpeg"))
5851 else if (
psname.EndsWith(
".bmp"))
5853 else if (
psname.EndsWith(
".tiff"))
5885 if (
this ==
gPad->GetCanvas())
5892 if (
this !=
gPad->GetCanvas()) {
5894 out <<
"// ------------>Primitives in pad: " <<
GetName() <<
"\n";
5895 out <<
" TPad *" <<
cname <<
" = new TPad(\"" <<
GetName() <<
"\", \""
5898 out <<
" " <<
cname <<
"->Draw();\n";
5899 out <<
" " <<
cname <<
"->cd();\n";
5901 out <<
" " <<
cname <<
"->Range(" <<
fX1 <<
"," <<
fY1 <<
"," <<
fX2 <<
"," <<
fY2 <<
");\n";
5906 out <<
" TView::CreateView(1)->SetRange(" <<
rmin[0] <<
", " <<
rmin[1] <<
", " <<
rmin[2] <<
", " <<
rmax[0]
5907 <<
", " <<
rmax[1] <<
", " <<
rmax[2] <<
");\n";
5917 out <<
" " <<
cname <<
"->SetLogx();\n";
5919 out <<
" " <<
cname <<
"->SetLogy();\n";
5921 out <<
" " <<
cname <<
"->SetLogz();\n";
5923 out <<
" " <<
cname <<
"->SetGridx();\n";
5925 out <<
" " <<
cname <<
"->SetGridy();\n";
5927 out <<
" " <<
cname <<
"->SetTickx(" <<
GetTickx() <<
");\n";
5929 out <<
" " <<
cname <<
"->SetTicky(" <<
GetTicky() <<
");\n";
5931 out <<
" " <<
cname <<
"->SetTheta(" <<
GetTheta() <<
");\n";
5933 out <<
" " <<
cname <<
"->SetPhi(" <<
GetPhi() <<
");\n";
5965 out <<
" " <<
cname <<
"->SetFrameFillStyle(" << frame->
GetFillStyle() <<
");\n";
5967 out <<
" " <<
cname <<
"->SetFrameLineStyle(" << frame->
GetLineStyle() <<
");\n";
5971 out <<
" " <<
cname <<
"->SetFrameLineWidth(" << frame->
GetLineWidth() <<
");\n";
5980 while (
auto obj = next()) {
5984 out <<
" " <<
pname <<
"->cd();\n";
5986 out <<
" " <<
cname <<
"->cd();\n";
5989 out <<
" " <<
cname <<
"->Modified();\n";
6002 Error(
"SetAspectRatio",
"cannot fix aspect ratio, height of pad is 0");
6026 while ((obj = next())) {
6103 if ((xlow < 0) || (xlow > 1) || (ylow < 0) || (ylow > 1)) {
6104 Error(
"TPad",
"illegal bottom left position: x=%f, y=%f", xlow, ylow);
6107 if ((xup < 0) || (xup > 1) || (yup < 0) || (yup > 1)) {
6108 Error(
"TPad",
"illegal top right position: x=%f, y=%f", xup, yup);
6111 if (xup-xlow <= 0) {
6112 Error(
"TPad",
"illegal width: %f", xup-xlow);
6115 if (yup-ylow <= 0) {
6116 Error(
"TPad",
"illegal height: %f", yup-ylow);
6153 SetPad(xlow, ylow, xup, yup);
6161 if (!view)
delete fView;
6174 pp->SetAttFill({color,
style});
6210 if (font % 10 > 2) {
6223 pp->SetAttText({align,
angle, color, font,
tsize});
6253 else if (
mode ==
'y') {
6338 if (
mode !=
'i') resize =
true;
6345 is_pad->GetMother()->cd();
6396 if (cling && (!resize)) {
6397 cur->SetBBoxCenterX(
pMX);
6398 center =
cur->GetBBoxCenter();
6399 BBox =
cur->GetBBox();
6400 center =
cur->GetBBoxCenter();
6408 if (cling && (!resize)) {
6409 cur->SetBBoxCenterY(
pMY);
6410 center =
cur->GetBBoxCenter();
6411 BBox =
cur->GetBBox();
6412 center =
cur->GetBBoxCenter();
6420 for (
UInt_t i = 0; i<
n; i++) {
6426 if (cling && (!resize)) {
6428 BBox =
cur->GetBBox();
6429 center =
cur->GetBBoxCenter();
6438 if (cling && (!resize)) {
6440 BBox =
cur->GetBBox();
6441 center =
cur->GetBBoxCenter();
6453 for (
UInt_t i = 0; i<
n; i++) {
6488 if (cling && (!
movedX) && (!resize)) {
6489 if ((
cur->GetBBoxCenter().fX <
curDist[i].fb->GetBBoxCenter().fX)||(
cur->GetBBoxCenter().fX <
curDist[i].fa->GetBBoxCenter().fX))
6498 if (cling && (!
movedY) && (!resize)) {
6499 if ((
cur->GetBBoxCenter().fY <
curDist[i].fb->GetBBoxCenter().fY)||(
cur->GetBBoxCenter().fY <
curDist[i].fa->GetBBoxCenter().fY))
6511 if (cling && (!
movedX) && (!resize)) {
6512 if ((
cur->GetBBoxCenter().fX <
curDist[i].fb->GetBBoxCenter().fX)||(
cur->GetBBoxCenter().fX <
curDist[i].fa->GetBBoxCenter().fX))
6514 else cur->SetBBoxCenterX(
cur->GetBBoxCenter().fX + floor(0.5*(
curDist[
j].fdist -
curDist[i].fdist)));
6521 if (cling && (!
movedY) && (!resize)) {
6522 if ((
cur->GetBBoxCenter().fY <
curDist[i].fb->GetBBoxCenter().fY)||(
cur->GetBBoxCenter().fY <
curDist[i].fa->GetBBoxCenter().fY))
6524 else cur->SetBBoxCenterY(
cur->GetBBoxCenter().fY + floor(0.5*(
curDist[
j].fdist -
curDist[i].fdist)));
6534 for (
UInt_t i = 0; i<
n; i++) {
6536 if (
a && (
cur !=
a)) {
6545 BBox =
cur->GetBBox();
6568 BBox =
cur->GetBBox();
6684 if (
b.IsReading()) {
6703 while ((obj = next())) {
6930 while ((obj = next())) {
7029 if (
gROOT->GetEditorMode() == 0) {
7032 if (obj)
return obj;
7035 if (!
gPad->GetListOfPrimitives())
return nullptr;
7036 obj =
gPad->GetListOfPrimitives()->Last();
7037 if (obj !=
oldlast)
return obj;
7058 if (
gPad->IsBatch())
return nullptr;
7082 (
size_t)
tip,(
size_t)
this).Data());
7100 ::Info(
"TPad::x3d()",
"This function is deprecated. Use %s->GetViewer3D(\"x3d\") instead",this->
GetName());
7103 if (!type || !
type[0]) {
7148 Warning(
"GetViewer3D",
"Cannot create 3D viewer of type: %s",
type);
7259 p.SetX(
gPad->XtoPixel(
x));
7260 p.SetY(
gPad->YtoPixel(
y));
const Int_t kMaxPixel
Max value for an int.
short Style_t
Style number (short)
bool Bool_t
Boolean (0=false, 1=true) (bool)
int Int_t
Signed integer 4 bytes (int)
short Color_t
Color number (short)
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)
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
short Width_t
Line width (short)
float Float_t
Float 4 bytes (float)
short Short_t
Signed Short integer 2 bytes (short)
double Double_t
Double 8 bytes.
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
const char Option_t
Option string (const char)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t cursor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t SetFillStyle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize wid
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint angle
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void SetCursor
Option_t Option_t SetFillColor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t button
Option_t Option_t TPoint TPoint const char text
Option_t Option_t TPoint TPoint const char y1
Double_t pixel_boundary(Double_t v)
Check value for valid range for pixel values.
static Bool_t ContainsTImage(TList *li)
Auxiliary function.
R__EXTERN TPluginManager * gPluginMgr
R__EXTERN TVirtualMutex * gROOTMutex
R__EXTERN TStyle * gStyle
R__EXTERN TSystem * gSystem
#define R__LOCKGUARD(mutex)
R__EXTERN TVirtualPS * gVirtualPS
R__EXTERN Int_t(* gThreadXAR)(const char *xact, Int_t nb, void **ar, Int_t *iret)
const_iterator begin() const
const_iterator end() const
Draw all kinds of Arrows.
void Draw(Option_t *option="") override
Draw this arrow with its current attributes.
Abstract base class for elements drawn in the editor.
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)
Save fill attributes as C++ statement(s) on output stream out.
virtual void Streamer(TBuffer &)
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
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
Copy this line attributes to a new TAttLine.
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 Float_t GetTextSize() const
Return the text size.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual Short_t GetTextAlign() const
Return the text alignment.
virtual Font_t GetTextFont() const
Return the text font.
virtual Color_t GetTextColor() const
Return the text color.
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
virtual Float_t GetTextAngle() const
Return 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 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.
UInt_t GetWindowHeight() const
TObject * GetClickSelected() const
TVirtualPad * GetClickSelectedPad() const
void SetClickSelectedPad(TPad *pad)
void SetSelectedPad(TPad *pad)
void SetDoubleBuffer(Int_t mode=1) override
Set Double Buffer On/Off.
TCanvasImp * GetCanvasImp() const override
Bool_t IsRetained() const override
Int_t GetEventY() const override
Bool_t IsBatch() const override
TVirtualPadPainter * GetCanvasPainter()
Access and (probably) creation of pad painter.
Color_t GetHighLightColor() const override
Bool_t EnsurePSPainter(Bool_t create, TVirtualPadPainter *&oldp)
Replace canvas painter For internal use only - when creating PS images.
Bool_t IsGrayscale()
Check whether this canvas is to be drawn in grayscale mode.
void SaveSource(const char *filename="", Option_t *option="")
Save primitives in this canvas as a C++ macro file.
virtual void HandleInput(EEventType button, Int_t x, Int_t y)
Handle Input Events.
void UpdateAsync() override
Asynchronous pad update.
TObject * GetSelected() const override
Int_t GetEventX() const override
void SetCanvasSize(UInt_t ww, UInt_t wh) override
Set Width and Height of canvas to ww and wh respectively.
TVirtualPad * GetSelectedPad() const override
void SetCursor(ECursor cursor) override
Set cursor.
Int_t GetCanvasID() const override
UInt_t GetWindowWidth() const
void FeedbackMode(Bool_t set)
Turn rubberband feedback mode on or off.
void SetClickSelected(TObject *obj)
TVirtualPad * GetPadSave() const override
void Update() override
Update canvas pad buffers.
virtual void Cleared(TVirtualPad *pad)
Emit pad Cleared signal.
UInt_t GetWw() const override
Bool_t OpaqueMoving() const override
UInt_t GetWh() const override
void SetSelected(TObject *obj) override
Set selected canvas.
Int_t GetEvent() const override
Bool_t IsWeb() const override
Is web canvas.
void SetBatch(Bool_t batch=kTRUE) override
Toggle batch mode.
TVirtualPad * fHilightPadBorder
! pad which border will be hilghlighrt when paint canvas
Bool_t OpaqueResizing() const override
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.
void ls(Option_t *option="") const override
List (ls) all objects in this collection.
void Browse(TBrowser *b) override
Browse this collection (called by TBrowser).
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
static TString SavePrimitiveColor(Int_t ci)
Convert color in C++ statement which can be used in SetColor directives Produced statement either inc...
static void SetGrayscale(Bool_t set=kTRUE)
Set whether all colors should return grayscale values.
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...
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
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.
void UseCurrentStyle() override
Replace current frame attributes by current style.
A TGraph is an object made of two arrays X and Y with npoints each.
@ 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.
@ kNoStats
Don't draw stats box.
@ kIsZoomed
Bit set when zooming on Y axis.
The Histogram stack class.
Option_t * GetOption() const
This class displays a legend box (TPaveText) containing several legend entries.
Use the TLine constructor to create a simple line.
Option_t * GetOption() const override
Returns the object option stored in the list.
void Clear(Option_t *option="") override
Remove all objects from the list.
virtual TObjLink * LastLink() const
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void RecursiveRemove(TObject *obj) override
Remove object from this collection and recursively remove the object from all other objects (and coll...
void Add(TObject *obj) override
TObject * Remove(TObject *obj) override
Remove object from the list.
void AddLast(TObject *obj) override
Add object at the end of the list.
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
virtual TObjLink * FirstLink() const
void AddFirst(TObject *obj) override
Add object at the beginning of the list.
Each ROOT class (see TClass) has a linked list of methods.
A TMultiGraph is a collection of TGraph (or derived) objects.
TH1F * GetHistogram()
Returns a pointer to the histogram used to draw the axis.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Wrapper around a TObject so it can be stored in a TList.
Mother of all ROOT objects.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Computes distance from point (px,py) to the object.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
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 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.
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.
@ 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.