26#include "TMultiGraph.h"
35#include "TPaveStats.h"
36#include "TPaveLabel.h"
43#include "TCanvasImp.h"
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);
165 if (
go4sett->getWebBasedCanvas()) {
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;
226 ed_visible =
fxQCanvas->isEditorVisible();
227 ed_allowed =
fxQCanvas->isEditorAllowed();
234 bool status_flag =
go4sett->getPadEventStatus();
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);
303 fxWCanvas->setStatusBarVisible(status_flag);
318 fxQCanvas->setStatusBarVisible(status_flag);
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()))
496 go4sett->getFetchDataWhenDraw() ? 2 : 1);
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())
1719 return ((THStack *)obj)->GetHistogram();
1721 if (obj->IsA() == TMultiGraph::Class())
1722 return ((TMultiGraph *)obj)->GetHistogram();
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)) {
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;
1978 if (!
fxQCanvas->isEditorAllowed())
return;
1980 visible = !
fxQCanvas->isEditorVisible();
1993 visible = !
fxWCanvas->isEditorVisible();
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) {
2191 flag = !
fxQCanvas->isStatusBarVisible();
2196 flag = !
fxWCanvas->isStatusBarVisible();
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))) {
2488 if (!pad || !pic || !padslot)
2491 bool optchanged =
false;
2492 TObjLink* link = pad->GetListOfPrimitives()->FirstLink();
2495 const char *clname = link->GetObject()->ClassName();
2496 if ((strcmp(clname,
"TFrame") == 0) || (strcmp(clname,
"TLegend") == 0)) {
2497 link = link->Next();
2505 TString newopt(link->GetOption());
2512 if (!oldopt.Contains(
"asimage"))
2513 if ((newopt.Length() != oldopt.Length())
2514 || (newopt.CompareTo(oldopt, TString::kIgnoreCase) != 0)) {
2519 TH1 *h1 =
dynamic_cast<TH1 *
>(link->GetObject());
2522 TGraph *gr =
dynamic_cast<TGraph *
> (link->GetObject());
2528 dynamic_cast<TPaveStats*
>(h1->GetListOfFunctions()->FindObject(
"stats"));
2529 if (h1->TestBit(TH1::kNoStats)) {
2536 TAxis *xax = h1->GetXaxis();
2560 TPaveText *titl =
dynamic_cast<TPaveText *
>(pad->GetListOfPrimitives()->FindObject(
"title"));
2566 TObjArray objs, objslots;
2575 TObjArray *objs, TObjArray *objslots)
2581 if (padslot->
GetPar(
"::DrawOptAssigned")) {
2583 }
else if (!onlyscan) {
2585 padslot->
SetPar(
"::DrawOptAssigned",
"1");
2589 if (!padslot || !pic || !objs || !objslots)
2592 for (
int n = 0; n <= objs->GetLast(); n++) {
2593 TObject *obj = objs->At(n);
2596 if (!obj || !subslot)
2599 if (subslot->
GetPar(
"::DrawOptAssigned")) {
2601 }
else if (!onlyscan) {
2603 subslot->
SetPar(
"::DrawOptAssigned",
"1");
2616 TObjArray mainslots;
2618 int lastobjtype = 0;
2620 for (
int n = 0; n < slot->
NumChilds(); n++) {
2634 if (obj->InheritsFrom(TH1::Class()))
2636 else if (obj->InheritsFrom(TGraph::Class()))
2638 else if (obj->InheritsFrom(TMultiGraph::Class()))
2640 else if (obj->InheritsFrom(THStack::Class()))
2646 lastobjtype = objtype;
2647 mainslots.Add(subslot);
2651 Bool_t deletesomething = kFALSE;
2653 for (
int n = 0; n <= mainslots.GetLast(); n++) {
2657 if (obj->InheritsFrom(TH1::Class()))
2659 else if (obj->InheritsFrom(TGraph::Class()))
2661 else if (obj->InheritsFrom(TMultiGraph::Class()))
2663 else if (obj->InheritsFrom(THStack::Class()))
2669 if ((n < mainslots.GetLast()) && ((modifier == 2) || ((modifier == 1) && (lastobjtype != objtype)))) {
2671 deletesomething = kTRUE;
2675 objslots->Add(subslot);
2684 if (deletesomething)
2687 for (
int n = 0; n < slot->
NumChilds(); n++) {
2696 objslots->Add(subslot);
2704 if (indx < 0) indx = 0;
2706 switch (indx % 10) {
2707 case 0:
return kBlack;
2708 case 1:
return kRed;
2709 case 2:
return kGreen;
2710 case 3:
return kBlue;
2711 case 4:
return kCyan;
2712 case 5:
return kOrange;
2713 case 6:
return kSpring;
2714 case 7:
return kViolet;
2715 case 8:
return kPink;
2716 case 9:
return kAzure;
2725 TObjArray * objslots,
bool showitems)
2727 if (!sislot || !objs || !padopt)
return nullptr;
2730 Bool_t ishstack = kFALSE;
2731 Bool_t isgstack = kFALSE;
2732 Bool_t iserror = kFALSE;
2733 Bool_t resetcolors = kFALSE;
2735 for (
int n = 0; n <= objs->GetLast(); n++) {
2736 TObject *obj = objs->At(n);
2737 if (obj->InheritsFrom(TH1::Class()))
2739 else if (obj->InheritsFrom(TGraph::Class()))
2746 if (iserror || (ishstack && isgstack)) {
2747 TGo4Log::Error(
"Superimpose of multiple objects with different types");
2752 THStack *hs =
dynamic_cast<THStack*
>(oldobj);
2755 hs =
new THStack(objs->First()->GetName(), objs->First()->GetTitle());
2757 resetcolors = kTRUE;
2760 hs->GetHists()->Clear();
2763 for (
int n = 0; n <= objs->GetLast(); n++) {
2764 TH1 *histo = (TH1 *) objs->At(n);
2771 if ((
go4sett->getDrawLineWidth() > 1) && (histo->GetLineWidth()==1))
2772 histo->SetLineWidth(
go4sett->getDrawLineWidth());
2775 histo->GetXaxis()->UnZoom();
2783 hs->Add(histo, drawopt);
2786 }
else if (isgstack) {
2787 TMultiGraph *mgr =
dynamic_cast<TMultiGraph *
>(oldobj);
2789 mgr =
new TMultiGraph(objs->First()->GetName(), objs->First()->GetTitle());
2791 resetcolors = kTRUE;
2792 }
else if (mgr->GetListOfGraphs()) {
2793 mgr->GetListOfGraphs()->Clear();
2796 for (
int n = 0; n <= objs->GetLast(); n++) {
2797 TGraph *gr = (TGraph *) objs->At(n);
2803 if (drawopt.IsNull())
2805 if (drawopt.IsNull())
2806 drawopt =
go4sett->getTGraphDrawOpt().toLatin1().constData();
2811 if (n > 0) drawopt.ReplaceAll(
"a",
"");
2813 Bool_t first_draw = objslot->
GetPar(
"::FirstDraw") !=
nullptr;
2815 Int_t objindx = padslot->
GetIndexOf(objslot);
2820 gr->SetLineColor(nextcol);
2821 gr->SetMarkerColor(nextcol);
2822 if ((
go4sett->getDrawLineWidth() > 1) && (gr->GetLineWidth()==1))
2823 gr->SetLineWidth(
go4sett->getDrawLineWidth());
2826 if (first_draw && (n == 0)) {
2827 TAxis *ax = gr->GetXaxis();
2828 if (ax && ax->GetTimeDisplay()) {
2837 mgr->Add(gr, drawopt.Data());
2842 if ((ishstack || isgstack) && legslot) {
2846 double miny = 0.94 - 0.03 * objs->GetLast();
2849 else if (miny > 0.92)
2851 legend =
new TLegend(0.6, miny, 0.95, 0.99);
2852 legend->SetBorderSize(2);
2853 legend->SetName(
"fitlegend");
2859 for (
int n = 0; n <= objs->GetLast(); n++) {
2860 TObject *stob = objs->At(n);
2862 const char *objname = stob->GetName();
2864 if (showitems && objslots) {
2866 if (itemname) objname = itemname;
2869 TString ldrawopt =
"l";
2875 if (drawopt.Contains(
"l")) ldrawopt+=
"l";
2876 if (drawopt.Contains(
"p")) ldrawopt+=
"p";
2879 if (ldrawopt.IsNull()) ldrawopt =
"l";
2881 legend->AddEntry(stob, objname, ldrawopt.Data());
2893 if (!pad || !padslot)
return;
2898 if ((numX > 1) || (numY > 1)) {
2899 pad->Divide(numX, numY);
2914 tgtslot =
new TGo4Slot(padslot,
"::ThisPad",
"Special object");
2928 while (iter.
next()) {
2951 for (
int n = 0; n < padslot->
NumChilds(); n++)
2980 while (iter.
next()) {
3004 while (iter.
next()) {
3027 while (iter.
next()) {
3037 if (!pad || !slot || !obj)
3040 for (
int n = 0; n < slot->
NumChilds(); n++) {
3050 return !padslot ? nullptr : padslot->
FindChild(
"::Superimpose");
3059 for (
int n = 0; n < slot->
NumChilds(); n++) {
3120 tgtslot =
new TGo4Slot(padslot,
"::PadOptions",
"Pad options slot");
3145 if (!pad || !padslot)
3148 TObject *obj =
nullptr;
3159 if (obj->InheritsFrom(TH1::Class()))
3164 if (obj->InheritsFrom(TGraph::Class()))
3168 if (obj->InheritsFrom(THStack::Class()))
3171 if (obj->InheritsFrom(TMultiGraph::Class())) {
3172 TMultiGraph *mg =
dynamic_cast<TMultiGraph *
>(obj);
3178 TIter iter(mg->GetListOfGraphs());
3179 while (
auto gr = (TGraph *) iter()) {
3212 TObjArray objs, objslots;
3215 Int_t nselectitem = 0;
3231 QString fulllist =
"";
3232 QString selslotname =
"";
3234 for (
int n = 0; n <= objslots.GetLast(); n++) {
3240 QString subslotname = subslot->GetName();
3241 if (n == selected) {
3242 subslotname = QString(
"[") + subslotname + QString(
"]");
3243 selslotname = subslotname;
3245 if (n > 0) fulllist +=
", ";
3246 fulllist += subslotname;
3250 && (selected < objslots.GetLast())) {
3253 QString(
"Show ") + selslotname + QString(
" on top"),
3258 fulllist = QString(
"[") + fulllist + QString(
"]");
3262 if (nselectitem > 0) {
3269 if (fulllist.length() > 0) {
3274 if (capt.length() > 60) {
3280 setWindowTitle(capt);
3298 slot->
SetPar(
"::DrawOpt", drawopt);
3308 if (!slot->
GetIntPar(
"::DrawKind", kind))
3315 return !slot ? nullptr : slot->
GetPar(
"::DrawOpt");
3321 slot->
SetIntPar(
"::SelectedObject", indx);
3329 if (!slot->
GetIntPar(
"::SelectedObject", indx))
3338 if (!slot || !padopt)
3350 TObjArray objs, objslots;
3353 if (objs.GetLast() < 0)
3356 if ((indx > objs.GetLast()) || (indx < 0))
3367 return objs.At(indx);
3374 if (!slot || !padopt)
3379 TObjArray objs, objslots;
3383 if ((objs.GetLast() <= 0) || (indx == objs.GetLast()))
3399 if (!pad || !padslot)
return;
3401 TObjArray objs, objslots;
3405 if (indx < 0) indx = 0;
3407 TH1 *selhisto =
dynamic_cast<TH1 *
>((indx <= objs.GetLast()) ? objs.At(indx) :
nullptr);
3411 for (
int n = 0; n < padslot->
NumChilds(); n++) {
3422 if (obj->InheritsFrom(TGo4Condition::Class()))
3424 else if (obj->InheritsFrom(TGo4Marker::Class()))
3429 TH1 *oldhisto =
nullptr;
3437 if (!objs.FindObject(oldhisto))
3455 setWindowTitle(mycaption);
3462 if (!pad || !padslot)
3467 TCanvas *canv =
nullptr;
3472 for (
int n = 0; n < padslot->
NumChilds(); n++) {
3482 if ((kind < 0) || (kind >= 100))
3486 if (obj->InheritsFrom(TGo4Condition::Class())) {
3491 cond->SetFillStyle(3444);
3496 if (obj->InheritsFrom(TLatex::Class())) {
3501 if (obj->InheritsFrom(TF1::Class())) {
3512 canv =
dynamic_cast<TCanvas *
>(obj);
3543 TVirtualPad *padsav = gPad;
3556 if (!pad || !pic)
return;
3564 for (Int_t posy = 0; posy < pic->
GetDivY(); posy++)
3565 for (Int_t posx = 0; posx < pic->
GetDivX(); posx++) {
3630 while (
auto obj = iter()) {
3631 Option_t *drawopt = iter.GetOption();
3632 if (
dynamic_cast<TArrow *
>(obj))
3634 else if (
dynamic_cast<TLatex *
>(obj))
3642 else if (
dynamic_cast<TPaveLabel *
>(obj))
3653 if (!tgtpad || !srcpad)
return;
3659 if (!padopt || !padslot)
return;
3661 tgtpad->SetTickx(srcpad->GetTickx());
3662 tgtpad->SetTicky(srcpad->GetTicky());
3663 tgtpad->SetGridx(srcpad->GetGridx());
3664 tgtpad->SetGridy(srcpad->GetGridy());
3665 tgtpad->SetBorderSize(srcpad->GetBorderSize());
3666 tgtpad->SetBorderMode(srcpad->GetBorderMode());
3667 srcpad->TAttLine::Copy(*tgtpad);
3668 srcpad->TAttFill::Copy(*tgtpad);
3669 srcpad->TAttPad::Copy(*tgtpad);
3671 tgtpad->SetPhi(srcpad->GetPhi());
3672 tgtpad->SetTheta(srcpad->GetTheta());
3674 int nsubpads = 0, nmain = 0, mainkind = 0;
3675 TObjLink* link = srcpad->GetListOfPrimitives()->FirstLink();
3677 TObject *obj = link->GetObject();
3678 const char *drawopt = link->GetOption();
3684 TPad *srcsubpad =
dynamic_cast<TPad *
>(obj);
3686 TString itemname = TString::Format(
"%s/%s", srcpaditemname, obj->GetName());
3690 QString subpadname = tgtpad->GetName();
3692 subpadname += QString::number(nsubpads);
3694 Double_t xlow, ylow, xup, yup;
3696 srcsubpad->GetPadPar(xlow, ylow, xup, yup);
3699 TPad *tgtsubpad =
new TPad(subpadname.toLatin1().constData(),
3700 srcsubpad->GetName(), xlow, ylow, xup, yup);
3701 tgtsubpad->SetNumber(nsubpads);
3717 }
else if (
dynamic_cast<TLatex *
>(obj)) {
3719 }
else if (
dynamic_cast<TPaveLabel *
>(obj)) {
3721 }
else if (
dynamic_cast<TArrow *
>(obj)) {
3723 }
else if (
dynamic_cast<TH1 *
>(obj)) {
3726 }
else if (
dynamic_cast<TGraph *
>(obj)) {
3729 }
else if (
dynamic_cast<THStack *
>(obj)) {
3732 }
else if (
dynamic_cast<TMultiGraph *
>(obj)) {
3741 if ((kind > 0) && ((mainkind == 0) || ((kind == mainkind) && (kind < 3)))) {
3750 if (h1 && (nmain == 0)) {
3752 Int_t ndim = h1->GetDimension();
3759 Double_t selmin = h1->GetMinimum();
3760 Double_t selmax = h1->GetMaximum();
3762 if (selmin < selmax)
3763 padopt->
SetRange(ndim, selmin, selmax);
3766 !h1->TestBit(TH1::kIsZoomed) || (selmin >= selmax));
3773 link = link->Next();
3798 fxQCanvas->HandleInput(kButton1Up, 0, 0);
3799 fxQCanvas->HandleInput(kMouseMotion, 0, 0);
3801 gROOT->SetEscape(kFALSE);
3809 Bool_t oldmodified = gPad->IsModified();
3812 dummy.ExecuteEvent(kButton1Up, 0, 0);
3813 gPad->Modified(oldmodified);
3818 bool isanychildmodified =
false;
3819 bool ispadupdatecalled =
false;
3821 QTime starttm = QTime::currentTime();
3838 if (isanychildmodified) {
3840 ispadupdatecalled =
true;
3843 int delay = starttm.msecsTo(QTime::currentTime());
3844 intime = (delay >= 0) && (delay < 100);
3846 }
while (!force && isanychildmodified && intime);
3854 if (!ispadupdatecalled)
3861 if (!force && isanychildmodified)
3868 if (!slot)
return false;
3871 if (!padopt)
return false;
3873 bool ischilds =
false;
3874 bool ischildmodified =
false;
3881 Int_t lastdrawnpad = 0;
3883 if (!slot->
GetIntPar(
"::LastDrawnPad", lastdrawnpad))
3886 Int_t subpadindx = 0, numchilds = slot->
NumChilds();
3889 for (
int n = 0; n < numchilds; n++) {
3890 subpadindx = (n + lastdrawnpad);
3891 if (numchilds > 0) subpadindx = subpadindx % numchilds;
3893 if (!subpad)
continue;
3896 ischildmodified =
true;
3901 if (!force && ischildmodified)
3902 slot->
SetIntPar(
"::LastDrawnPad", subpadindx);
3907 return ischildmodified;
3915 if (ischilds)
return ischildmodified;
3924 TObjArray objs, objslots;
3934 if (objs.GetLast() < 0) {
3947 TH2 *asihisto =
nullptr;
3949 TObject *drawobj =
nullptr;
3952 Bool_t dosuperimpose = objs.GetLast() > 0;
3956 Bool_t doasiimage = !dosuperimpose && !
fxWCanvas && objs.Last()->InheritsFrom(TH2::Class());
3958 if (drawopt && TString(drawopt).Contains(
"asimage")) {
3959 if (!doasiimage) { drawopt =
"col"; padopt->
SetDrawOption(
"col", 0); }
3961 doasiimage = kFALSE;
3964 if (dosuperimpose) {
3966 sislot =
new TGo4Slot(slot,
"::Superimpose",
"place for superimpose object");
3969 legslot =
new TGo4Slot(slot,
"::Legend",
"place for legends object");
3970 }
else if (legslot) {
3978 dosuperimpose = kFALSE;
3981 if (!dosuperimpose) {
3990 drawobj = objs.Last();
3994 asihisto =
dynamic_cast<TH2 *
>(drawobj);
3999 asislot =
new TGo4Slot(slot,
"::ASImage",
"place for Go4 ASI image");
4004 updatecontent =
true;
4013 if (!doasiimage && asislot) {
4020 bool first_draw = (slot->
GetPar(
"::PadFirstDraw") ==
nullptr);
4021 if (first_draw) slot->
SetPar(
"::PadFirstDraw",
"true");
4023 if (drawobj->InheritsFrom(TH1::Class())) {
4024 TH1 *h1 = (TH1 *) drawobj;
4025 h1->SetBit(kCanDelete, kFALSE);
4027 }
else if (drawobj->InheritsFrom(THStack::Class())) {
4028 THStack *hs = (THStack*) drawobj;
4029 RedrawStack(pad, padopt, hs, dosuperimpose, updatecontent);
4030 }
else if (drawobj->InheritsFrom(TGraph::Class())) {
4031 TGraph *gr = (TGraph *)drawobj;
4032 RedrawGraph(pad, padopt, gr, updatecontent, first_draw);
4033 }
else if (drawobj->InheritsFrom(TMultiGraph::Class())) {
4034 TMultiGraph *mg = (TMultiGraph *)drawobj;
4038 RedrawImage(pad, padopt, ai, asihisto, updatecontent);
4055 if (!pad || !padopt || !his)
return;
4061 if (drawopt.IsNull()) {
4062 if (his->GetDimension() == 1)
4063 drawopt =
go4sett->getTH1DrawOpt().toLatin1().constData();
4064 else if (his->GetDimension() == 2)
4065 drawopt =
go4sett->getTH2DrawOpt().toLatin1().constData();
4066 else if (his->GetDimension() == 3)
4067 drawopt =
go4sett->getTH3DrawOpt().toLatin1().constData();
4072 if (first_draw && (
go4sett->getDrawLineWidth() > 1) && (his->GetLineWidth()==1))
4073 his->SetLineWidth(
go4sett->getDrawLineWidth());
4076 if (first_draw && (
go4sett->getDrawFillColor() > 0) && (his->GetFillColor() == 0))
4077 his->SetFillColor(
go4sett->getDrawFillColor());
4078 if (first_draw && (
go4sett->getDrawFillStyle()!=1001) && (his->GetFillStyle()==1001))
4079 his->SetFillStyle(
go4sett->getDrawFillStyle());
4082 if (nlvl > 0) his->SetContour(nlvl);
4085 his->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4086 his->Draw(drawopt.Data());
4092 bool dosuperimpose,
bool scancontent)
4094 if (!pad || !padopt || !hs)
return;
4097 TIter iter(hs->GetHists());
4099 while (
auto h1 = (TH1 *) iter()) {
4109 if (drawopt.IsNull())
4114 hs->Draw(drawopt.Data());
4117 if (!framehisto)
return;
4119 framehisto->SetStats(
false);
4120 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4121 TH1 *h1 = hs->GetHists() ?
dynamic_cast<TH1 *
>(hs->GetHists()->First()) :
nullptr;
4123 hs->SetTitle(h1->GetTitle());
4124 framehisto->SetTitle(h1->GetTitle());
4125 framehisto->GetXaxis()->SetTitle(h1->GetXaxis()->GetTitle());
4126 framehisto->GetYaxis()->SetTitle(h1->GetYaxis()->GetTitle());
4127 framehisto->GetZaxis()->SetTitle(h1->GetZaxis()->GetTitle());
4135 if (!pad || !padopt || !gr)
return;
4139 gr->SetEditable(kFALSE);
4146 TAxis *ax = gr->GetXaxis();
4147 if (ax && ax->GetTimeDisplay()) {
4151 if (drawopt.IsNull()) {
4152 drawopt =
go4sett->getTGraphDrawOpt().toLatin1().constData();
4156 if ((
go4sett->getDrawLineWidth() > 1) && (gr->GetLineWidth()==1))
4157 gr->SetLineWidth(
go4sett->getDrawLineWidth());
4161 if ((
go4sett->getDrawFillColor() > 0) && (gr->GetFillColor() == 0))
4162 gr->SetFillColor(
go4sett->getDrawFillColor());
4163 if ((
go4sett->getDrawFillStyle() != 1001) && (gr->GetFillStyle() == 1001))
4164 gr->SetFillStyle(
go4sett->getDrawFillStyle());
4167 if (drawopt.IsNull())
4168 drawopt =
go4sett->getTGraphDrawOpt().toLatin1().constData();
4173 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4176 gr->Draw(drawopt.Data());
4179 framehisto = gr->GetHistogram();
4180 if (framehisto && ((framehisto->TestBit(TH1::kNoStats) == padopt->
IsHisStats()) || (framehisto->TestBit(TH1::kNoTitle) == padopt->
IsHisTitle()))) {
4182 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4183 gr->Draw(drawopt.Data());
4193 if (!pad || !padopt || !mg)
return;
4195 TIter iter(mg->GetListOfGraphs());
4196 TGraph *firstgr =
nullptr;
4198 while (
auto gr = (TGraph *) iter()) {
4200 gr->SetEditable(kFALSE);
4210 if (drawopt.IsNull())
4211 drawopt =
go4sett->getTGraphDrawOpt().toLatin1().constData();
4216 mg->Draw(drawopt.Data());
4220 TH1 *framehisto = (dosuperimpose && firstgr) ? firstgr->GetHistogram() : mg->GetHistogram();
4224 mg->Draw(drawopt.Data());
4225 framehisto = (dosuperimpose && firstgr) ? firstgr->GetHistogram() : mg->GetHistogram();
4229 TGo4Log::Error(
"Internal problem with MultiGraph drawing - cannot access frame histo");
4236 Double_t miny, maxy, selmin, selmax;
4239 if (maxy <= 0) maxy = 1.;
4240 if ((miny <= 0) || (miny >= maxy)) {
4242 if (miny > 1.) miny = 1.;
4245 maxy *= ((maxy>0) ? 1.1 : 0.9);
4246 miny *= ((miny>0) ? 0.9 : 1.1);
4248 framehisto->SetMaximum(maxy);
4249 framehisto->SetMinimum(miny);
4252 framehisto->SetStats(kFALSE);
4253 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4257 mg->SetTitle(firstgr->GetTitle());
4258 framehisto->SetTitle(firstgr->GetTitle());
4259 framehisto->GetXaxis()->SetTitle(firstgr->GetXaxis()->GetTitle());
4260 framehisto->GetYaxis()->SetTitle(firstgr->GetYaxis()->GetTitle());
4263 mg->Draw(drawopt.Data());
4267 TH2 *asihisto,
bool scancontent)
4269 if (!pad || !padopt || !im)
return;
4278 double uminx, umaxx, uminy, umaxy;
4283 im->SetPaletteEnabled(drawopt.Contains(
"Z"));
4290 if (!legslot)
return;
4293 if(legend) legend->Draw();
4298 if (!pad || !padslot)
return;
4303 TObject *selectedobj =
nullptr;
4304 const char *selectdrawopt =
nullptr;
4305 for (
int n = 0; n < padslot->
NumChilds(); n++) {
4318 if(obj->InheritsFrom(TF1::Class())){
4319 if(!pad->GetListOfPrimitives()->IsEmpty())
4320 drawopt.Append(
"LSAME");
4321 TF1 *func =
dynamic_cast<TF1 *
>(obj);
4322 Int_t objindx = padslot->
GetIndexOf(subslot);
4323 func->SetLineColor(
GetAutoColor(((objindx+7) % 9) + 1));
4326 if ((selname == obj->GetName()) && !selectedobj) {
4328 selectdrawopt = drawopt.Data();
4331 obj->Draw(drawopt.Data());
4339 selectedobj->Draw(selectdrawopt ? selectdrawopt :
"");
4364 int value,
const char *drawopt)
4368 if (!subopt)
return;
4385 subpad->SetFillColor(value);
4386 if (subpad->GetFrame())
4387 subpad->GetFrame()->SetFillColor(value);
4412 gStyle->SetPalette(value);
4438 if(backup) col=backup->GetFillColor();
4439 pad->SetFillColor((Color_t) col);
4441 TIter iter(pad->GetListOfPrimitives());
4442 while (
auto obj = iter()) {
4443 TPad *subpad =
dynamic_cast<TPad *
>(obj);
4444 TFrame *fram =
dynamic_cast<TFrame *
>(obj);
4446 TPad *backpad =
nullptr;
4448 backpad =
dynamic_cast<TPad *
>(backup->GetListOfPrimitives()->FindObject(subpad->GetName()));
4452 TFrame *backframe =
dynamic_cast<TFrame *
>(backup->GetListOfPrimitives()->FindObject(fram->GetName()));
4454 col = backframe->GetFillColor();
4457 fram->SetFillColor((Color_t)col);
4477 if (!padslot)
return;
4479 for (
int n = padslot->
NumChilds() - 1; n >= 0; n--) {
4492 if (!slot || !padopt)
4503 for (
int n = slot->
NumChilds() - 1; n >= 0; n--) {
4517 pad->GetListOfPrimitives()->Remove(subpad);
4521 if (
GetCanvas()->GetSelectedPad() == subpad)
4538 gStyle->SetOptStat(
go4sett->getOptStat());
4541 if (
go4sett->getOptStatW()>0) gStyle->SetStatW(
go4sett->getOptStatW()*0.01);
4542 if (
go4sett->getOptStatH()>0) gStyle->SetStatH(
go4sett->getOptStatH()*0.01);
4545 bool show_status =
go4sett->getPadEventStatus();
4547 int fiPadcolorR, fiPadcolorG, fiPadcolorB;
4548 go4sett->getCanvasColor(fiPadcolorR, fiPadcolorG, fiPadcolorB);
4549 int padfillcolor = TColor::GetColor(fiPadcolorR, fiPadcolorG, fiPadcolorB);
4551 if (padfillcolor != 0) {
4558 gVirtualX->GetPlanes(nplanes);
4561 TColor *normal = gROOT->GetColor(padfillcolor);
4564 normal->GetHLS(h,
l, s);
4565 const char *cname = normal->GetName();
4567 Float_t dr, dg, db, lr, lg, lb;
4568 TColor *dark = gROOT->GetColor(100 + padfillcolor);
4570 new TColor(100 + padfillcolor, -1, -1, -1, TString::Format(
"%s%s", cname,
"_dark").Data());
4571 dark = gROOT->GetColor(100 + padfillcolor);
4573 TColor *light = gROOT->GetColor(150 + padfillcolor);
4575 new TColor(150 + padfillcolor, -1, -1, -1, TString::Format(
"%s%s", cname,
"_bright").Data());
4576 light = gROOT->GetColor(150 + padfillcolor);
4580 TColor::HLStoRGB(h, 0.7 *
l, s, dr, dg, db);
4583 dark->SetRGB(dr, dg, db);
4585 dark->SetRGB(0.3, 0.3, 0.3);
4589 TColor::HLStoRGB(h, 1.2 *
l, s, lr, lg, lb);
4592 light->SetRGB(lr, lg, lb);
4594 light->SetRGB(0.8, 0.8, 0.8);
4597 TGo4Log::Error(
"Internal problem in view panel: Could not assign root shadow colors for number %d", padfillcolor);
4602 pad->SetFillColor(padfillcolor);
4606 if (show_status !=
fxQCanvas->isStatusBarVisible())
4625 TString output = pad->GetName();
4626 output.Append(
": ");
4630 output.Append(
" SuperImpose:");
4633 output.Append(
" All Pads:");
4634 output.Append(
" Ready");
4638 fxQCanvas->showStatusMessage(output.Data());
4641 printf(
"Implement display pad status in web canvas\n");
4658 if ((xaction == 0) && (yaction == 0) && (zaction == 0)) {
4667 while (iter.
next()) {
4670 if (!padopt)
continue;
4677 if ((xaction == 0) && (yaction == 0) && (zaction == 0)) {
4691 if (action <= 0)
return;
4693 double new_umin, new_umax, fmin, fmax, tmin, tmax;
4694 double fact = expandfactor / 100.;
4696 bool sel = padopt->
GetRange(naxis, new_umin, new_umax) && (action!=6);
4703 if (!sel || (new_umin >= new_umax)) { new_umin = fmin; new_umax = fmax; }
4705 double shift = (new_umax - new_umin) * fact;
4707 if (shift <= 0)
return;
4711 if ((new_umax + shift) > fmax)
4712 shift = fmax - new_umax;
4717 if (new_umin - shift < fmin)
4718 shift = new_umin - fmin;
4737 tmax = (-fact * new_umin + (1. - fact) * new_umax)
4739 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4742 tmax = (-fact * new_umin + new_umax) / (1. - fact);
4743 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4749 tmax = (-fact * new_umin + (1. - fact) * new_umax)
4751 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4754 tmax = (-fact * new_umin + new_umax) / (1. - fact);
4755 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4761 if (new_umin < fmin)
4763 if (new_umax > fmax)
4769 TH1 *padhist =
dynamic_cast<TH1 *
>(padobj);
4771 if (!padhist)
break;
4773 if (naxis >= ndim)
break;
4775 TAxis *axis = padhist->GetXaxis();
4776 if (naxis==1) axis = padhist->GetYaxis();
4777 if (naxis==2) axis = padhist->GetZaxis();
4780 Int_t sel_l = sel ? axis->GetFirst() : 0;
4781 Int_t sel_r = sel ? axis->GetLast() : axis->GetNbins();
4783 Int_t firstbin = 0, lastbin = 0;
4786 if ((ndim==1) && (naxis == 0)) {
4787 for (Int_t n1 = 1; n1<=padhist->GetNbinsX(); n1++) {
4788 Double_t v = padhist->GetBinContent(n1);
4789 if (TMath::Abs(v)<1e-10)
continue;
4790 if ((n1<sel_l) || (n1>sel_r))
continue;
4792 if (firstbin == 0) firstbin = n1;
4797 if ((ndim == 2) && (naxis < 2))
4798 for (Int_t n1 = 1; n1<=padhist->GetNbinsX(); n1++)
4799 for (Int_t n2 = 1; n2<=padhist->GetNbinsY(); n2++) {
4800 Double_t v = padhist->GetBinContent(n1,n2);
4801 if (TMath::Abs(v)<1e-10)
continue;
4802 Int_t bin = naxis == 0 ? n1 : n2;
4803 if ((bin<sel_l) || (bin>sel_r))
continue;
4804 if ((lastbin == 0) || (bin > lastbin)) lastbin = bin;
4805 if ((firstbin == 0) || (bin < firstbin)) firstbin = bin;
4809 if ((ndim == 3) && (naxis < 3))
4810 for (Int_t n1 = 1; n1<=padhist->GetNbinsX(); n1++)
4811 for (Int_t n2 = 1; n2<=padhist->GetNbinsY(); n2++)
4812 for (Int_t n3 = 1; n3<=padhist->GetNbinsZ(); n3++) {
4813 Double_t v = padhist->GetBinContent(n1,n2,n3);
4814 if (TMath::Abs(v)<1e-10)
continue;
4815 Int_t bin = naxis == 0 ? n1 : ((naxis==1) ? n2 : n3);
4816 if ((bin<sel_l) || (bin>sel_r))
continue;
4817 if ((lastbin == 0) || (bin > lastbin)) lastbin = bin;
4818 if ((firstbin == 0) || (bin < firstbin)) firstbin = bin;
4823 if (firstbin >= lastbin) { firstbin--; lastbin++; }
4825 if (firstbin<=3) firstbin = 1;
4826 if (lastbin >=axis->GetNbins()-3) lastbin = axis->GetNbins();
4828 Double_t left = axis->GetBinLowEdge(firstbin);
4829 Double_t right = axis->GetBinUpEdge(lastbin);
4831 Double_t margin = (right - left) * fact;
4832 left -= margin; right += margin;
4834 if ((left <= new_umin) && (right >= new_umax))
return;
4836 if (left > new_umin) new_umin = left;
4837 if (right < new_umax) new_umax = right;
4839 if (action==6) axis->SetRange(firstbin,lastbin);
4852 if (padopt->
GetRange(naxis, new_umin, new_umax))
4858 if (!h1 || !padopt)
return;
4860 TAxis *xax = h1->GetXaxis();
4861 TAxis *yax = h1->GetYaxis();
4862 TAxis *zax = h1->GetZaxis();
4863 int ndim = h1->GetDimension();
4868 xax->GetBinUpEdge(xax->GetNbins()));
4871 yax->GetBinUpEdge(yax->GetNbins()));
4877 zax->GetBinUpEdge(zax->GetNbins()));
4884 Int_t dimindx = (ndim == 1) ? 1 : 2;
4886 Double_t minimum = 0, maximum = 0;
4887 Bool_t first = kTRUE;
4888 if (!isfirsthisto) {
4893 for (Int_t biny = 1; biny <= yax->GetNbins(); biny++)
4894 for (Int_t binx = 1; binx <= xax->GetNbins(); binx++) {
4895 Int_t bin = h1->GetBin(binx, biny);
4896 Double_t value = h1->GetBinContent(bin);
4902 if (value < minimum)
4904 else if (value > maximum)
4913 if (!gr || !padopt)
return;
4915 Double_t minx = 0, maxx = 0, miny = 0, maxy = 0, xx, yy;
4917 if (gr->GetN() > 0) {
4918 gr->GetPoint(0, minx, miny);
4927 for (Int_t n = 0; n < gr->GetN(); n++) {
4928 gr->GetPoint(n, xx, yy);
4950 if (!h1 || !padopt || !pad)
return;
4956 double hmin = 0., hmax = 0., umin, umax;
4958 TAxis *ax = h1->GetXaxis();
4964 }
else if (padopt->
GetRange(0, umin, umax)) {
4969 Int_t i1 = ax->FindFixBin(umin);
4970 Int_t i2 = ax->FindFixBin(umax);
4971 if (i1 < i2) ax->SetRange(i1,i2);
4972 else { ax->UnZoom(); padopt->
ClearRange(0); }
4977 TAxis *ay = h1->GetYaxis();
4979 if (padopt->
GetRange(1, umin, umax)) {
4980 if (!autoscale && (ndim == 1)) {
4991 Int_t i1 = ay->FindFixBin(umin);
4992 Int_t i2 = ay->FindFixBin(umax);
4993 if (i1 < i2) { ay->SetRange(i1,i2); ay =
nullptr; }
5001 if ((ndim == 1) && (h1->GetMinimum() == 0) && (h1->GetMaximum() == 1)) {
5007 TAxis *az = h1->GetZaxis();
5009 if (padopt->
GetRange(2, umin, umax) && (ndim > 1)) {
5010 if (!autoscale && (ndim == 2)) {
5020 Int_t i1 = az->FindFixBin(umin);
5021 Int_t i2 = az->FindFixBin(umax);
5022 if (i1<i2) { az->SetRange(i1,i2); az =
nullptr; }
5035 if (hmax <= 0) hmax = 1.;
5036 if ((hmin <= 0) || (hmin >= hmax)) {
5038 if (hmin > 1.) hmin = 1;
5042 h1->SetMinimum(hmin);
5043 h1->SetMaximum(hmax);
5044 h1->SetBit(TH1::kIsZoomed);
5046 hs->SetMinimum(hmin);
5047 hs->SetMaximum(hmax);
5054 TIter next(hs->GetHists());
5055 while (
auto hs_h1 = (TH1 *) next()) {
5056 if (padopt->
GetRange(0, umin, umax)) {
5060 TAxis *ax = hs_h1->GetXaxis();
5061 Int_t i1 = ax->FindFixBin(umin);
5062 Int_t i2 = ax->FindFixBin(umax);
5063 if (i1<i2) { ax->SetRange(i1,i2); }
5064 else { ax->UnZoom(); padopt->
ClearRange(0); }
5066 hs_h1->GetXaxis()->UnZoom();
5069 hs_h1->GetYaxis()->UnZoom();
5070 hs_h1->SetMinimum();
5071 hs_h1->SetMaximum();
5081 h1->ResetBit(TH1::kIsZoomed);
5087 Double_t selmin = h1->GetMinimum();
5088 Double_t selmax = h1->GetMaximum();
5090 if (selmin >= selmax) {
5093 bool islogscale = (ndim == 1) && (padopt->
GetLogScale(1) > 0);
5096 if ((selmin > 0) && (selmax > 0)) {
5097 selmin = TMath::Log10(selmin) + TMath::Log10(0.5);
5098 selmin = TMath::Power(10, selmin);
5099 selmax = TMath::Log10(selmax)
5100 + TMath::Log10(2 * (0.9 / 0.95));
5101 selmax = TMath::Power(10, selmax);
5105 Double_t yMARGIN = gStyle->GetHistTopMargin();
5106 Double_t dymin = yMARGIN * (selmax - selmin);
5107 if ((selmin >= 0) && (selmin - dymin < 0))
5111 selmax += yMARGIN * (selmax - selmin);
5114 padopt->
SetRange(ndim, selmin, selmax);
5121 dynamic_cast<TPaveStats*
>(h1->GetListOfFunctions()->FindObject(
"stats"));
5123 stats =
new TPaveStats(
5124 gStyle->GetStatX()-gStyle->GetStatW(),
5125 gStyle->GetStatY()-gStyle->GetStatH(),
5127 gStyle->GetStatY(),
"brNDC");
5128 stats->SetParent(h1);
5129 stats->UseCurrentStyle();
5130 stats->SetName(
"stats");
5131 h1->GetListOfFunctions()->Add(stats);
5132 stats->ConvertNDCtoPad();
5139 dynamic_cast<TPaveText*
>(pad->GetListOfPrimitives()->FindObject(
"title"));
5142 titl =
new TPaveText(gStyle->GetTitleX()-gStyle->GetTitleW(),
5143 gStyle->GetTitleY()-gStyle->GetTitleH(),
5144 gStyle->GetTitleX(),
5145 gStyle->GetTitleY(),
"blNDC");
5146 titl->UseCurrentStyle();
5147 titl->SetFillColor(gStyle->GetTitleFillColor());
5148 titl->SetFillStyle(gStyle->GetTitleStyle());
5149 titl->SetName(
"title");
5150 titl->SetBorderSize(gStyle->GetTitleBorderSize());
5151 titl->SetTextColor(gStyle->GetTitleTextColor());
5152 titl->SetTextFont(gStyle->GetTitleFont(
""));
5153 if (gStyle->GetTitleFont(
"")%10 > 2)
5154 titl->SetTextSize(gStyle->GetTitleFontSize());
5155 titl->AddText(h1->GetTitle());
5156 titl->SetBit(kCanDelete);
5157 pad->GetListOfPrimitives()->Add(titl);
5158 titl->ConvertNDCtoPad();
5164 TAxis *xax = h1->GetXaxis();
5179 if (!padopt)
return false;
5183 if ((naxis < 0) || (naxis > NumDim))
return false;
5185 bool res = padopt->
GetRange(naxis, min, max);
5186 if (!res || (min >= max))
5192 double selmin,
double selmax,
bool force)
5194 if ((selmin == -1.) && (selmax == -1.))
return false;
5196 double min, max, umin, umax;
5199 padopt->
GetRange(naxis, umin, umax);
5201 if (!full || (min >= max) || (selmin >= selmax)) {
5206 double delta = (max - min) / 100000.;
5207 bool changed =
false;
5210 if (fabs(umin - selmin) > delta) {
5214 if (fabs(umax - selmax) > delta) {
5224 if ((selmin < min + delta) && (selmax > max - delta) && !force) {
5227 padopt->
SetRange(naxis, umin, umax);
5235 Double_t selmin, selmax;
5238 if (((ax->GetFirst() <= 0) && (ax->GetLast() >= ax->GetNbins() - 1))
5239 || (ax->GetFirst() >= ax->GetLast())) {
5243 selmin = ax->GetBinCenter(ax->GetFirst());
5244 selmax = ax->GetBinCenter(ax->GetLast());
5271 bool iszoomed = h1->TestBit(TH1::kIsZoomed);
5277 Double_t selmin = h1->GetMinimum();
5278 Double_t selmax = h1->GetMaximum();
5281 padopt->
SetRange(ndim, selmin, selmax);
5282 }
else if (selmin >= selmax) {
5286 bool islogscale = (ndim == 1) && (pad->GetLogy() > 0);
5289 if ((selmin > 0) && (selmax > 0)) {
5290 selmin = TMath::Log10(selmin) + TMath::Log10(0.5);
5291 selmin = TMath::Power(10, selmin);
5292 selmax = TMath::Log10(selmax)
5293 + TMath::Log10(2 * (0.9 / 0.95));
5294 selmax = TMath::Power(10, selmax);
5298 Double_t yMARGIN = gStyle->GetHistTopMargin();
5299 Double_t dymin = yMARGIN * (selmax - selmin);
5300 if ((selmin >= 0) && (selmin - dymin < 0))
5304 selmax += yMARGIN * (selmax - selmin);
5307 padopt->
SetRange(ndim, selmin, selmax);
5316 Double_t rxmin, rxmax, rymin, rymax;
5317 pad->GetRangeAxis(rxmin, rymin, rxmax, rymax);
5319 if (pad->GetLogx() > 0) {
5320 rxmin = TMath::Power(10., rxmin);
5321 rxmax = TMath::Power(10., rxmax);
5324 if (pad->GetLogy() > 0) {
5325 rymin = TMath::Power(10., rymin);
5326 rymax = TMath::Power(10., rymax);
5333 double rymin,
double rymax)
5340 if (!padopt)
return;
5349 double& xmax,
double& ymin,
double& ymax,
double& zmin,
double& zmax)
5353 if (!padopt)
return;
5367 QCheckBox* box1 = findChild<QCheckBox*>(
"ApplyToAllCheck");
5368 if (box1) box1->setChecked(on);
5375 bool modified =
false;
5376 bool applytoall =
false;
5377 bool redraw_immediately = !selpad;
5396 while (iter.
next()) {
5408 if (modified && redraw_immediately)
5413 double ymax,
double zmin,
double zmax)
5441 while (iter.
next()) {
5470 go4sett->storePanelSize(parentWidget(),
"ViewPanel");
5499 if (obj && !obj->InheritsFrom(THStack::Class()) && !obj->InheritsFrom(TMultiGraph::Class())) {
5577 for (
int n = 0; n < slot->
NumChilds(); n++) {
5596 basename =
"Marker";
5599 basename =
"Window";
5602 basename =
"Polygon";
5611 basename =
"Something";
5618 slotname = basename + QString::number(cnt++);
5619 }
while (padslot->
FindChild(slotname.toLatin1().constData()));
5632 for (
int n = 0; n < slot->
NumChilds(); n++) {
5635 if (drawkind != kind)
5638 if (subslot != activeslot)
5641 subslot->
SetPar(
"::ActiveMarker",
"1");
5650 if ((kind == selkind) && selobj)
5654 if (!slot)
return nullptr;
5656 TObject *lastobj =
nullptr;
5658 for (
int n = 0; n < slot->
NumChilds(); n++) {
5661 if (drawkind != kind)
5665 if (subslot->
GetPar(
"::ActiveMarker"))
5675 return !obj ? QString(
"null") : QString(obj->GetName());
5703 QString mycaption = windowTitle();
5704 QString oldtitle = mycaption.remove(
fPanelName +
": ");
5705 QString text = QInputDialog::getText(
this,
GetPanelName(),
5706 "Enter Viewpanel Title:", QLineEdit::Normal, oldtitle, &ok);
5707 if (ok && !text.isEmpty())
5718 QString text = QInputDialog::getText(
this,
GetPanelName(),
5719 "Enter Axis time format:", QLineEdit::Normal, oldfmt, &ok);
5720 if (ok && !text.isEmpty()) {
5731 bool s = act ? act->isChecked() :
false;
const char * NoStackDrawOption
This canvas uses Qt eventloop to handle user input.
void SelectedPadChanged(TPad *)
signal which will be emitted when root selected pad is changed via clicking the mid-mouse button (M.
void CanvasDropEvent(QDropEvent *, TPad *)
void PadDoubleClicked(TPad *, int, int)
signal emitted when user produce left mouse double-click on pad
void MenuCommandExecuted(TObject *, const char *)
void PadClicked(TPad *, int, int)
signal emitted when mouse clicks on pad
void CanvasDropEvent(QDropEvent *, TPad *)
void SelectedPadChanged(TPad *)
void PadDblClicked(TPad *, int, int)
void PadClicked(TPad *, int, int)
Special ASImage for display of 2d histograms in go4 viewpanel.
void SetDrawData(TH2 *histo, TGo4ViewPanel *panel, TPad *pad)
void SetSelectedRange(double rxmin, double rxmax, double rymin, double rymax)
void SetHistogramContent(TH2 *histo)
TGo4Slot * BrowserSlot(const char *item=nullptr)
TObject * GetBrowserObject(const char *name, Int_t update=0)
Int_t ItemCanDo(const char *name)
Bool_t DefineRelatedObject(const char *itemname, const char *objectname, TString &objectitem, Int_t mask=3)
static bool CanDrawItem(int cando)
TClass * ItemClass(const char *name)
Int_t GetNumber() const
Returns number of conditions in array.
TGo4Condition * At(Int_t i) const
Returns condition object i from object array.
virtual void SetYMeanDraw(Bool_t on)
virtual Bool_t IsXMaxDraw() const
TH1 * GetWorkHistogram() const
access work histogram reference
Int_t GetDimension() const
virtual Bool_t IsXMeanDraw() const
virtual void SetYRMSDraw(Bool_t on)
void Draw(Option_t *opt="") override
Draw this condition on current pad.
virtual Int_t IsChanged() const
virtual void SetYMaxDraw(Bool_t on)
virtual Bool_t IsXRMSDraw() const
virtual void SetChanged(Bool_t on=kTRUE)
virtual void SetWorkHistogram(TH1 *histo)
Set reference to work histogram for statistics functions.
Bool_t next(Bool_t goesinto=kTRUE)
TGo4Slot * getslot() const
static void Error(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 3.
Extended graphical marker class for go4 condition editor and viewpanel.
const char * GetName() const override
TMarker is not TNamed, so we implement name ourself.
void SetHistogram(TH1 *histo)
static Int_t GetInstances()
TH1 * GetHistogram() const
void Draw(Option_t *opt="") override
Draw this marker on current pad.
void panelSignal(TGo4ViewPanel *, TPad *, int)
void SetSelectedPad(TPad *pad)
static TGo4MdiArea * Instance()
Picture cconfiguration in Go4.
Int_t GetNumObjNames() const
Bool_t GetStatsAttr(TPaveStats *stats) const
Bool_t IsXYRatioOne() const
TList * GetSpecialObjects() const
Bool_t IsTitleDate() const
void SetHisStats(Bool_t on)
void SetLogScale(Int_t nscale=0, Int_t zn=1)
void SetRebinY(Int_t ngroupy, Int_t index=UndefIndex)
void SetSuperimpose(bool on)
void ClearRange(Int_t naxis=-1)
Int_t GetRebinX(Int_t index=UndefIndex) const
void CopyOptionsFrom(TGo4Picture *source)
Bool_t IsHisStats() const
void SetRebinX(Int_t ngroupx, Int_t index=UndefIndex)
Int_t GetLogScale(Int_t nscale=0) const
void SetRange(Int_t naxis, Double_t min, Double_t max)
void SetXAxisTimeDisplay(Bool_t on)
void SetXAxisTimeFormat(const char *format)
Option_t * GetDrawOption() const override
void SetPadModified(bool on=true)
void SetApplyToAll(bool on)
void AddObjName(const char *name, Option_t *DrawOption=nullptr)
void GetDrawAttributes(TObject *obj, Int_t index=UndefIndex) const
const char * GetObjName(Int_t n) const
TGo4Picture * FindPic(Int_t posy, Int_t posx)
void SetTitleAttr(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t textsize=0.)
Bool_t GetFullRange(Int_t naxis, Double_t &min, Double_t &max) const
Bool_t GetRangeY(Double_t &min, Double_t &max) const
void SetXAxisAttTime(Bool_t timedisplay, const char *format, Int_t index=UndefIndex)
Int_t GetFullRangeDim() const
void SetDrawAttributes(TObject *obj, Int_t index=UndefIndex)
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")
void SetContentModified(bool on=true)
void SetDrawOption(Option_t *option="") override
bool IsPadModified() const
Int_t GetHisContour() const
void SetTitleItem(Bool_t on=kTRUE)
Bool_t IsHisTitle() const
void ClearFullRange(Int_t naxis=-1)
Bool_t IsXAxisTimeDisplay() const
void ChangeDrawOption(Int_t kind, Int_t value)
bool IsLegendDraw() const
bool IsSuperimpose() const
void SetFrameAttr(Double_t left, Double_t top, Double_t right, Double_t bottom)
void SetAutoZoom(bool on)
Int_t GetRebinY(Int_t index=UndefIndex) const
Bool_t GetFrameAttr(TPad *pad) const
void AddSpecialObject(TObject *obj, Option_t *drawopt=nullptr)
void SetTitleTime(Bool_t on=kTRUE)
const char * GetXAxisTimeFormat() const
void SetTitleDate(Bool_t on=kTRUE)
TGo4Picture * Pic(Int_t posy, Int_t posx)
void SetFullRange(Int_t naxis, Double_t min, Double_t max)
Bool_t GetTitleAttr(TPaveText *title) const
Bool_t GetRange(Int_t naxis, Double_t &min, Double_t &max) const
void SetAutoScale(bool on)
bool IsContentModified() const
void SetDivision(Int_t ndivy, Int_t ndivx)
bool IsApplyToAll() const
Bool_t IsTitleItem() const
Bool_t IsTitleTime() const
void SetFullRangeDim(Int_t ndim)
static TString NextAvailableName()
void SetValuesDirect(TCutG *newcut)
Delete old cut and get ownership over newcut.
void SetWorkHistogram(TH1 *histo) override
Set reference to work histogram for statistics functions.
TCutG * GetCut(Bool_t changeowner) override
Used to return the cut pointer of a TGo4PolyCond.
TGo4Slot * GetParent() const
Bool_t GetIntPar(const char *name, Int_t &value) const
TGo4Proxy * GetProxy() const
void SetProxy(TGo4Proxy *cont)
TGo4Slot * FindChild(const char *name) const
void SetPar(const char *name, const char *value)
void RemovePar(const char *name)
void SetIntPar(const char *name, Int_t value)
TObject * GetAssignedObject()
const char * GetPar(const char *name) const
Bool_t ShiftSlotAfter(TGo4Slot *slot, TGo4Slot *after)
TGo4Slot * GetChild(Int_t n) const
Int_t GetIndexOf(const TGo4Slot *child) const
virtual void RedrawPanel(TPad *pad, bool force)
virtual void ProducePadsList(TObjArray *arr, TPad *toppad)
virtual void ShootRepaintTimer()
virtual void ProduceGraphFromMarkers()
virtual void SetPanelName(const char *newname)
virtual void SaveMarkers()
virtual void DisplayPadStatus(TPad *pad)
virtual TObject * GetDrawObject(TPad *pad, const char *name)
virtual void CleanupGedEditor()
virtual void Divide(int numX, int numY)
virtual const char * GetDrawObjectLinkName(TPad *pad, TObject *obj)
virtual TObject * GetPadMainObject(TPad *pad)
virtual void CollectSpecialObjects(TPad *pad, TObjArray *objs, int selectkind)
virtual void SetPadDefaults(TPad *pad)
virtual void panelSlot(TGo4ViewPanel *panel, TPad *pad, int signalid)
virtual void ClearAllMarkers()
virtual void PrintCanvas()
virtual void SetFreezeMouseMode(bool on)
virtual void DefaultPadMargin(TPad *pad)
virtual void SetSelectedMarkerByMouseClick(TPad *pad, const char *name)
virtual bool CompleteMarkerEdit(TPad *pad)
virtual bool ScanDrawOptions(TPad *pad, TGo4Slot *padslot, TGo4Picture *pic, bool onlyscan)
virtual void SetSelectedRange(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
virtual void SetActiveObj(TPad *pad, int kind, TGo4Slot *activeslot)
virtual void ProcessCanvasAdopt(TPad *tgtpad, TPad *srcpad, const char *srcitemname)
virtual int GetMouseMode()
virtual void ClearPadItems(TGo4Slot *padslot, TGo4Slot *remain)
virtual void CanvasUpdatedSlot()
virtual void SaveCanvas()
virtual void RedrawHistogram(TPad *pad, TGo4Picture *padopt, TH1 *his, bool scancontent, bool first_draw)
virtual void ClosePanel()
virtual void CheckObjectsAssigments(TPad *pad, TGo4Slot *padslot)
virtual int GetNumMarkers(TPad *pad, int kind)
virtual TObject * GetActiveObj(TPad *pad, int kind)
virtual void SetSlotPad(TGo4Slot *padslot, TPad *pad)
virtual void MarkPadModified(TPad *pad)
virtual void SetSelectedMarker(TPad *pad, const QString &selname, int selindex)
virtual void ClearActivePad()
virtual void ProcessMarkersClear(TPad *pad, bool withsubpads)
virtual void ChangeDrawOptionForPad(TGo4Slot *padslot, int kind, int value, const char *drawopt)
virtual QString GetSelectedMarkerName(TPad *pad)
virtual void CollectMainDrawObjects(TGo4Slot *slot, TObjArray *objs, TObjArray *objslots, int modifier)
virtual void RectangularRatio(TPad *pad)
virtual void SetLateXMode(bool on)
virtual int GetSelectedMarkerIndex(TPad *pad)
virtual TGo4Slot * GetSuperimposeSlot(TGo4Slot *slot)
virtual void ClearCanvas()
void linkedUpdated(TGo4Slot *slot, TObject *obj) override
virtual void CheckActionAtTheEnd(TPad *pad)
virtual void ShowEventStatus(bool)
virtual bool IsRepaintTimerActive()
bool fbLeaveFocusAfterCondEnd
virtual void ProcessPictureRedraw(const char *picitemname, TPad *pad, TGo4Picture *pic)
QWebCanvas * fxWCanvas
web canvas
virtual void StartConditionEditing(TPad *pad)
virtual bool GetVisibleRange(TPad *pad, int naxis, double &min, double &max)
virtual TObject * ProduceSuperimposeObject(TGo4Slot *padslot, TGo4Picture *padopt, TGo4Slot *sislot, TGo4Slot *legslot, TObjArray *objs, TObjArray *objslots, bool showitems)
virtual void TakeFullRangeFromGraph(TGraph *gr, TGo4Picture *padopt, bool isfirst)
virtual void AddMarkerObj(TPad *pad, int kind, TObject *obj)
virtual int GetSelectedObjectIndex(TGo4Slot *slot)
virtual void DeleteDrawObject(TPad *pad, const char *name)
virtual void LoadMarkers()
virtual void CheckForSpecialObjects(TPad *pad, TGo4Slot *padslot)
virtual void RedrawSpecialObjects(TPad *pad, TGo4Slot *padslot)
virtual void GetConditionBtn_clicked()
virtual void AutoScaleToggled(bool)
void ResetWidget() override
virtual void SetPadSuperImpose(TPad *pad, bool on)
virtual void RedrawImage(TPad *pad, TGo4Picture *padopt, TGo4ASImage *im, TH2 *asihisto, bool scancontent)
virtual void InfoConditionBtn_clicked()
virtual void SetRegionMode(bool on)
virtual void CanvasDropEventSlot(QDropEvent *event, TPad *pad)
virtual void PadClickedSlot(TPad *pad, int evx=-1, int evy=-1)
virtual bool IsPadHasSubPads(TGo4Slot *padslot)
virtual void BlockPanelRedraw(bool on)
virtual bool ProcessPadRedraw(TPad *pad, bool force)
virtual bool DeleteDrawObjects(TPad *pad, int kindtodelete)
virtual void MakePictureForPad(TGo4Picture *pic, TPad *pad, bool useitemname)
virtual void SetSelectedRangeToHisto(TPad *pad, TH1 *h1, THStack *hs0, TGo4Picture *padopt, bool ishisto)
virtual void ChangeDrawOption(int kind, int value, const char *drawopt)
virtual void ResizeGedEditor()
virtual void PadDeleted(TPad *pad)
virtual void checkRepaintSlot()
void linkedObjectUpdated(const char *linkname, TObject *obj) override
QAction * fxCanvasEventstatusChk
virtual void ProcessPadStatusUpdate(TPad *pad, TGo4Slot *parent, bool removeitems)
virtual void ApplyToAllToggled(bool)
virtual void SetApplyToAllFlag(bool on)
virtual bool IsRedrawBlocked()
virtual void StartRootEditor(bool)
virtual void ClearPad(TPad *pad, bool removeitems, bool removesubpads)
virtual void checkResizeSlot()
virtual TGo4Slot * GetPanelSlot()
virtual void DelSelectedMarker_clicked()
TH1 * Get_fHistogram(TObject *obj, bool force=false)
virtual void UpdatePanelCaption()
virtual void TakeFullRangeFromHisto(TH1 *h1, TGo4Picture *padopt, bool isfirsthisto)
virtual TGo4Slot * GetPadSlot(TPad *pad)
QStatusBar * CanvasStatus
QRootCanvas * fxQCanvas
qtroot canvas
virtual void RedrawStack(TPad *pad, TGo4Picture *padopt, THStack *hs, bool dosuperimpose, bool scancontent)
virtual void AllocatePadOptions(TPad *pad)
virtual TGo4Slot * GetPadMainObjectSlot(TPad *pad)
bool IsAcceptDrag(const char *itemname, TClass *cl, int kind) override
virtual void SetFreezedTitle(const QString &title)
virtual bool IsFreezeTitle()
virtual TPad * FindPadWithItem(const char *itemname)
virtual void ProcessPadDoubleClick()
QAction * fxCanvasEditorChk
virtual void MenuCommandExecutedSlot(TObject *obj, const char *cmdname)
virtual void SetSelectedObjectIndex(TGo4Slot *slot, int indx)
virtual TGo4Picture * GetPadOptions(TPad *pad)
virtual QString GetActiveObjName(TPad *pad, int kind)
virtual TObject * GetSelectedObject(TPad *pad, const char **drawopt)
virtual TPad * GetActivePad()
void resizeEvent(QResizeEvent *e) override
virtual void ScanObjectsDrawOptions(bool onlyscan, TGo4Slot *padslot, TObjArray *objs, TObjArray *objslots)
virtual void SetDrawingMode(bool on)
virtual void CompleteInitialization()
virtual void SetAutoZoomFlag(bool on)
virtual int GetAutoColor(int indx)
virtual const char * GetPanelName()
virtual void SetConditionBtn_clicked()
virtual void SetCursorMode(bool on)
virtual bool IsAutoZoomFlag()
TGo4ViewPanel(QWidget *parent=nullptr, const char *name=nullptr)
QSignalMapper * fOptionsMap
virtual void SelectMenuItemActivated(int)
virtual void LogMarkerValues()
QCheckBox * fAutoScaleCheck
virtual bool TakeSelectedAxisRange(int naxis, TGo4Picture *padopt, double selmin, double selmax, bool force)
virtual void SuperImposeToggled(bool)
TPad * fxDoubleClickTimerPad
virtual void SetDrawKind(TGo4Slot *slot, int kind)
virtual void RedrawGraph(TPad *pad, TGo4Picture *padopt, TGraph *gr, bool scancontent, bool first_draw)
virtual void ProcessPadModifiedSignal()
virtual void DropOnPad(TPad *pad, const char *itemname, TClass *cl, int kind)
virtual void AboutToShowOptionsMenu()
virtual TPad * GetSlotPad(TGo4Slot *slot)
virtual TGo4Slot * GetDrawObjectSlot(TPad *pad, const char *name)
virtual void UndrawItemOnPanel(const char *itemname)
virtual void UpdatePadStatus(TPad *pad, bool removeitems)
virtual void SetMouseMode(int mode)
virtual void SelectedMarkerCmb_activated(int indx)
virtual bool ShiftSelectedObjectToEnd(TPad *pad)
virtual void GetSelectedRange(int &ndim, bool &autoscale, double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax)
virtual void EditConditionBtn_clicked()
virtual TH1 * GetPadHistogram(TPad *pad)
QSignalMapper * fSelectMap
virtual void RefreshButtons()
virtual void ProcessPadClear(TPad *pad, bool removeitems, bool removesubpads)
virtual const char * GetSpecialDrawOption(TGo4Slot *slot)
virtual TGo4Slot * AddNewSlot(const char *name, TGo4Slot *parent)
virtual void PadDoubleClickedSlot(TPad *pad, int evx=-1, int evy=-1)
void linkedRemoved(TGo4Slot *slot, TObject *obj) override
virtual void ResetPadFillColors(TPad *pad, int col, TPad *backup=nullptr)
virtual bool IsWebCanvas() const
virtual void PadRangeAxisChanged(TPad *pad)
virtual void SetActivePad(TPad *pad)
virtual TCanvas * GetCanvas()
virtual int GetDrawKind(TGo4Slot *slot)
virtual void RedrawMultiGraph(TPad *pad, TGo4Picture *padopt, TMultiGraph *mg, bool dosuperimpose, bool scancontent)
virtual void MoveScale(int expandfactor, int xaction, int yaction, int zaction)
virtual void SetAutoScale(bool on, TPad *selpad)
virtual void SetMarkerPanel(bool)
virtual int GetNumberOfPads(TPad *toppad)
virtual const char * GetDrawItemName(int itemcnt=0)
virtual TPad * GetSubPad(TPad *toppad, int num, bool onlytoplevel)
virtual bool IsPanelPad(TPad *pad)
virtual void SetPolygonMode(bool on)
virtual bool IsConditionSelected(TPad *pad)
bool fbModifiedSignalFlag
virtual bool IsApplyToAllFlag()
virtual void OptionsMenuItemActivated(int)
virtual void StartConditionEditor()
virtual void RedrawLegend(TPad *pad, TGo4Picture *padopt, TGo4Slot *legslot)
virtual TGo4Slot * AddDrawObject(TPad *pad, int kind, const char *itemname, TObject *obj, bool owner, const char *drawopt)
virtual void ProducePicture()
virtual void MoveSingleScale(int expandfactor, int action, int naxis, TGo4Picture *opt, TObject *padhist)
void CanvasUpdate(bool modify=false)
virtual void ActivateInGedEditor(TObject *obj)
virtual TGo4Slot * GetSelectedSlot(TPad *pad, int *selkind, TObject **selobj)
virtual void SwitchMarkerButton(int kind, bool on)
virtual void SetSpecialDrawOption(TGo4Slot *slot, const char *drawopt)
void SetValues(Double_t low1, Double_t up1) override
Set limits and internal dimension to 1.
Double_t GetXLow() const override
Double_t GetYLow() const override
TPadGuard(TVirtualPad *repl=nullptr)