23 #include "TVirtualX.h" 26 #include "TMultiGraph.h" 35 #include "TPaveStats.h" 36 #include "TPaveLabel.h" 43 #include "TCanvasImp.h" 48 #include <QFileDialog> 50 #include <QInputDialog> 52 #include <QtCore/QSignalMapper> 73 #include "TGo4LockGuard.h" 125 setAttribute(Qt::WA_DeleteOnClose);
148 MarkerPanel->setVisible(
false);
155 QSizePolicy sizePolicy3(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(7));
156 sizePolicy3.setHorizontalStretch(0);
157 sizePolicy3.setVerticalStretch(20);
168 fxWCanvas->setMinimumSize(QSize(50, 50));
169 sizePolicy3.setHeightForWidth(
fxWCanvas->sizePolicy().hasHeightForWidth());
172 fxGridLayout->addWidget(
fxWCanvas, 1, 1, 1, 1);
183 fxQCanvas->setMinimumSize(QSize(50, 50));
184 sizePolicy3.setHeightForWidth(
fxQCanvas->sizePolicy().hasHeightForWidth());
187 fxGridLayout->addWidget(
fxQCanvas, 1, 1, 1, 1);
205 QMenu* fileMenu =
fMenuBar->addMenu(
"F&ile");
217 QMenu* editMenu =
fMenuBar->addMenu(
"&Edit");
222 bool ed_visible =
false, ed_allowed =
true;
240 editMenu->addSeparator();
252 #if QT_VERSION < QT_VERSION_CHECK(5,15,0) 253 auto signal = QOverload<int>::of(&QSignalMapper::mapped);
255 auto signal = &QSignalMapper::mappedInt;
281 QCheckBox* box1 =
new QCheckBox(
"Apply to all", MenuFrame);
282 box1->setObjectName(
"ApplyToAllCheck");
289 QHBoxLayout* menugrid =
new QHBoxLayout(
nullptr);
290 menugrid->setContentsMargins(0,0,0,0);
291 menugrid->setSpacing(0);
292 menugrid->addWidget(
fMenuBar, 10, Qt::AlignLeft);
293 menugrid->addWidget(box1, 1, Qt::AlignRight);
296 fxGridLayout->addLayout(menugrid, 0, 0, 1, 2);
353 if (gROOT->GetSelectedPad())
354 if (
IsPanelPad((TPad *) gROOT->GetSelectedPad()))
355 gROOT->SetSelectedPad(
nullptr);
378 return new TGo4Slot(parent, name,
"title");
391 if (strcmp(linkname,
"PadRangeAxisChanged") == 0) {
393 }
else if (strcmp(linkname,
"PadModified") == 0) {
442 TPad *pad = (TPad *) obj;
471 || cl->InheritsFrom(TGo4Condition::Class());
479 if (cl->InheritsFrom(TGo4Fitter::Class())) {
486 && !cl->InheritsFrom(TGo4Condition::Class()))
532 parentWidget()->close();
548 if (!padslot)
return QString();
549 return QString(padslot->
GetPar(
"::SelMarker"));
555 if (!padslot)
return -1;
557 if (!padslot->
GetIntPar(
"::SelIndex", selindex))
return -1;
564 if (selobj) *selobj =
nullptr;
570 if (!padslot || selname.isEmpty())
return nullptr;
572 for (
int n = 0; n < padslot->
NumChilds(); n++) {
578 if (obj->InheritsFrom(TGo4Condition::Class()))
586 if (!obj || (selname != obj->GetName()))
591 if (obj->InheritsFrom(TGo4CondArray::Class())) {
594 if ((selindex >= 0) && (selindex < arr->
GetNumber()))
595 selcond = arr->
At(selindex);
600 if (selcond->InheritsFrom(TGo4WinCond::Class()))
602 else if (selcond->InheritsFrom(TGo4PolyCond::Class()))
628 while (iter.
next()) {
633 if (linkname && (strcmp(linkname, itemname) == 0))
645 while (iter.
next()) {
651 if (cnt++ == itemcnt)
return linkname;
667 while (iter.
next()) {
672 if (linkname && (strcmp(linkname, itemname) == 0)) {
673 delslots.Add(subslot);
681 if (delslots.GetLast() >= 0) {
696 if (selname.isEmpty())
706 if (selname.length() > 0)
707 padslot->
SetPar(
"::SelMarker", selname.toLatin1().constData());
712 padslot->
SetIntPar(
"::SelIndex", selindex);
717 TObject *newselobj =
nullptr;
720 if ((selindex >= 0) && newselslot) {
721 QString drawopt(
"sel=");
722 drawopt += QString::number(selindex);
726 if (((oldselindex != selindex) || (oldselname != selname))
727 && ((oldselindex >= 0) || (selindex >= 0))) {
730 }
else if (newselobj) {
745 if (!padslot)
return;
749 for (
int n = 0; n < padslot->
NumChilds(); n++) {
755 if (obj && (strcmp(obj->GetName(), name) == 0)) {
767 if (strcmp(cond->GetName(), name) == 0) {
770 if (cond->InheritsFrom(TGo4PolyCond::Class()))
784 for (
int ncon = 0; ncon < arr->
GetNumber(); ncon++)
785 if (strcmp(arr->
At(ncon)->GetName(), name) == 0) {
787 if (arr->
At(ncon)->InheritsFrom(TGo4PolyCond::Class()))
811 FreezeMode->setChecked(
false);
812 RegionB->setChecked(
true);
815 FreezeMode->setChecked(
false);
816 PolyB->setChecked(
true);
855 int selectedkind = 0;
857 if (selectedkind != kind)
913 GetConditionBtn->setVisible(iscondition);
914 InfoConditionBtn->setVisible(iscondition);
915 EditConditionBtn->setVisible(iscondition);
916 SetConditionBtn->setVisible(iscondition);
920 ModifyConditionBtn->setVisible(cond && (cond->
IsChanged() != 0));
922 QString iconname =
":/icons/right.png";
923 QString tooltip =
"Refresh condition from analysis";
925 iconname =
":/icons/refresh.png";
926 tooltip =
"Refresh condition from source";
928 GetConditionBtn->setIcon(QIcon(iconname));
929 GetConditionBtn->setToolTip(tooltip);
932 ModifyConditionBtn->setVisible(
false);
936 CursorB->setChecked(
false);
937 RegionB->setChecked(
false);
938 LatexB->setChecked(
false);
939 DrawB->setChecked(
false);
940 PolyB->setChecked(
false);
943 CursorB->setChecked(
true);
944 RegionB->setChecked(
false);
945 LatexB->setChecked(
false);
946 DrawB->setChecked(
false);
947 PolyB->setChecked(
false);
950 CursorB->setChecked(
false);
951 RegionB->setChecked(
true);
952 LatexB->setChecked(
false);
953 DrawB->setChecked(
false);
954 PolyB->setChecked(
false);
957 CursorB->setChecked(
false);
958 RegionB->setChecked(
false);
959 LatexB->setChecked(
false);
960 DrawB->setChecked(
false);
961 PolyB->setChecked(
true);
964 CursorB->setChecked(
false);
965 RegionB->setChecked(
false);
966 LatexB->setChecked(
true);
967 DrawB->setChecked(
false);
968 PolyB->setChecked(
false);
971 CursorB->setChecked(
false);
972 RegionB->setChecked(
false);
973 LatexB->setChecked(
false);
974 DrawB->setChecked(
true);
975 PolyB->setChecked(
false);
978 CursorB->setChecked(
false);
979 RegionB->setChecked(
false);
980 LatexB->setChecked(
false);
981 DrawB->setChecked(
false);
982 PolyB->setChecked(
false);
987 SelectedMarkerCmb->clear();
988 SelectedMarkerCmb->addItem(
"new");
997 for (
int n = 0; n < slot->
NumChilds(); n++) {
1006 if (obj->InheritsFrom(TGo4CondArray::Class())) {
1008 for (
int ncon = 0; ncon < arr->
GetNumber(); ncon++) {
1010 QString fullname(arr->GetName());
1012 fullname += QString::number(ncon);
1013 SelectedMarkerCmb->addItem(fullname);
1015 if ((selname == obj->GetName()) && (selindex == ncon))
1016 findindx = SelectedMarkerCmb->count() - 1;
1019 SelectedMarkerCmb->addItem(obj->GetName());
1020 if (selname == obj->GetName())
1021 findindx = SelectedMarkerCmb->count() - 1;
1031 SelectedMarkerCmb->setCurrentIndex(findindx);
1032 DelSelectedMarker->setEnabled((findindx > 0) );
1035 MarkerPanel->ensurePolished();
1036 MarkerPanel->update();
1037 MarkerPanel->show();
1049 QString selname = SelectedMarkerCmb->itemText(indx);
1051 int p = selname.indexOf(
"/Sub");
1053 selindex = selname.mid(p + 4).toInt();
1054 selname.truncate(p);
1063 if (slot && (drawkind > 0)) {
1087 gROOT->SetEditorMode(
"");
1103 for (
int n = 0; n < slot->
NumChilds(); n++) {
1117 obj->Print(
"go4log");
1122 obj->Print(
"go4log-limits-stats");
1150 if (!withsubpads)
return;
1156 while (iter.
next()) {
1211 QFileDialog fd(
this,
"Save Markers of active pad into", QString(),
1212 "ROOT file (*.root)");
1213 fd.setFileMode(QFileDialog::AnyFile);
1214 fd.setAcceptMode(QFileDialog::AcceptSave);
1215 if (fd.exec() == QDialog::Accepted) {
1216 QStringList flst = fd.selectedFiles();
1220 QString filename = flst[0];
1221 if (!filename.endsWith(
".root"))
1222 filename.append(
".root");
1229 QFileDialog fd(
this,
"Load Marker setup from:", QString(),
1230 "ROOT file (*.root)");
1231 fd.setFileMode(QFileDialog::ExistingFile);
1232 if (fd.exec() == QDialog::Accepted) {
1233 QStringList flst = fd.selectedFiles();
1236 QString filename = flst[0];
1287 if ((px < 0) || (py < 0)) {
1288 px = pad->GetEventX();
1289 py = pad->GetEventY();
1292 Double_t x = pad->PadtoX(pad->AbsPixeltoX(px));
1293 Double_t y = pad->PadtoY(pad->AbsPixeltoY(py));
1296 docheck =
false, iscreated =
false;
1300 TObject *obj =
GetCanvas()->GetSelected();
1302 if (obj->InheritsFrom(TGo4Marker::Class())
1303 || obj->InheritsFrom(TGo4WinCondView::Class())
1304 || obj->InheritsFrom(TGo4PolyCondView::Class()))
1312 gROOT->SetEditorMode(
"");
1318 mark->SetMarkerColor((ix) % 6 + 2);
1338 gROOT->SetEditorMode(
"");
1340 Double_t xmin(x), xmax(x), ymin(y), ymax(y);
1345 bool fbTwoDimRegion = hist && (hist->GetDimension() > 1);
1347 QString name =
"Region " + QString::number(ix + 1);
1348 conny =
new TGo4WinCond(name.toLatin1().constData());
1356 conny->SetFillStyle(3002);
1376 std::cout <<
"TGo4ViewPanel:PadClickedSlot() NEVER COME HERE" << std::endl;
1381 conny->
SetValues(xmin, xmax, ymin, ymax);
1402 gROOT->SetEditorMode(
"");
1410 QString name =
"Polygon " + QString::number(ix + 1);
1420 TCutG *cut = cond->
GetCut(kTRUE);
1433 TCutG *cut = cond->
GetCut(kFALSE);
1437 cut->SetPoint(0, x, y);
1438 cut->SetPoint(1, x, y);
1451 cond->SetFillStyle(3002);
1469 gROOT->SetEditorMode(
"");
1472 QString name = QString(
"Label ") + QString::number(ix + 1);
1474 QString txt = QInputDialog::getText(
this,
1475 "Enter new LaTeX label text:", name, QLineEdit::Normal,
1477 if (ok && (txt.length() > 0)) {
1478 TLatex *latex =
new TLatex(x, y, name.toLatin1().constData());
1479 latex->SetName(name.toLatin1().constData());
1480 latex->SetTitle(txt.toLatin1().constData());
1506 gROOT->SetEditorMode(
"");
1509 TArrow* arrow =
new TArrow(x, y, x, y, 0.02);
1522 std::cout <<
"TGo4ViewPanel:MouseClick() NEVER COME HERE" << std::endl;
1603 bool delcond =
true;
1604 TCutG *cut = cond->
GetCut(kFALSE);
1606 int n = cut->GetN();
1608 cut->GetPoint(0, x, y);
1612 cut->SetPoint(n, x, y);
1617 cond->SetFillStyle(3002);
1620 if (delcond && candelete) {
1709 if (!obj)
return nullptr;
1711 Long_t offset =obj->IsA()->GetDataMemberOffset(
"fHistogram");
1712 if (offset <= 0)
return nullptr;
1714 TH1 **hist = (TH1 **)((
char *) obj + offset);
1718 if (obj->IsA() == THStack::Class())
1721 if (obj->IsA() == TMultiGraph::Class())
1724 TGraph *gr =
dynamic_cast<TGraph *
> (obj);
1725 if (gr)
return gr->GetHistogram();
1733 TPad *pad =
dynamic_cast<TPad *
>(obj);
1739 if ((strcmp(cmdname,
"UnZoom") == 0) && obj->InheritsFrom(TAxis::Class())) {
1764 if (!framehisto)
continue;
1766 if (framehisto->GetXaxis() != obj)
continue;
1768 TIter next(hs->GetHists());
1769 while (
auto hs_h1 = (TH1 *) next())
1770 hs_h1->GetXaxis()->UnZoom();
1773 }
while (iter.
next());
1781 TCanvasImp *imp =
GetCanvas()->GetCanvasImp();
1809 Int_t npts = markers.GetEntries();
1813 TArrayD x(npts), y(npts);
1815 for (Int_t j = 0; j < npts; ++j) {
1818 std::cout <<
"NEVER COME HERE: no marker at index " << j << std::endl;
1821 x[j] = mark->GetX();
1822 y[j] = mark->GetY();
1826 TString grname =
GetPanelName() + TString(
"-Markergraph");
1827 TGraph *graf =
new TGraph(npts, x.GetArray(), y.GetArray());
1828 graf->SetName(grname.Data());
1829 graf->SetMarkerStyle(28);
1837 if (!padopt || !slot)
return;
1852 for (
int n = 0; n < slot->
NumChilds(); n++) {
1863 if (dynamic_cast<TLatex *>(obj) || dynamic_cast<TF1 *>(obj)) {
1865 if (dynamic_cast<TGo4ObjectProxy*>(subslot->
GetProxy())) {
1868 }
else if (dynamic_cast<TGo4LinkProxy*>(subslot->
GetProxy())) {
1873 TGo4Log::Error(
"MakePictureForPad NEVER COME HERE, unknown proxy type");
1900 if (nm) pic->
AddObjName(nm->GetName(), drawopt);
1903 Int_t rebinx, rebiny;
1904 if (subslot->
GetIntPar(
"::HasRebinX", rebinx))
1906 if (subslot->
GetIntPar(
"::HasRebinY", rebiny))
1912 for (
int n = 0; n < slot->
NumChilds(); n++) {
1918 if (pads.GetLast() < 0)
1922 int xcnt = 0, sizex = 1, sizey = 1;
1923 for (
int n = 0; n <= pads.GetLast(); n++) {
1924 TPad *subpad = (TPad *) pads.At(n);
1925 double mitx = subpad->GetXlowNDC() + subpad->GetWNDC() / 2.;
1937 while (sizex * sizey <= pads.GetLast())
1942 for (
int ny = 0; ny < sizey; ny++)
1943 for (
int nx = 0; nx < sizex; nx++) {
1944 int indx = ny * sizex + nx;
1945 if (indx > pads.GetLast())
1947 TPad *subpad = (TPad *) pads.At(indx);
1955 if (dlg.exec() != QDialog::Accepted)
1960 QString outfile =
"~/go4printout.ps";
1963 QString DelCmd = QString(
"rm -f ") + outfile;
1965 GetCanvas()->Print(outfile.toLatin1().constData());
1966 gSystem->Exec(PrnCmd.toLatin1().constData());
1967 gSystem->Exec(DelCmd.toLatin1().constData());
1975 bool visible =
false;
2014 for (
int n = 0; n < padslot->
NumChilds(); n++) {
2031 double defleft = gStyle->GetPadLeftMargin();
2032 double defright = gStyle->GetPadRightMargin();
2033 double deftop = gStyle->GetPadTopMargin();
2034 double defbottom = gStyle->GetPadBottomMargin();
2036 double dx = fabs(pad->AbsPixeltoX(1) - pad->AbsPixeltoX(0));
2037 double dy = fabs(pad->AbsPixeltoY(1) - pad->AbsPixeltoY(0));
2038 if ((dx <= 0) || (dy <= 0))
return;
2039 double ratio = dx / dy;
2040 if(fabs(1.0-ratio) < 1.0E-3) {
2047 double left = pad->GetLeftMargin();
2048 double right = pad->GetRightMargin();
2049 double change = (1. - left - right) * (1 - ratio);
2050 double newleft = left + change / 2.;
2051 double newright = right + change / 2.;
2052 double newtop = pad->GetTopMargin();
2053 double newbottom = pad->GetBottomMargin();
2054 double shrink=newtop- deftop;
2055 if(shrink>newleft-defleft) shrink = newleft-defleft;
2056 if(shrink>newright-defright) shrink = newright-defright;
2059 newtop = newtop - shrink;
2060 newbottom = newbottom - shrink;
2061 newleft = newleft - shrink;
2062 newright = newright - shrink;
2064 pad->SetLeftMargin(newleft);
2065 pad->SetRightMargin(newright);
2066 pad->SetTopMargin(newtop);
2067 pad->SetBottomMargin(newbottom);
2070 double bottom = pad->GetBottomMargin();
2071 double top = pad->GetTopMargin();
2072 double change = (1. - bottom - top) * (1. - 1 / ratio);
2073 double newleft=pad->GetLeftMargin();
2074 double newright=pad->GetRightMargin();
2075 double newtop= top + change / 2.;
2076 double newbottom= bottom + change / 2.;
2077 double shrink=newleft - defleft;
2078 if(shrink>newtop-deftop) shrink=newtop-deftop;
2079 if(shrink>newbottom-defbottom) shrink=newbottom-defbottom;
2081 newtop = newtop - shrink;
2082 newbottom = newbottom -shrink;
2083 newleft = newleft- shrink;
2084 newright = newright - shrink;
2086 pad->SetTopMargin(newtop);
2087 pad->SetBottomMargin(newbottom);
2088 pad->SetLeftMargin(newleft);
2089 pad->SetRightMargin(newright);
2096 pad->SetLeftMargin(gStyle->GetPadLeftMargin());
2097 pad->SetRightMargin(gStyle->GetPadRightMargin());
2098 pad->SetTopMargin(gStyle->GetPadTopMargin());
2099 pad->SetBottomMargin(gStyle->GetPadBottomMargin());
2174 if (selected != wasselected) {
2223 bool setdefaults =
false;
2229 slot = parent->
FindChild(pad->GetName());
2244 bool issubpads =
false;
2246 bool isdupluicate =
false;
2252 isdupluicate =
false;
2253 TIter iter(pad->GetListOfPrimitives());
2254 while (
auto obj = iter()) {
2255 TPad *subpad =
dynamic_cast<TPad *
>(obj);
2259 if (subpads.FindObject(subpad->GetName()))
2260 isdupluicate =
true;
2262 subpads.Add(subpad);
2265 pad->GetListOfPrimitives()->RemoveAll(&subpads);
2271 }
while (isdupluicate);
2274 for (
int n = slot->
NumChilds() - 1; n >= 0; n--) {
2278 if (!pad->GetListOfPrimitives()->FindObject(subpad))
2291 TIter iter(pad->GetListOfPrimitives());
2292 TObjArray removedItems;
2293 while (
auto obj = iter()) {
2294 TPad *subpad =
dynamic_cast<TPad *
>(obj);
2298 removedItems.Add(obj);
2301 pad->GetListOfPrimitives()->RemoveAll(&removedItems);
2308 TObject *obj,
bool owner,
const char *drawopt)
2313 if (owner)
delete obj;
2325 if (cl && cl->InheritsFrom(TGo4Condition::Class()))
2331 tgtslot =
AddNewSlot(brslot->GetName(), padslot);
2340 QString newslotname = itemname;
2341 if (newslotname.isEmpty() || padslot->
FindChild(newslotname.toLatin1().constData())) {
2344 if (!itemname || (*itemname == 0))
2345 newslotname =
"::SpecialObject_";
2347 newslotname = itemname;
2348 newslotname += QString::number(cnt++);
2349 }
while (padslot->
FindChild(newslotname.toLatin1().constData()));
2351 tgtslot =
AddNewSlot(newslotname.toLatin1().constData(), padslot);
2355 if (!tgtslot)
return nullptr;
2360 tgtslot->
SetPar(
"::FirstDraw",
"true");
2368 if ((kind < 100) && drawopt)
2379 return !slot ? nullptr : slot->
FindChild(name);
2408 for (
int n = 0; n < padslot->
NumChilds(); n++) {
2425 for (
int n = 0; n < slot->
NumChilds(); n++) {
2430 if ((kind !=
kind_Link) && ((selectkind < 0) || (kind == selectkind))) {
2443 if (!slot || !padopt)
2448 for (
int n = slot->
NumChilds() - 1; n >= 0; n--) {
2454 && ((kindtodelete < 0) || (kind == kindtodelete))) {
2489 if (!pad || !pic || !padslot)
2492 bool optchanged =
false;
2493 TObjLink* link = pad->GetListOfPrimitives()->FirstLink();
2496 const char *clname = link->GetObject()->ClassName();
2497 if ((strcmp(clname,
"TFrame") == 0) || (strcmp(clname,
"TLegend") == 0)) {
2504 link = link->Next();
2512 TString newopt(link->GetOption());
2519 if (!oldopt.Contains(
"asimage"))
2520 if ((newopt.Length() != oldopt.Length())
2521 || (newopt.CompareTo(oldopt, TString::kIgnoreCase) != 0)) {
2526 TH1 *h1 =
dynamic_cast<TH1 *
>(link->GetObject());
2529 TGraph *gr =
dynamic_cast<TGraph *
> (link->GetObject());
2535 dynamic_cast<TPaveStats*
>(h1->GetListOfFunctions()->FindObject(
"stats"));
2536 if (h1->TestBit(TH1::kNoStats)) {
2543 TAxis *xax = h1->GetXaxis();
2567 TPaveText *titl =
dynamic_cast<TPaveText *
>(pad->GetListOfPrimitives()->FindObject(
"title"));
2573 TObjArray objs, objslots;
2582 TObjArray *objs, TObjArray *objslots)
2588 if (padslot->
GetPar(
"::DrawOptAssigned")) {
2590 }
else if (!onlyscan) {
2592 padslot->
SetPar(
"::DrawOptAssigned",
"1");
2596 if (!padslot || !pic || !objs || !objslots)
2599 for (
int n = 0; n <= objs->GetLast(); n++) {
2600 TObject *obj = objs->At(n);
2603 if (!obj || !subslot)
2606 if (subslot->
GetPar(
"::DrawOptAssigned")) {
2608 }
else if (!onlyscan) {
2610 subslot->
SetPar(
"::DrawOptAssigned",
"1");
2623 TObjArray mainslots;
2625 int lastobjtype = 0;
2627 for (
int n = 0; n < slot->
NumChilds(); n++) {
2641 if (obj->InheritsFrom(TH1::Class()))
2643 else if (obj->InheritsFrom(TGraph::Class()))
2645 else if (obj->InheritsFrom(TMultiGraph::Class()))
2647 else if (obj->InheritsFrom(THStack::Class()))
2653 lastobjtype = objtype;
2654 mainslots.Add(subslot);
2658 Bool_t deletesomething = kFALSE;
2660 for (
int n = 0; n <= mainslots.GetLast(); n++) {
2664 if (obj->InheritsFrom(TH1::Class()))
2666 else if (obj->InheritsFrom(TGraph::Class()))
2668 else if (obj->InheritsFrom(TMultiGraph::Class()))
2670 else if (obj->InheritsFrom(THStack::Class()))
2676 if ((n < mainslots.GetLast()) && ((modifier == 2) || ((modifier == 1) && (lastobjtype != objtype)))) {
2678 deletesomething = kTRUE;
2682 objslots->Add(subslot);
2691 if (deletesomething)
2694 for (
int n = 0; n < slot->
NumChilds(); n++) {
2703 objslots->Add(subslot);
2711 if (indx < 0) indx = 0;
2713 switch (indx % 10) {
2714 case 0:
return kBlack;
2715 case 1:
return kRed;
2716 case 2:
return kGreen;
2717 case 3:
return kBlue;
2718 case 4:
return kCyan;
2719 case 5:
return kOrange;
2720 case 6:
return kSpring;
2721 case 7:
return kViolet;
2722 case 8:
return kPink;
2723 case 9:
return kAzure;
2732 TObjArray * objslots,
bool showitems)
2734 if (!sislot || !objs || !padopt)
return nullptr;
2737 Bool_t ishstack = kFALSE;
2738 Bool_t isgstack = kFALSE;
2739 Bool_t iserror = kFALSE;
2740 Bool_t resetcolors = kFALSE;
2742 for (
int n = 0; n <= objs->GetLast(); n++) {
2743 TObject *obj = objs->At(n);
2744 if (obj->InheritsFrom(TH1::Class()))
2746 else if (obj->InheritsFrom(TGraph::Class()))
2753 if (iserror || (ishstack && isgstack)) {
2754 TGo4Log::Error(
"Superimpose of multiple objects with different types");
2759 THStack *hs =
dynamic_cast<THStack*
>(oldobj);
2762 hs =
new THStack(objs->First()->GetName(), objs->First()->GetTitle());
2764 resetcolors = kTRUE;
2767 hs->GetHists()->Clear();
2770 for (
int n = 0; n <= objs->GetLast(); n++) {
2771 TH1 *histo = (TH1 *) objs->At(n);
2783 histo->GetXaxis()->UnZoom();
2791 hs->Add(histo, drawopt);
2794 }
else if (isgstack) {
2795 TMultiGraph *mgr =
dynamic_cast<TMultiGraph *
>(oldobj);
2797 mgr =
new TMultiGraph(objs->First()->GetName(), objs->First()->GetTitle());
2799 resetcolors = kTRUE;
2800 }
else if (mgr->GetListOfGraphs()) {
2801 mgr->GetListOfGraphs()->Clear();
2804 for (
int n = 0; n <= objs->GetLast(); n++) {
2805 TGraph *gr = (TGraph *) objs->At(n);
2811 if (drawopt.IsNull())
2813 if (drawopt.IsNull())
2819 if (n > 0) drawopt.ReplaceAll(
"a",
"");
2821 Bool_t first_draw = objslot->
GetPar(
"::FirstDraw") !=
nullptr;
2823 Int_t objindx = padslot->
GetIndexOf(objslot);
2828 gr->SetLineColor(nextcol);
2829 gr->SetMarkerColor(nextcol);
2834 if (first_draw && (n == 0)) {
2835 TAxis *ax = gr->GetXaxis();
2836 if (ax && ax->GetTimeDisplay()) {
2845 mgr->Add(gr, drawopt.Data());
2850 if ((ishstack || isgstack) && legslot) {
2854 double miny = 0.94 - 0.03 * objs->GetLast();
2857 else if (miny > 0.92)
2859 legend =
new TLegend(0.6, miny, 0.95, 0.99);
2860 legend->SetBorderSize(2);
2861 legend->SetName(
"fitlegend");
2867 for (
int n = 0; n <= objs->GetLast(); n++) {
2868 TObject *stob = objs->At(n);
2870 const char *objname = stob->GetName();
2872 if (showitems && objslots) {
2874 if (itemname) objname = itemname;
2877 TString ldrawopt =
"l";
2883 if (drawopt.Contains(
"l")) ldrawopt+=
"l";
2884 if (drawopt.Contains(
"p")) ldrawopt+=
"p";
2887 if (ldrawopt.IsNull()) ldrawopt =
"l";
2889 legend->AddEntry(stob, objname, ldrawopt.Data());
2901 if (!pad || !padslot)
return;
2906 if ((numX > 1) || (numY > 1)) {
2907 pad->Divide(numX, numY);
2922 tgtslot =
new TGo4Slot(padslot,
"::ThisPad",
"Special object");
2936 while (iter.
next()) {
2959 for (
int n = 0; n < padslot->
NumChilds(); n++)
2988 while (iter.
next()) {
3012 while (iter.
next()) {
3035 while (iter.
next()) {
3045 if (!pad || !slot || !obj)
3048 for (
int n = 0; n < slot->
NumChilds(); n++) {
3058 return !padslot ? nullptr : padslot->
FindChild(
"::Superimpose");
3067 for (
int n = 0; n < slot->
NumChilds(); n++) {
3128 tgtslot =
new TGo4Slot(padslot,
"::PadOptions",
"Pad options slot");
3153 if (!pad || !padslot)
3156 TObject *obj =
nullptr;
3167 if (obj->InheritsFrom(TH1::Class()))
3172 if (obj->InheritsFrom(TGraph::Class()))
3176 if (obj->InheritsFrom(THStack::Class()))
3179 if (obj->InheritsFrom(TMultiGraph::Class())) {
3180 TMultiGraph *mg =
dynamic_cast<TMultiGraph *
>(obj);
3186 TIter iter(mg->GetListOfGraphs());
3187 while (
auto gr = (TGraph *) iter()) {
3220 TObjArray objs, objslots;
3223 Int_t nselectitem = 0;
3239 QString fulllist =
"";
3240 QString selslotname =
"";
3242 for (
int n = 0; n <= objslots.GetLast(); n++) {
3248 QString subslotname = subslot->GetName();
3249 if (n == selected) {
3250 subslotname = QString(
"[") + subslotname + QString(
"]");
3251 selslotname = subslotname;
3253 if (n > 0) fulllist +=
", ";
3254 fulllist += subslotname;
3258 && (selected < objslots.GetLast())) {
3261 QString(
"Show ") + selslotname + QString(
" on top"),
3266 fulllist = QString(
"[") + fulllist + QString(
"]");
3270 if (nselectitem > 0) {
3277 if (fulllist.length() > 0) {
3282 if (capt.length() > 60) {
3288 setWindowTitle(capt);
3306 slot->
SetPar(
"::DrawOpt", drawopt);
3316 if (!slot->
GetIntPar(
"::DrawKind", kind))
3323 return !slot ? nullptr : slot->
GetPar(
"::DrawOpt");
3329 slot->
SetIntPar(
"::SelectedObject", indx);
3337 if (!slot->
GetIntPar(
"::SelectedObject", indx))
3346 if (!slot || !padopt)
3358 TObjArray objs, objslots;
3361 if (objs.GetLast() < 0)
3364 if ((indx > objs.GetLast()) || (indx < 0))
3375 return objs.At(indx);
3382 if (!slot || !padopt)
3387 TObjArray objs, objslots;
3391 if ((objs.GetLast() <= 0) || (indx == objs.GetLast()))
3407 if (!pad || !padslot)
return;
3409 TObjArray objs, objslots;
3413 if (indx < 0) indx = 0;
3415 TH1 *selhisto =
dynamic_cast<TH1 *
>((indx <= objs.GetLast()) ? objs.At(indx) :
nullptr);
3419 for (
int n = 0; n < padslot->
NumChilds(); n++) {
3430 if (obj->InheritsFrom(TGo4Condition::Class()))
3432 else if (obj->InheritsFrom(TGo4Marker::Class()))
3437 TH1 *oldhisto =
nullptr;
3445 if (!objs.FindObject(oldhisto))
3463 setWindowTitle(mycaption);
3470 if (!pad || !padslot)
3475 TCanvas *canv =
nullptr;
3480 for (
int n = 0; n < padslot->
NumChilds(); n++) {
3490 if ((kind < 0) || (kind >= 100))
3494 if (obj->InheritsFrom(TGo4Condition::Class())) {
3499 cond->SetFillStyle(3444);
3504 if (obj->InheritsFrom(TLatex::Class())) {
3509 if (obj->InheritsFrom(TF1::Class())) {
3520 canv =
dynamic_cast<TCanvas *
>(obj);
3551 TVirtualPad *padsav = gPad;
3564 if (!pad || !pic)
return;
3572 for (Int_t posy = 0; posy < pic->
GetDivY(); posy++)
3573 for (Int_t posx = 0; posx < pic->
GetDivX(); posx++) {
3638 while (
auto obj = iter()) {
3639 Option_t *drawopt = iter.GetOption();
3640 if (dynamic_cast<TArrow *>(obj))
3642 else if (dynamic_cast<TLatex *>(obj))
3644 else if (dynamic_cast<TGo4Marker *>(obj))
3646 else if (dynamic_cast<TGo4WinCond *>(obj))
3648 else if (dynamic_cast<TGo4PolyCond *>(obj))
3650 else if (dynamic_cast<TPaveLabel *>(obj))
3661 if (!tgtpad || !srcpad)
return;
3667 if (!padopt || !padslot)
return;
3669 tgtpad->SetTickx(srcpad->GetTickx());
3670 tgtpad->SetTicky(srcpad->GetTicky());
3671 tgtpad->SetGridx(srcpad->GetGridx());
3672 tgtpad->SetGridy(srcpad->GetGridy());
3673 tgtpad->SetBorderSize(srcpad->GetBorderSize());
3674 tgtpad->SetBorderMode(srcpad->GetBorderMode());
3675 srcpad->TAttLine::Copy(*tgtpad);
3676 srcpad->TAttFill::Copy(*tgtpad);
3677 srcpad->TAttPad::Copy(*tgtpad);
3679 tgtpad->SetPhi(srcpad->GetPhi());
3680 tgtpad->SetTheta(srcpad->GetTheta());
3682 int nsubpads = 0, nmain = 0, mainkind = 0;
3683 TObjLink* link = srcpad->GetListOfPrimitives()->FirstLink();
3685 TObject *obj = link->GetObject();
3686 const char *drawopt = link->GetOption();
3692 TPad *srcsubpad =
dynamic_cast<TPad *
>(obj);
3694 TString itemname = TString::Format(
"%s/%s", srcpaditemname, obj->GetName());
3698 QString subpadname = tgtpad->GetName();
3700 subpadname += QString::number(nsubpads);
3702 Double_t xlow, ylow, xup, yup;
3704 srcsubpad->GetPadPar(xlow, ylow, xup, yup);
3707 TPad *tgtsubpad =
new TPad(subpadname.toLatin1().constData(),
3708 srcsubpad->GetName(), xlow, ylow, xup, yup);
3709 tgtsubpad->SetNumber(nsubpads);
3717 }
else if (dynamic_cast<TGo4Condition *>(obj)) {
3721 }
else if (dynamic_cast<TGo4Marker*>(obj)) {
3725 }
else if (dynamic_cast<TLatex *>(obj)) {
3727 }
else if (dynamic_cast<TPaveLabel *>(obj)) {
3729 }
else if (dynamic_cast<TArrow *>(obj)) {
3731 }
else if (dynamic_cast<TH1 *>(obj)) {
3734 }
else if (dynamic_cast<TGraph *>(obj)) {
3737 }
else if (dynamic_cast<THStack *>(obj)) {
3740 }
else if (dynamic_cast<TMultiGraph *>(obj)) {
3749 if ((kind > 0) && ((mainkind == 0) || ((kind == mainkind) && (kind < 3)))) {
3758 if (h1 && (nmain == 0)) {
3760 Int_t ndim = h1->GetDimension();
3767 Double_t selmin = h1->GetMinimum();
3768 Double_t selmax = h1->GetMaximum();
3770 if (selmin < selmax)
3771 padopt->
SetRange(ndim, selmin, selmax);
3774 !h1->TestBit(TH1::kIsZoomed) || (selmin >= selmax));
3781 link = link->Next();
3809 gROOT->SetEscape(kFALSE);
3817 Bool_t oldmodified = gPad->IsModified();
3820 dummy.ExecuteEvent(kButton1Up, 0, 0);
3821 gPad->Modified(oldmodified);
3826 bool isanychildmodified =
false;
3827 bool ispadupdatecalled =
false;
3829 QTime starttm = QTime::currentTime();
3846 if (isanychildmodified) {
3848 ispadupdatecalled =
true;
3851 int delay = starttm.msecsTo(QTime::currentTime());
3852 intime = (delay >= 0) && (delay < 100);
3854 }
while (!force && isanychildmodified && intime);
3862 if (!ispadupdatecalled)
3869 if (!force && isanychildmodified)
3876 if (!slot)
return false;
3879 if (!padopt)
return false;
3881 bool ischilds =
false;
3882 bool ischildmodified =
false;
3889 Int_t lastdrawnpad = 0;
3891 if (!slot->
GetIntPar(
"::LastDrawnPad", lastdrawnpad))
3894 Int_t subpadindx = 0, numchilds = slot->
NumChilds();
3897 for (
int n = 0; n < numchilds; n++) {
3898 subpadindx = (n + lastdrawnpad);
3899 if (numchilds > 0) subpadindx = subpadindx % numchilds;
3901 if (!subpad)
continue;
3904 ischildmodified =
true;
3909 if (!force && ischildmodified)
3910 slot->
SetIntPar(
"::LastDrawnPad", subpadindx);
3915 return ischildmodified;
3923 if (ischilds)
return ischildmodified;
3932 TObjArray objs, objslots;
3942 if (objs.GetLast() < 0) {
3955 TH2 *asihisto =
nullptr;
3957 TObject *drawobj =
nullptr;
3960 Bool_t dosuperimpose = objs.GetLast() > 0;
3964 Bool_t doasiimage = !dosuperimpose && !
fxWCanvas && objs.Last()->InheritsFrom(TH2::Class());
3966 if (drawopt && TString(drawopt).Contains(
"asimage")) {
3967 if (!doasiimage) { drawopt =
"col"; padopt->
SetDrawOption(
"col", 0); }
3969 doasiimage = kFALSE;
3972 if (dosuperimpose) {
3974 sislot =
new TGo4Slot(slot,
"::Superimpose",
"place for superimpose object");
3977 legslot =
new TGo4Slot(slot,
"::Legend",
"place for legends object");
3978 }
else if (legslot) {
3986 dosuperimpose = kFALSE;
3989 if (!dosuperimpose) {
3998 drawobj = objs.Last();
4002 asihisto =
dynamic_cast<TH2 *
>(drawobj);
4007 asislot =
new TGo4Slot(slot,
"::ASImage",
"place for Go4 ASI image");
4012 updatecontent =
true;
4021 if (!doasiimage && asislot) {
4028 bool first_draw = (slot->
GetPar(
"::PadFirstDraw") ==
nullptr);
4029 if (first_draw) slot->
SetPar(
"::PadFirstDraw",
"true");
4031 if (drawobj->InheritsFrom(TH1::Class())) {
4032 TH1 *h1 = (TH1 *) drawobj;
4033 h1->SetBit(kCanDelete, kFALSE);
4035 }
else if (drawobj->InheritsFrom(THStack::Class())) {
4036 THStack *hs = (THStack*) drawobj;
4037 RedrawStack(pad, padopt, hs, dosuperimpose, updatecontent);
4038 }
else if (drawobj->InheritsFrom(TGraph::Class())) {
4039 TGraph *gr = (TGraph *)drawobj;
4040 RedrawGraph(pad, padopt, gr, updatecontent, first_draw);
4041 }
else if (drawobj->InheritsFrom(TMultiGraph::Class())) {
4042 TMultiGraph *mg = (TMultiGraph *)drawobj;
4044 }
else if (dynamic_cast<TGo4ASImage*>(drawobj)) {
4046 RedrawImage(pad, padopt, ai, asihisto, updatecontent);
4063 if (!pad || !padopt || !his)
return;
4069 if (drawopt.IsNull()) {
4070 if (his->GetDimension() == 1)
4072 else if (his->GetDimension() == 2)
4074 else if (his->GetDimension() == 3)
4090 if (nlvl > 0) his->SetContour(nlvl);
4093 his->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4094 his->Draw(drawopt.Data());
4100 bool dosuperimpose,
bool scancontent)
4102 if (!pad || !padopt || !hs)
return;
4105 TIter iter(hs->GetHists());
4107 while (
auto h1 = (TH1 *) iter()) {
4117 if (drawopt.IsNull())
4122 hs->Draw(drawopt.Data());
4125 if (!framehisto)
return;
4127 framehisto->SetStats(
false);
4128 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4129 TH1 *h1 = hs->GetHists() ?
dynamic_cast<TH1 *
>(hs->GetHists()->First()) :
nullptr;
4131 hs->SetTitle(h1->GetTitle());
4132 framehisto->SetTitle(h1->GetTitle());
4133 framehisto->GetXaxis()->SetTitle(h1->GetXaxis()->GetTitle());
4134 framehisto->GetYaxis()->SetTitle(h1->GetYaxis()->GetTitle());
4135 framehisto->GetZaxis()->SetTitle(h1->GetZaxis()->GetTitle());
4143 if (!pad || !padopt || !gr)
return;
4147 gr->SetEditable(kFALSE);
4154 TAxis *ax = gr->GetXaxis();
4155 if (ax && ax->GetTimeDisplay()) {
4159 if (drawopt.IsNull()) {
4175 if (drawopt.IsNull())
4181 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4184 gr->Draw(drawopt.Data());
4187 framehisto = gr->GetHistogram();
4188 if (framehisto && ((framehisto->TestBit(TH1::kNoStats) == padopt->
IsHisStats()) || (framehisto->TestBit(TH1::kNoTitle) == padopt->
IsHisTitle()))) {
4190 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4191 gr->Draw(drawopt.Data());
4201 if (!pad || !padopt || !mg)
return;
4203 TIter iter(mg->GetListOfGraphs());
4204 TGraph *firstgr =
nullptr;
4206 while (
auto gr = (TGraph *) iter()) {
4208 gr->SetEditable(kFALSE);
4218 if (drawopt.IsNull())
4224 mg->Draw(drawopt.Data());
4228 TH1 *framehisto = (dosuperimpose && firstgr) ? firstgr->GetHistogram() : mg->GetHistogram();
4232 mg->Draw(drawopt.Data());
4233 framehisto = (dosuperimpose && firstgr) ? firstgr->GetHistogram() : mg->GetHistogram();
4237 TGo4Log::Error(
"Internal problem with MultiGraph drawing - cannot access frame histo");
4244 Double_t miny, maxy, selmin, selmax;
4247 if (maxy <= 0) maxy = 1.;
4248 if ((miny <= 0) || (miny >= maxy)) {
4250 if (miny > 1.) miny = 1.;
4253 maxy *= ((maxy>0) ? 1.1 : 0.9);
4254 miny *= ((miny>0) ? 0.9 : 1.1);
4256 framehisto->SetMaximum(maxy);
4257 framehisto->SetMinimum(miny);
4260 framehisto->SetStats(kFALSE);
4261 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4265 mg->SetTitle(firstgr->GetTitle());
4266 framehisto->SetTitle(firstgr->GetTitle());
4267 framehisto->GetXaxis()->SetTitle(firstgr->GetXaxis()->GetTitle());
4268 framehisto->GetYaxis()->SetTitle(firstgr->GetYaxis()->GetTitle());
4271 mg->Draw(drawopt.Data());
4275 TH2 *asihisto,
bool scancontent)
4277 if (!pad || !padopt || !im)
return;
4286 double uminx, umaxx, uminy, umaxy;
4291 im->SetPaletteEnabled(drawopt.Contains(
"Z"));
4298 if (!legslot)
return;
4301 if(legend) legend->Draw();
4306 if (!pad || !padslot)
return;
4311 TObject *selectedobj =
nullptr;
4312 const char *selectdrawopt =
nullptr;
4313 for (
int n = 0; n < padslot->
NumChilds(); n++) {
4326 if(obj->InheritsFrom(TF1::Class())){
4327 if(!pad->GetListOfPrimitives()->IsEmpty())
4328 drawopt.Append(
"LSAME");
4329 TF1 *func =
dynamic_cast<TF1 *
>(obj);
4330 Int_t objindx = padslot->
GetIndexOf(subslot);
4331 func->SetLineColor(
GetAutoColor(((objindx+7) % 9) + 1));
4334 if ((selname == obj->GetName()) && !selectedobj) {
4336 selectdrawopt = drawopt.Data();
4339 obj->Draw(drawopt.Data());
4347 selectedobj->Draw(selectdrawopt ? selectdrawopt :
"");
4372 int value,
const char *drawopt)
4376 if (!subopt)
return;
4393 subpad->SetFillColor(value);
4394 if (subpad->GetFrame())
4395 subpad->GetFrame()->SetFillColor(value);
4420 gStyle->SetPalette(value);
4446 if(backup) col=backup->GetFillColor();
4447 pad->SetFillColor((Color_t) col);
4449 TIter iter(pad->GetListOfPrimitives());
4450 while (
auto obj = iter()) {
4451 TPad *subpad =
dynamic_cast<TPad *
>(obj);
4452 TFrame *fram =
dynamic_cast<TFrame *
>(obj);
4454 TPad *backpad =
nullptr;
4456 backpad =
dynamic_cast<TPad *
>(backup->GetListOfPrimitives()->FindObject(subpad->GetName()));
4460 TFrame *backframe =
dynamic_cast<TFrame *
>(backup->GetListOfPrimitives()->FindObject(fram->GetName()));
4462 col = backframe->GetFillColor();
4465 fram->SetFillColor((Color_t)col);
4485 if (!padslot)
return;
4487 for (
int n = padslot->
NumChilds() - 1; n >= 0; n--) {
4500 if (!slot || !padopt)
4511 for (
int n = slot->
NumChilds() - 1; n >= 0; n--) {
4525 pad->GetListOfPrimitives()->Remove(subpad);
4529 if (
GetCanvas()->GetSelectedPad() == subpad)
4555 int fiPadcolorR, fiPadcolorG, fiPadcolorB;
4557 int padfillcolor = TColor::GetColor(fiPadcolorR, fiPadcolorG, fiPadcolorB);
4559 if (padfillcolor != 0) {
4566 gVirtualX->GetPlanes(nplanes);
4569 TColor *normal = gROOT->GetColor(padfillcolor);
4572 normal->GetHLS(h, l, s);
4573 const char *cname = normal->GetName();
4575 Float_t dr, dg, db, lr, lg, lb;
4576 TColor *dark = gROOT->GetColor(100 + padfillcolor);
4578 new TColor(100 + padfillcolor, -1, -1, -1, TString::Format(
"%s%s", cname,
"_dark").Data());
4579 dark = gROOT->GetColor(100 + padfillcolor);
4581 TColor *light = gROOT->GetColor(150 + padfillcolor);
4583 new TColor(150 + padfillcolor, -1, -1, -1, TString::Format(
"%s%s", cname,
"_bright").Data());
4584 light = gROOT->GetColor(150 + padfillcolor);
4588 TColor::HLStoRGB(h, 0.7 * l, s, dr, dg, db);
4591 dark->SetRGB(dr, dg, db);
4593 dark->SetRGB(0.3, 0.3, 0.3);
4597 TColor::HLStoRGB(h, 1.2 * l, s, lr, lg, lb);
4600 light->SetRGB(lr, lg, lb);
4602 light->SetRGB(0.8, 0.8, 0.8);
4605 TGo4Log::Error(
"Internal problem in view panel: Could not assign root shadow colors for number %d", padfillcolor);
4610 pad->SetFillColor(padfillcolor);
4633 TString output = pad->GetName();
4634 output.Append(
": ");
4638 output.Append(
" SuperImpose:");
4641 output.Append(
" All Pads:");
4642 output.Append(
" Ready");
4649 printf(
"Implement display pad status in web canvas\n");
4666 if ((xaction == 0) && (yaction == 0) && (zaction == 0)) {
4675 while (iter.
next()) {
4678 if (!padopt)
continue;
4685 if ((xaction == 0) && (yaction == 0) && (zaction == 0)) {
4686 padopt->ClearRange();
4687 padopt->SetAutoScale(
true);
4689 padopt->SetPadModified();
4699 if (action <= 0)
return;
4701 double new_umin, new_umax, fmin, fmax, tmin, tmax;
4702 double fact = expandfactor / 100.;
4704 bool sel = padopt->
GetRange(naxis, new_umin, new_umax) && (action!=6);
4711 if (!sel || (new_umin >= new_umax)) { new_umin = fmin; new_umax = fmax; }
4713 double shift = (new_umax - new_umin) * fact;
4715 if (shift <= 0)
return;
4719 if ((new_umax + shift) > fmax)
4720 shift = fmax - new_umax;
4725 if (new_umin - shift < fmin)
4726 shift = new_umin - fmin;
4745 tmax = (-fact * new_umin + (1. - fact) * new_umax)
4747 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4750 tmax = (-fact * new_umin + new_umax) / (1. - fact);
4751 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4757 tmax = (-fact * new_umin + (1. - fact) * new_umax)
4759 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4762 tmax = (-fact * new_umin + new_umax) / (1. - fact);
4763 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4769 if (new_umin < fmin)
4771 if (new_umax > fmax)
4777 TH1 *padhist =
dynamic_cast<TH1 *
>(padobj);
4779 if (!padhist)
break;
4781 if (naxis >= ndim)
break;
4783 TAxis *axis = padhist->GetXaxis();
4784 if (naxis==1) axis = padhist->GetYaxis();
4785 if (naxis==2) axis = padhist->GetZaxis();
4788 Int_t sel_l = sel ? axis->GetFirst() : 0;
4789 Int_t sel_r = sel ? axis->GetLast() : axis->GetNbins();
4791 Int_t firstbin = 0, lastbin = 0;
4794 if ((ndim==1) && (naxis == 0)) {
4795 for (Int_t n1 = 1; n1<=padhist->GetNbinsX(); n1++) {
4796 Double_t v = padhist->GetBinContent(n1);
4797 if (TMath::Abs(v)<1e-10)
continue;
4798 if ((n1<sel_l) || (n1>sel_r))
continue;
4800 if (firstbin == 0) firstbin = n1;
4805 if ((ndim == 2) && (naxis < 2))
4806 for (Int_t n1 = 1; n1<=padhist->GetNbinsX(); n1++)
4807 for (Int_t n2 = 1; n2<=padhist->GetNbinsY(); n2++) {
4808 Double_t v = padhist->GetBinContent(n1,n2);
4809 if (TMath::Abs(v)<1e-10)
continue;
4810 Int_t bin = naxis == 0 ? n1 : n2;
4811 if ((bin<sel_l) || (bin>sel_r))
continue;
4812 if ((lastbin == 0) || (bin > lastbin)) lastbin = bin;
4813 if ((firstbin == 0) || (bin < firstbin)) firstbin = bin;
4817 if ((ndim == 3) && (naxis < 3))
4818 for (Int_t n1 = 1; n1<=padhist->GetNbinsX(); n1++)
4819 for (Int_t n2 = 1; n2<=padhist->GetNbinsY(); n2++)
4820 for (Int_t n3 = 1; n3<=padhist->GetNbinsZ(); n3++) {
4821 Double_t v = padhist->GetBinContent(n1,n2,n3);
4822 if (TMath::Abs(v)<1e-10)
continue;
4823 Int_t bin = naxis == 0 ? n1 : ((naxis==1) ? n2 : n3);
4824 if ((bin<sel_l) || (bin>sel_r))
continue;
4825 if ((lastbin == 0) || (bin > lastbin)) lastbin = bin;
4826 if ((firstbin == 0) || (bin < firstbin)) firstbin = bin;
4831 if (firstbin >= lastbin) { firstbin--; lastbin++; }
4833 if (firstbin<=3) firstbin = 1;
4834 if (lastbin >=axis->GetNbins()-3) lastbin = axis->GetNbins();
4836 Double_t left = axis->GetBinLowEdge(firstbin);
4837 Double_t right = axis->GetBinUpEdge(lastbin);
4839 Double_t margin = (right - left) * fact;
4840 left -= margin; right += margin;
4842 if ((left <= new_umin) && (right >= new_umax))
return;
4844 if (left > new_umin) new_umin = left;
4845 if (right < new_umax) new_umax = right;
4847 if (action==6) axis->SetRange(firstbin,lastbin);
4860 if (padopt->
GetRange(naxis, new_umin, new_umax))
4866 if (!h1 || !padopt)
return;
4868 TAxis *xax = h1->GetXaxis();
4869 TAxis *yax = h1->GetYaxis();
4870 TAxis *zax = h1->GetZaxis();
4871 int ndim = h1->GetDimension();
4876 xax->GetBinUpEdge(xax->GetNbins()));
4879 yax->GetBinUpEdge(yax->GetNbins()));
4885 zax->GetBinUpEdge(zax->GetNbins()));
4892 Int_t dimindx = (ndim == 1) ? 1 : 2;
4894 Double_t minimum = 0, maximum = 0;
4895 Bool_t first = kTRUE;
4896 if (!isfirsthisto) {
4901 for (Int_t biny = 1; biny <= yax->GetNbins(); biny++)
4902 for (Int_t binx = 1; binx <= xax->GetNbins(); binx++) {
4903 Int_t bin = h1->GetBin(binx, biny);
4904 Double_t value = h1->GetBinContent(bin);
4910 if (value < minimum)
4912 else if (value > maximum)
4921 if (!gr || !padopt)
return;
4923 Double_t minx = 0, maxx = 0, miny = 0, maxy = 0, xx, yy;
4925 if (gr->GetN() > 0) {
4926 gr->GetPoint(0, minx, miny);
4935 for (Int_t n = 0; n < gr->GetN(); n++) {
4936 gr->GetPoint(n, xx, yy);
4958 if (!h1 || !padopt || !pad)
return;
4964 double hmin = 0., hmax = 0., umin, umax;
4966 TAxis *ax = h1->GetXaxis();
4972 }
else if (padopt->
GetRange(0, umin, umax)) {
4977 Int_t i1 = ax->FindFixBin(umin);
4978 Int_t i2 = ax->FindFixBin(umax);
4979 if (i1 < i2) ax->SetRange(i1,i2);
4980 else { ax->UnZoom(); padopt->
ClearRange(0); }
4985 TAxis *ay = h1->GetYaxis();
4987 if (padopt->
GetRange(1, umin, umax)) {
4988 if (!autoscale && (ndim == 1)) {
4999 Int_t i1 = ay->FindFixBin(umin);
5000 Int_t i2 = ay->FindFixBin(umax);
5001 if (i1 < i2) { ay->SetRange(i1,i2); ay =
nullptr; }
5009 if ((ndim == 1) && (h1->GetMinimum() == 0) && (h1->GetMaximum() == 1)) {
5015 TAxis *az = h1->GetZaxis();
5017 if (padopt->
GetRange(2, umin, umax) && (ndim > 1)) {
5018 if (!autoscale && (ndim == 2)) {
5028 Int_t i1 = az->FindFixBin(umin);
5029 Int_t i2 = az->FindFixBin(umax);
5030 if (i1<i2) { az->SetRange(i1,i2); az =
nullptr; }
5043 if (hmax <= 0) hmax = 1.;
5044 if ((hmin <= 0) || (hmin >= hmax)) {
5046 if (hmin > 1.) hmin = 1;
5050 h1->SetMinimum(hmin);
5051 h1->SetMaximum(hmax);
5052 h1->SetBit(TH1::kIsZoomed);
5054 hs->SetMinimum(hmin);
5055 hs->SetMaximum(hmax);
5062 TIter next(hs->GetHists());
5063 while (
auto hs_h1 = (TH1 *) next()) {
5064 if (padopt->
GetRange(0, umin, umax)) {
5068 TAxis *ax = hs_h1->GetXaxis();
5069 Int_t i1 = ax->FindFixBin(umin);
5070 Int_t i2 = ax->FindFixBin(umax);
5071 if (i1<i2) { ax->SetRange(i1,i2); }
5072 else { ax->UnZoom(); padopt->
ClearRange(0); }
5074 hs_h1->GetXaxis()->UnZoom();
5077 hs_h1->GetYaxis()->UnZoom();
5078 hs_h1->SetMinimum();
5079 hs_h1->SetMaximum();
5089 h1->ResetBit(TH1::kIsZoomed);
5095 Double_t selmin = h1->GetMinimum();
5096 Double_t selmax = h1->GetMaximum();
5098 if (selmin >= selmax) {
5101 bool islogscale = (ndim == 1) && (padopt->
GetLogScale(1) > 0);
5104 if ((selmin > 0) && (selmax > 0)) {
5105 selmin = TMath::Log10(selmin) + TMath::Log10(0.5);
5106 selmin = TMath::Power(10, selmin);
5107 selmax = TMath::Log10(selmax)
5108 + TMath::Log10(2 * (0.9 / 0.95));
5109 selmax = TMath::Power(10, selmax);
5113 Double_t yMARGIN = gStyle->GetHistTopMargin();
5114 Double_t dymin = yMARGIN * (selmax - selmin);
5115 if ((selmin >= 0) && (selmin - dymin < 0))
5119 selmax += yMARGIN * (selmax - selmin);
5122 padopt->
SetRange(ndim, selmin, selmax);
5129 dynamic_cast<TPaveStats*
>(h1->GetListOfFunctions()->FindObject(
"stats"));
5131 stats =
new TPaveStats(
5132 gStyle->GetStatX()-gStyle->GetStatW(),
5133 gStyle->GetStatY()-gStyle->GetStatH(),
5135 gStyle->GetStatY(),
"brNDC");
5136 stats->SetParent(h1);
5137 stats->UseCurrentStyle();
5138 stats->SetName(
"stats");
5139 h1->GetListOfFunctions()->Add(stats);
5140 stats->ConvertNDCtoPad();
5147 dynamic_cast<TPaveText*
>(pad->GetListOfPrimitives()->FindObject(
"title"));
5150 titl =
new TPaveText(gStyle->GetTitleX()-gStyle->GetTitleW(),
5151 gStyle->GetTitleY()-gStyle->GetTitleH(),
5152 gStyle->GetTitleX(),
5153 gStyle->GetTitleY(),
"blNDC");
5154 titl->UseCurrentStyle();
5155 titl->SetFillColor(gStyle->GetTitleFillColor());
5156 titl->SetFillStyle(gStyle->GetTitleStyle());
5157 titl->SetName(
"title");
5158 titl->SetBorderSize(gStyle->GetTitleBorderSize());
5159 titl->SetTextColor(gStyle->GetTitleTextColor());
5160 titl->SetTextFont(gStyle->GetTitleFont(
""));
5161 if (gStyle->GetTitleFont(
"")%10 > 2)
5162 titl->SetTextSize(gStyle->GetTitleFontSize());
5163 titl->AddText(h1->GetTitle());
5164 titl->SetBit(kCanDelete);
5165 pad->GetListOfPrimitives()->Add(titl);
5166 titl->ConvertNDCtoPad();
5172 TAxis *xax = h1->GetXaxis();
5187 if (!padopt)
return false;
5191 if ((naxis < 0) || (naxis > NumDim))
return false;
5193 bool res = padopt->
GetRange(naxis, min, max);
5194 if (!res || (min >= max))
5200 double selmin,
double selmax,
bool force)
5202 if ((selmin == -1.) && (selmax == -1.))
return false;
5204 double min, max, umin, umax;
5207 padopt->
GetRange(naxis, umin, umax);
5209 if (!full || (min >= max) || (selmin >= selmax)) {
5214 double delta = (max - min) / 100000.;
5215 bool changed =
false;
5218 if (fabs(umin - selmin) > delta) {
5222 if (fabs(umax - selmax) > delta) {
5232 if ((selmin < min + delta) && (selmax > max - delta) && !force) {
5235 padopt->
SetRange(naxis, umin, umax);
5243 Double_t selmin, selmax;
5246 if (((ax->GetFirst() <= 0) && (ax->GetLast() >= ax->GetNbins() - 1))
5247 || (ax->GetFirst() >= ax->GetLast())) {
5251 selmin = ax->GetBinCenter(ax->GetFirst());
5252 selmax = ax->GetBinCenter(ax->GetLast());
5279 bool iszoomed = h1->TestBit(TH1::kIsZoomed);
5285 Double_t selmin = h1->GetMinimum();
5286 Double_t selmax = h1->GetMaximum();
5289 padopt->
SetRange(ndim, selmin, selmax);
5290 }
else if (selmin >= selmax) {
5294 bool islogscale = (ndim == 1) && (pad->GetLogy() > 0);
5297 if ((selmin > 0) && (selmax > 0)) {
5298 selmin = TMath::Log10(selmin) + TMath::Log10(0.5);
5299 selmin = TMath::Power(10, selmin);
5300 selmax = TMath::Log10(selmax)
5301 + TMath::Log10(2 * (0.9 / 0.95));
5302 selmax = TMath::Power(10, selmax);
5306 Double_t yMARGIN = gStyle->GetHistTopMargin();
5307 Double_t dymin = yMARGIN * (selmax - selmin);
5308 if ((selmin >= 0) && (selmin - dymin < 0))
5312 selmax += yMARGIN * (selmax - selmin);
5315 padopt->
SetRange(ndim, selmin, selmax);
5324 Double_t rxmin, rxmax, rymin, rymax;
5325 pad->GetRangeAxis(rxmin, rymin, rxmax, rymax);
5327 if (pad->GetLogx() > 0) {
5328 rxmin = TMath::Power(10., rxmin);
5329 rxmax = TMath::Power(10., rxmax);
5332 if (pad->GetLogy() > 0) {
5333 rymin = TMath::Power(10., rymin);
5334 rymax = TMath::Power(10., rymax);
5341 double rymin,
double rymax)
5348 if (!padopt)
return;
5357 double& xmax,
double& ymin,
double& ymax,
double& zmin,
double& zmax)
5361 if (!padopt)
return;
5375 QCheckBox* box1 = findChild<QCheckBox*>(
"ApplyToAllCheck");
5376 if (box1) box1->setChecked(on);
5383 bool modified =
false;
5384 bool applytoall =
false;
5385 bool redraw_immediately = !selpad;
5404 while (iter.
next()) {
5409 if (on != padopt->IsAutoScale())
5410 padopt->SetPadModified();
5411 padopt->SetAutoScale(on);
5412 modified = modified || padopt->IsPadModified();
5416 if (modified && redraw_immediately)
5421 double ymax,
double zmin,
double zmax)
5449 while (iter.
next()) {
5454 Int_t ndim = padopt->GetFullRangeDim();
5460 if (!padopt->IsAutoScale()) {
5467 padopt->SetPadModified();
5507 if (obj && !obj->InheritsFrom(THStack::Class()) && !obj->InheritsFrom(TMultiGraph::Class())) {
5585 for (
int n = 0; n < slot->
NumChilds(); n++) {
5604 basename =
"Marker";
5607 basename =
"Window";
5610 basename =
"Polygon";
5619 basename =
"Something";
5626 slotname = basename + QString::number(cnt++);
5627 }
while (padslot->
FindChild(slotname.toLatin1().constData()));
5640 for (
int n = 0; n < slot->
NumChilds(); n++) {
5643 if (drawkind != kind)
5646 if (subslot != activeslot)
5649 subslot->
SetPar(
"::ActiveMarker",
"1");
5658 if ((kind == selkind) && selobj)
5662 if (!slot)
return nullptr;
5664 TObject *lastobj =
nullptr;
5666 for (
int n = 0; n < slot->
NumChilds(); n++) {
5669 if (drawkind != kind)
5673 if (subslot->
GetPar(
"::ActiveMarker"))
5683 return !obj ? QString(
"null") : QString(obj->GetName());
5711 QString mycaption = windowTitle();
5712 QString oldtitle = mycaption.remove(
fPanelName +
": ");
5713 QString text = QInputDialog::getText(
this,
GetPanelName(),
5714 "Enter Viewpanel Title:", QLineEdit::Normal, oldtitle, &ok);
5715 if (ok && !text.isEmpty())
5726 QString text = QInputDialog::getText(
this,
GetPanelName(),
5727 "Enter Axis time format:", QLineEdit::Normal, oldfmt, &ok);
5728 if (ok && !text.isEmpty()) {
5739 bool s = act ? act->isChecked() :
false;
bool IsApplyToAll() const
virtual void SetMouseMode(int mode)
virtual void ShootRepaintTimer()
void CanvasUpdate(bool modify=false)
virtual TObject * GetDrawObject(TPad *pad, const char *name)
virtual void CheckActionAtTheEnd(TPad *pad)
virtual bool IsPadHasSubPads(TGo4Slot *padslot)
void showStatusMessage(const char *msg)
virtual void SwitchMarkerButton(int kind, bool on)
virtual void RectangularRatio(TPad *pad)
virtual void PrintCanvas()
void SetRange(Int_t naxis, Double_t min, Double_t max)
void SetTitleTime(Bool_t on=kTRUE)
TGo4Slot * GetChild(Int_t n) const
Bool_t GetIntPar(const char *name, Int_t &value) const
TPadGuard(TVirtualPad *repl=nullptr)
bool IsPadModified() const
virtual void SetPadDefaults(TPad *pad)
QString getTGraphDrawOpt()
bool isStatusBarVisible()
virtual void TakeFullRangeFromHisto(TH1 *h1, TGo4Picture *padopt, bool isfirsthisto)
void setPrinterSett(const QString &name, const QString &cmd)
virtual TGo4Slot * GetSuperimposeSlot(TGo4Slot *slot)
virtual void ApplyToAllToggled(bool)
QSignalMapper * fOptionsMap
Bool_t IsXAxisTimeDisplay() const
virtual void RedrawImage(TPad *pad, TGo4Picture *padopt, TGo4ASImage *im, TH2 *asihisto, bool scancontent)
bool isStatusBarVisible()
void SetAutoZoom(bool on)
TCutG * GetCut(Bool_t changeowner) override
void SetIntPar(const char *name, Int_t value)
void Draw(Option_t *opt="") override
virtual void StartConditionEditor()
virtual const char * GetDrawObjectLinkName(TPad *pad, TObject *obj)
Bool_t IsHisTitle() const
virtual void SetFreezeMouseMode(bool on)
virtual void MakePictureForPad(TGo4Picture *pic, TPad *pad, bool useitemname)
void MenuCommandExecuted(TObject *, const char *)
TObject * GetBrowserObject(const char *name, Int_t update=0)
QAction * fxCanvasEventstatusChk
virtual void ActivateInGedEditor(TObject *obj)
virtual void SetDrawKind(TGo4Slot *slot, int kind)
virtual int GetAutoColor(int indx)
virtual void SetYMaxDraw(Bool_t on)
virtual void SetActivePad(TPad *pad)
bool fbModifiedSignalFlag
virtual bool IsRedrawBlocked()
void SetProxy(TGo4Proxy *cont)
virtual bool ProcessPadRedraw(TPad *pad, bool force)
void SetDrawData(TH2 *histo, TGo4ViewPanel *panel, TPad *pad)
virtual void EditConditionBtn_clicked()
QWebCanvas * fxWCanvas
web canvas
virtual void RedrawMultiGraph(TPad *pad, TGo4Picture *padopt, TMultiGraph *mg, bool dosuperimpose, bool scancontent)
Bool_t IsTitleTime() const
virtual void HandleInput(EEventType button, Int_t x, Int_t y)
virtual void RedrawStack(TPad *pad, TGo4Picture *padopt, THStack *hs, bool dosuperimpose, bool scancontent)
void SelectedPadChanged(TPad *)
void getCanvasColor(int &red, int &green, int &blue)
virtual QString GetSelectedMarkerName(TPad *pad)
void SelectedPadChanged(TPad *)
virtual void StartConditionEditing(TPad *pad)
static TString NextAvailableName()
void SetValues(Double_t low1, Double_t up1) override
void CopyOptionsFrom(TGo4Picture *source)
virtual bool GetVisibleRange(TPad *pad, int naxis, double &min, double &max)
static bool CanDrawItem(int cando)
static TGo4MdiArea * Instance()
virtual TGo4Slot * GetDrawObjectSlot(TPad *pad, const char *name)
static Int_t GetInstances()
const char * NoStackDrawOption
bool IsAcceptDrag(const char *itemname, TClass *cl, int kind) override
TGo4Slot * FindChild(const char *name) const
virtual const char * GetPanelName()
virtual Bool_t IsXMeanDraw() const
virtual bool IsAutoZoomFlag()
virtual bool ScanDrawOptions(TPad *pad, TGo4Slot *padslot, TGo4Picture *pic, bool onlyscan)
virtual TObject * GetActiveObj(TPad *pad, int kind)
virtual void ShowEventStatus(bool)
void storePanelSize(QWidget *w, const QString &kind="ViewPanel")
void ResetWidget() override
Int_t GetNumObjNames() const
virtual void ResizeGedEditor()
void resizeEvent(QResizeEvent *e) override
Int_t ItemCanDo(const char *name)
void SetHistogram(TH1 *histo)
virtual void SetYRMSDraw(Bool_t on)
Int_t GetLogScale(Int_t nscale=0) const
void SetValuesDirect(TCutG *newcut)
virtual void SaveCanvas()
void linkedUpdated(TGo4Slot *slot, TObject *obj) override
virtual void ProcessMarkersClear(TPad *pad, bool withsubpads)
virtual void StartRootEditor(bool)
virtual void ProduceGraphFromMarkers()
bool IsContentModified() const
TGo4Proxy * GetProxy() const
virtual void GetConditionBtn_clicked()
virtual TGo4Slot * GetPanelSlot()
TClass * ItemClass(const char *name)
virtual void PadDoubleClickedSlot(TPad *pad, int evx=-1, int evy=-1)
void PadClicked(TPad *, int, int)
virtual void InfoConditionBtn_clicked()
virtual void AutoScaleToggled(bool)
Int_t GetIndexOf(const TGo4Slot *child) const
Graphic Qt Widget based Canvas.
virtual void ClosePanel()
void linkedObjectUpdated(const char *linkname, TObject *obj) override
virtual void ProducePicture()
virtual const char * GetDrawItemName(int itemcnt=0)
TH1 * GetWorkHistogram() const
virtual void SetAutoZoomFlag(bool on)
bool fbLeaveFocusAfterCondEnd
virtual TGo4Slot * GetPadMainObjectSlot(TPad *pad)
TGo4Slot * BrowserSlot(const char *item=nullptr)
virtual void CompleteInitialization()
virtual void ProcessPadDoubleClick()
Double_t GetYLow() const override
virtual void RedrawPanel(TPad *pad, bool force)
virtual void MoveScale(int expandfactor, int xaction, int yaction, int zaction)
void SetTitleItem(Bool_t on=kTRUE)
virtual void ClearCanvas()
virtual void DelSelectedMarker_clicked()
virtual void Divide(int numX, int numY)
void SetXAxisTimeFormat(const char *format)
TGo4Slot * getslot() const
Int_t GetRebinY(Int_t index=UndefIndex) const
void ChangeDrawOption(Int_t kind, Int_t value)
TGo4Picture * Pic(Int_t posy, Int_t posx)
virtual void LogMarkerValues()
virtual void SetCursorMode(bool on)
Bool_t GetStatsAttr(TPaveStats *stats) const
virtual void CheckForSpecialObjects(TPad *pad, TGo4Slot *padslot)
virtual void TakeFullRangeFromGraph(TGraph *gr, TGo4Picture *padopt, bool isfirst)
virtual void UpdatePanelCaption()
virtual QString GetActiveObjName(TPad *pad, int kind)
virtual void SetConditionBtn_clicked()
virtual void UndrawItemOnPanel(const char *itemname)
virtual void DeleteDrawObject(TPad *pad, const char *name)
TObject * GetAssignedObject()
virtual TPad * GetSlotPad(TGo4Slot *slot)
virtual TPad * GetSubPad(TPad *toppad, int num, bool onlytoplevel)
virtual TObject * GetPadMainObject(TPad *pad)
virtual void AboutToShowOptionsMenu()
virtual void ProducePadsList(TObjArray *arr, TPad *toppad)
virtual void SetApplyToAllFlag(bool on)
virtual void AllocatePadOptions(TPad *pad)
void SetApplyToAll(bool on)
virtual bool IsConditionSelected(TPad *pad)
virtual bool IsRepaintTimerActive()
Bool_t GetFrameAttr(TPad *pad) const
virtual const char * GetSpecialDrawOption(TGo4Slot *slot)
virtual void SetSelectedRange(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
virtual void DisplayPadStatus(TPad *pad)
void SetFullRangeDim(Int_t ndim)
virtual void CheckObjectsAssigments(TPad *pad, TGo4Slot *padslot)
virtual void RedrawLegend(TPad *pad, TGo4Picture *padopt, TGo4Slot *legslot)
void SetDivision(Int_t ndivy, Int_t ndivx)
virtual TGo4Slot * AddNewSlot(const char *name, TGo4Slot *parent)
const char * GetName() const override
virtual void SaveMarkers()
virtual Bool_t IsXRMSDraw() const
virtual void ProcessCanvasAdopt(TPad *tgtpad, TPad *srcpad, const char *srcitemname)
TH1D * GetHistogram(const char *HistogramName)
void PadClicked(TPad *, int, int)
TGo4Slot * GetParent() const
virtual void SetSelectedMarker(TPad *pad, const QString &selname, int selindex)
void AddObjName(const char *name, Option_t *DrawOption=nullptr)
void SetStatsAttr(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Int_t optstat=1111, const char *statformat="6.4g", Int_t optfit=1111, const char *fitformat="5.4g")
virtual bool ShiftSelectedObjectToEnd(TPad *pad)
void SetXAxisTimeDisplay(Bool_t on)
virtual void checkRepaintSlot()
void SetRebinY(Int_t ngroupy, Int_t index=UndefIndex)
virtual void RedrawHistogram(TPad *pad, TGo4Picture *padopt, TH1 *his, bool scancontent, bool first_draw)
virtual void PadRangeAxisChanged(TPad *pad)
virtual void MarkPadModified(TPad *pad)
Int_t GetRebinX(Int_t index=UndefIndex) const
virtual void DropOnPad(TPad *pad, const char *itemname, TClass *cl, int kind)
TList * GetSpecialObjects() const
virtual void UpdatePadStatus(TPad *pad, bool removeitems)
QStatusBar * CanvasStatus
virtual void SetPolygonMode(bool on)
virtual void CleanupGedEditor()
Bool_t ShiftSlotAfter(TGo4Slot *slot, TGo4Slot *after)
virtual void MoveSingleScale(int expandfactor, int action, int naxis, TGo4Picture *opt, TObject *padhist)
virtual void SelectMenuItemActivated(int)
void SetLogScale(Int_t nscale=0, Int_t zn=1)
virtual TGo4Slot * GetPadSlot(TPad *pad)
virtual void ResetPadFillColors(TPad *pad, int col, TPad *backup=nullptr)
virtual void SelectedMarkerCmb_activated(int indx)
virtual void ClearPad(TPad *pad, bool removeitems, bool removesubpads)
bool IsLegendDraw() const
bool IsSuperimpose() const
virtual TPad * FindPadWithItem(const char *itemname)
const char * GetObjName(Int_t n) const
virtual int GetNumMarkers(TPad *pad, int kind)
virtual void PadDeleted(TPad *pad)
void RemovePar(const char *name)
void CanvasDropEvent(QDropEvent *, TPad *)
virtual void SetMarkerPanel(bool)
void linkedRemoved(TGo4Slot *slot, TObject *obj) override
virtual void SetRegionMode(bool on)
Bool_t IsHisStats() const
virtual void SetSpecialDrawOption(TGo4Slot *slot, const char *drawopt)
virtual void SetWorkHistogram(TH1 *histo)
void setMaskDoubleClick(bool on=true)
virtual void ClearAllMarkers()
virtual void ClearActivePad()
virtual void GetSelectedRange(int &ndim, bool &autoscale, double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax)
Bool_t IsTitleItem() const
virtual void RedrawGraph(TPad *pad, TGo4Picture *padopt, TGraph *gr, bool scancontent, bool first_draw)
virtual void OptionsMenuItemActivated(int)
Bool_t GetRangeY(Double_t &min, Double_t &max) const
void setEditorVisible(bool flag=true)
virtual void Resize(Option_t *option="")
virtual void SetSelectedObjectIndex(TGo4Slot *slot, int indx)
virtual TGo4Picture * GetPadOptions(TPad *pad)
Bool_t DefineRelatedObject(const char *itemname, const char *objectname, TString &objectitem, Int_t mask=3)
Bool_t GetRange(Int_t naxis, Double_t &min, Double_t &max) const
void PadDblClicked(TPad *, int, int)
TCanvas * getCanvas()
returns canvas shown in the widget
TGo4Picture * FindPic(Int_t posy, Int_t posx)
virtual int GetSelectedMarkerIndex(TPad *pad)
void SetHisStats(Bool_t on)
QSignalMapper * fSelectMap
virtual void AddMarkerObj(TPad *pad, int kind, TObject *obj)
bool getFetchDataWhenDraw()
virtual int GetDrawKind(TGo4Slot *slot)
virtual void panelSlot(TGo4ViewPanel *panel, TPad *pad, int signalid)
TGo4ViewPanel(QWidget *parent=nullptr, const char *name=nullptr)
virtual TObject * ProduceSuperimposeObject(TGo4Slot *padslot, TGo4Picture *padopt, TGo4Slot *sislot, TGo4Slot *legslot, TObjArray *objs, TObjArray *objslots, bool showitems)
void SetSelectedRange(double rxmin, double rxmax, double rymin, double rymax)
virtual void SetSlotPad(TGo4Slot *padslot, TPad *pad)
static void Error(const char *text,...) GO4_PRINTF_ARGS
void SetDrawOption(Option_t *option="") override
virtual void SetSelectedMarkerByMouseClick(TPad *pad, const char *name)
const char * GetPar(const char *name) const
TH1 * Get_fHistogram(TObject *obj, bool force=false)
Int_t GetHisContour() const
virtual void ProcessPadModifiedSignal()
virtual void CollectMainDrawObjects(TGo4Slot *slot, TObjArray *objs, TObjArray *objslots, int modifier)
void SetFullRange(Int_t naxis, Double_t min, Double_t max)
virtual void ScanObjectsDrawOptions(bool onlyscan, TGo4Slot *padslot, TObjArray *objs, TObjArray *objslots)
virtual void ProcessPadStatusUpdate(TPad *pad, TGo4Slot *parent, bool removeitems)
void SetFrameAttr(Double_t left, Double_t top, Double_t right, Double_t bottom)
virtual void PadClickedSlot(TPad *pad, int evx=-1, int evy=-1)
virtual void SetChanged(Bool_t on=kTRUE)
virtual TH1 * GetPadHistogram(TPad *pad)
TH1 * GetHistogram() const
virtual void SetPadSuperImpose(TPad *pad, bool on)
virtual bool TakeSelectedAxisRange(int naxis, TGo4Picture *padopt, double selmin, double selmax, bool force)
virtual Int_t IsChanged() const
virtual void ClearPadItems(TGo4Slot *padslot, TGo4Slot *remain)
QCheckBox * fAutoScaleCheck
virtual void SetLateXMode(bool on)
Bool_t IsXYRatioOne() const
virtual bool IsWebCanvas() const
Int_t GetFullRangeDim() const
virtual void RefreshButtons()
void SetSuperimpose(bool on)
void PadDoubleClicked(TPad *, int, int)
void SetWorkHistogram(TH1 *histo) override
void SetDrawAttributes(TObject *obj, Int_t index=UndefIndex)
void setStatusBar(QStatusBar *bar)
Double_t GetXLow() const override
void SetPadModified(bool on=true)
virtual bool IsPanelPad(TPad *pad)
virtual TGo4Slot * GetSelectedSlot(TPad *pad, int *selkind, TObject **selobj)
virtual void BlockPanelRedraw(bool on)
void ClearFullRange(Int_t naxis=-1)
virtual void CanvasDropEventSlot(QDropEvent *event, TPad *pad)
Int_t GetDimension() const
TPad * fxDoubleClickTimerPad
virtual void SetActiveObj(TPad *pad, int kind, TGo4Slot *activeslot)
virtual void CollectSpecialObjects(TPad *pad, TObjArray *objs, int selectkind)
virtual void LoadMarkers()
virtual Bool_t IsXMaxDraw() const
virtual void RedrawSpecialObjects(TPad *pad, TGo4Slot *padslot)
virtual void SetPanelName(const char *newname)
virtual bool IsApplyToAllFlag()
virtual void SetYMeanDraw(Bool_t on)
void SetAutoScale(bool on)
virtual void ChangeDrawOption(int kind, int value, const char *drawopt)
void CanvasDropEvent(QDropEvent *, TPad *)
virtual int GetNumberOfPads(TPad *toppad)
void SetPar(const char *name, const char *value)
virtual TPad * GetActivePad()
void Draw(Option_t *opt="") override
void SetSelectedPad(TPad *pad)
Bool_t GetTitleAttr(TPaveText *title) const
void SetContentModified(bool on=true)
const char * GetXAxisTimeFormat() const
virtual void SuperImposeToggled(bool)
virtual void DefaultPadMargin(TPad *pad)
void SetTitleDate(Bool_t on=kTRUE)
QRootCanvas * fxQCanvas
qtroot canvas
virtual void ProcessPictureRedraw(const char *picitemname, TPad *pad, TGo4Picture *pic)
void AddSpecialObject(TObject *obj, Option_t *drawopt=nullptr)
virtual void SetDrawingMode(bool on)
void SetRebinX(Int_t ngroupx, Int_t index=UndefIndex)
virtual bool DeleteDrawObjects(TPad *pad, int kindtodelete)
virtual TObject * GetSelectedObject(TPad *pad, const char **drawopt)
TGo4Condition * At(Int_t i) const
virtual void checkResizeSlot()
Option_t * GetDrawOption() const override
virtual TCanvas * GetCanvas()
void setEditorFrame(QFrame *fr)
void activateEditor(TPad *pad, TObject *obj)
void setStatusBarVisible(bool flag)
Bool_t GetFullRange(Int_t naxis, Double_t &min, Double_t &max) const
virtual bool IsFreezeTitle()
virtual TGo4Slot * AddDrawObject(TPad *pad, int kind, const char *itemname, TObject *obj, bool owner, const char *drawopt)
virtual void ProcessPadClear(TPad *pad, bool removeitems, bool removesubpads)
void setStatusBarVisible(bool flag=true)
void ClearRange(Int_t naxis=-1)
virtual void SetFreezedTitle(const QString &title)
virtual bool CompleteMarkerEdit(TPad *pad)
virtual void SetSelectedRangeToHisto(TPad *pad, TH1 *h1, THStack *hs0, TGo4Picture *padopt, bool ishisto)
void SetXAxisAttTime(Bool_t timedisplay, const char *format, Int_t index=UndefIndex)
QAction * fxCanvasEditorChk
void SetHistogramContent(TH2 *histo)
void SetTitleAttr(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t textsize=0.)
virtual int GetMouseMode()
virtual void MenuCommandExecutedSlot(TObject *obj, const char *cmdname)
Bool_t next(Bool_t goesinto=kTRUE)
void panelSignal(TGo4ViewPanel *, TPad *, int)
virtual int GetSelectedObjectIndex(TGo4Slot *slot)
virtual void CanvasUpdatedSlot()
void activateEditor(TPad *pad=nullptr, TObject *obj=nullptr)
virtual void ChangeDrawOptionForPad(TGo4Slot *padslot, int kind, int value, const char *drawopt)
void GetDrawAttributes(TObject *obj, Int_t index=UndefIndex) const
Bool_t IsTitleDate() const
virtual void SetAutoScale(bool on, TPad *selpad)