25 #include "TVirtualX.h"
28 #include "TMultiGraph.h"
37 #include "TPaveStats.h"
38 #include "TPaveLabel.h"
45 #include "TCanvasImp.h"
50 #include <QFileDialog>
52 #include <QInputDialog>
54 #include <QtCore/QSignalMapper>
74 #include "TGo4LockGuard.h"
111 QObject::connect(CursorB, SIGNAL(toggled(
bool)),
this, SLOT(
SetCursorMode(
bool)));
112 QObject::connect(RegionB, SIGNAL(toggled(
bool)),
this, SLOT(
SetRegionMode(
bool)));
113 QObject::connect(FreezeMode, SIGNAL(toggled(
bool)),
this, SLOT(
SetFreezeMouseMode(
bool)));
114 QObject::connect(LatexB, SIGNAL(toggled(
bool)),
this, SLOT(
SetLateXMode(
bool)));
115 QObject::connect(DrawB, SIGNAL(toggled(
bool)),
this, SLOT(
SetDrawingMode(
bool)));
116 QObject::connect(PrintLogB, SIGNAL(pressed()),
this, SLOT(
LogMarkerValues()));
117 QObject::connect(PolyB, SIGNAL(toggled(
bool)),
this, SLOT(
SetPolygonMode(
bool)));
126 setAttribute(Qt::WA_DeleteOnClose);
149 MarkerPanel->setVisible(
false);
156 QSizePolicy sizePolicy3(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(7));
157 sizePolicy3.setHorizontalStretch(0);
158 sizePolicy3.setVerticalStretch(20);
169 fxWCanvas->setMinimumSize(QSize(50, 50));
170 sizePolicy3.setHeightForWidth(
fxWCanvas->sizePolicy().hasHeightForWidth());
173 fxGridLayout->addWidget(
fxWCanvas, 1, 1, 1, 1);
184 fxQCanvas->setMinimumSize(QSize(50, 50));
185 sizePolicy3.setHeightForWidth(
fxQCanvas->sizePolicy().hasHeightForWidth());
188 fxGridLayout->addWidget(
fxQCanvas, 1, 1, 1, 1);
206 QMenu* fileMenu =
fMenuBar->addMenu(
"F&ile");
207 fileMenu->addAction(
"&Save as...",
this, SLOT(
SaveCanvas()));
208 fileMenu->addAction(
"Print...",
this, SLOT(
PrintCanvas()));
209 fileMenu->addAction(
"Produce &Picture",
this, SLOT(
ProducePicture()));
210 fileMenu->addAction(
"Produce &Graph from markers",
this,
216 fileMenu->addAction(
"Cl&ose",
this, SLOT(
ClosePanel()));
219 QMenu* editMenu =
fMenuBar->addMenu(
"&Edit");
224 bool ed_visible =
false, ed_allowed =
true;
241 editMenu->addAction(
"Start &condition editor",
this,
244 editMenu->addSeparator();
247 editMenu->addAction(
"Clear c&anvas",
this, SLOT(
ClearCanvas()));
250 connect(
fSelectMap, SIGNAL(mapped(
int)),
this,
281 QCheckBox* box1 =
new QCheckBox(
"Apply to all", MenuFrame);
282 box1->setObjectName(
"ApplyToAllCheck");
289 QHBoxLayout* menugrid =
new QHBoxLayout(0);
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);
305 connect(
fxWCanvas, SIGNAL(CanvasDropEvent(QDropEvent*,TPad*)),
this,
308 connect(
fxWCanvas, SIGNAL(SelectedPadChanged(TPad*)),
this,
311 connect(
fxWCanvas, SIGNAL(PadClicked(TPad*,
int,
int)),
this,
314 connect(
fxWCanvas, SIGNAL(PadDblClicked(TPad*,
int,
int)),
this,
317 connect(
fxWCanvas, SIGNAL(CanvasUpdated()),
this,
329 connect(
fxQCanvas, SIGNAL(CanvasDropEvent(QDropEvent*,TPad*)),
this,
331 connect(
fxQCanvas, SIGNAL(SelectedPadChanged(TPad*)),
this,
333 connect(
fxQCanvas, SIGNAL(PadClicked(TPad*)),
this,
335 connect(
fxQCanvas, SIGNAL(PadDoubleClicked(TPad*)),
this,
337 connect(
fxQCanvas, SIGNAL(MenuCommandExecuted(TObject*,
const char*)),
339 connect(
fxQCanvas, SIGNAL(CanvasLeaveEvent()),
this,
341 connect(
fxQCanvas, SIGNAL(CanvasUpdated()),
this,
369 if (gROOT->GetSelectedPad() != 0)
370 if (
IsPanelPad((TPad*) gROOT->GetSelectedPad()))
371 gROOT->SetSelectedPad(0);
394 return new TGo4Slot(parent, name,
"title");
407 if (strcmp(linkname,
"PadRangeAxisChanged") == 0) {
409 }
else if (strcmp(linkname,
"PadModified") == 0) {
458 TPad* pad = (TPad*) obj;
487 || cl->InheritsFrom(TGo4Condition::Class());
495 if (cl->InheritsFrom(TGo4Fitter::Class())) {
502 && !cl->InheritsFrom(TGo4Condition::Class()))
553 parentWidget()->close();
570 if (padslot == 0)
return QString();
571 return QString(padslot->
GetPar(
"::SelMarker"));
577 if (padslot == 0)
return -1;
579 if (!padslot->
GetIntPar(
"::SelIndex", selindex))
return -1;
586 if (selobj != 0) *selobj = 0;
592 if ((padslot == 0) || (selname.length() == 0))
return 0;
594 for (
int n = 0; n < padslot->
NumChilds(); n++) {
599 if ((drawkind ==
kind_Link) && (obj != 0)) {
600 if (obj->InheritsFrom(TGo4Condition::Class()))
608 if ((obj == 0) || (selname != obj->GetName()))
613 if (obj->InheritsFrom(TGo4CondArray::Class())) {
616 if ((selindex >= 0) && (selindex < arr->
GetNumber()))
617 selcond = arr->
At(selindex);
622 if (selcond->InheritsFrom(TGo4WinCond::Class()))
624 else if (selcond->InheritsFrom(TGo4PolyCond::Class()))
650 while (iter.
next()) {
656 if (strcmp(linkname, itemname) == 0)
668 while (iter.
next()) {
674 if (cnt++ == itemcnt)
return linkname;
690 while (iter.
next()) {
695 if ((linkname != 0) && (strcmp(linkname, itemname) == 0)) {
696 delslots.Add(subslot);
704 if (delslots.GetLast() >= 0) {
719 if (selname.length() == 0)
729 if (selname.length() > 0)
730 padslot->
SetPar(
"::SelMarker", selname.toLatin1().constData());
735 padslot->
SetIntPar(
"::SelIndex", selindex);
740 TObject* newselobj = 0;
743 if ((selindex >= 0) && (newselslot != 0)) {
744 QString drawopt(
"sel=");
745 drawopt += QString::number(selindex);
749 if (((oldselindex != selindex) || (oldselname != selname))
750 && ((oldselindex >= 0) || (selindex >= 0))) {
753 }
else if (newselobj != 0) {
768 if (padslot == 0)
return;
772 for (
int n = 0; n < padslot->
NumChilds(); n++) {
778 if ((obj != 0) && (strcmp(obj->GetName(), name) == 0)) {
788 if (cond==0)
continue;
790 if (strcmp(cond->GetName(), name) == 0) {
793 if (cond->InheritsFrom(TGo4PolyCond::Class()))
807 for (
int ncon = 0; ncon < arr->
GetNumber(); ncon++)
808 if (strcmp(arr->
At(ncon)->GetName(), name) == 0) {
810 if (arr->
At(ncon)->InheritsFrom(TGo4PolyCond::Class()))
834 FreezeMode->setChecked(
false);
835 RegionB->setChecked(
true);
838 FreezeMode->setChecked(
false);
839 PolyB->setChecked(
true);
881 if (selectedkind != kind)
937 GetConditionBtn->setVisible(iscondition);
938 InfoConditionBtn->setVisible(iscondition);
939 EditConditionBtn->setVisible(iscondition);
940 SetConditionBtn->setVisible(iscondition);
945 ModifyConditionBtn->setVisible((cond != 0) && (cond->
IsChanged() != 0));
947 QString iconname =
":/icons/right.png";
948 QString tooltip =
"Refresh condition from analysis";
950 iconname =
":/icons/refresh.png";
951 tooltip =
"Refresh condition from source";
953 GetConditionBtn->setIcon(QIcon(iconname));
954 GetConditionBtn->setToolTip(tooltip);
957 ModifyConditionBtn->setVisible(
false);
961 CursorB->setChecked(
false);
962 RegionB->setChecked(
false);
963 LatexB->setChecked(
false);
964 DrawB->setChecked(
false);
965 PolyB->setChecked(
false);
968 CursorB->setChecked(
true);
969 RegionB->setChecked(
false);
970 LatexB->setChecked(
false);
971 DrawB->setChecked(
false);
972 PolyB->setChecked(
false);
975 CursorB->setChecked(
false);
976 RegionB->setChecked(
true);
977 LatexB->setChecked(
false);
978 DrawB->setChecked(
false);
979 PolyB->setChecked(
false);
982 CursorB->setChecked(
false);
983 RegionB->setChecked(
false);
984 LatexB->setChecked(
false);
985 DrawB->setChecked(
false);
986 PolyB->setChecked(
true);
989 CursorB->setChecked(
false);
990 RegionB->setChecked(
false);
991 LatexB->setChecked(
true);
992 DrawB->setChecked(
false);
993 PolyB->setChecked(
false);
996 CursorB->setChecked(
false);
997 RegionB->setChecked(
false);
998 LatexB->setChecked(
false);
999 DrawB->setChecked(
true);
1000 PolyB->setChecked(
false);
1003 CursorB->setChecked(
false);
1004 RegionB->setChecked(
false);
1005 LatexB->setChecked(
false);
1006 DrawB->setChecked(
false);
1007 PolyB->setChecked(
false);
1012 SelectedMarkerCmb->clear();
1013 SelectedMarkerCmb->addItem(
"new");
1022 for (
int n = 0; n < slot->
NumChilds(); n++) {
1031 if (obj->InheritsFrom(TGo4CondArray::Class())) {
1033 for (
int ncon = 0; ncon < arr->
GetNumber(); ncon++) {
1035 QString fullname(arr->GetName());
1037 fullname += QString::number(ncon);
1038 SelectedMarkerCmb->addItem(fullname);
1040 if ((selname == obj->GetName()) && (selindex == ncon))
1041 findindx = SelectedMarkerCmb->count() - 1;
1044 SelectedMarkerCmb->addItem(obj->GetName());
1045 if (selname == obj->GetName())
1046 findindx = SelectedMarkerCmb->count() - 1;
1056 SelectedMarkerCmb->setCurrentIndex(findindx);
1057 DelSelectedMarker->setEnabled((findindx > 0) );
1060 MarkerPanel->ensurePolished();
1061 MarkerPanel->update();
1062 MarkerPanel->show();
1074 QString selname = SelectedMarkerCmb->itemText(indx);
1076 int p = selname.indexOf(
"/Sub");
1078 selindex = selname.mid(p + 4).toInt();
1079 selname.truncate(p);
1088 if ((slot != 0) && (drawkind > 0)) {
1099 if (slot == 0)
return;
1112 gROOT->SetEditorMode(
"");
1128 for (
int n = 0; n < slot->
NumChilds(); n++) {
1142 obj->Print(
"go4log");
1147 obj->Print(
"go4log-limits-stats");
1168 if (pad == 0)
return;
1175 if (!withsubpads)
return;
1178 if (slot == 0)
return;
1181 while (iter.
next()) {
1226 if (itemname != 0) {
1236 QFileDialog fd(
this,
"Save Markers of active pad into", QString(),
1237 "ROOT file (*.root)");
1238 fd.setFileMode(QFileDialog::AnyFile);
1239 fd.setAcceptMode(QFileDialog::AcceptSave);
1240 if (fd.exec() == QDialog::Accepted) {
1241 QStringList flst = fd.selectedFiles();
1245 QString filename = flst[0];
1246 if (!filename.endsWith(
".root"))
1247 filename.append(
".root");
1254 QFileDialog fd(
this,
"Load Marker setup from:", QString(),
1255 "ROOT file (*.root)");
1256 fd.setFileMode(QFileDialog::ExistingFile);
1257 if (fd.exec() == QDialog::Accepted) {
1258 QStringList flst = fd.selectedFiles();
1261 QString filename = flst[0];
1311 if ((px<0) || (py<0)) {
1312 px = pad->GetEventX();
1313 py = pad->GetEventY();
1317 Double_t x = pad->PadtoX(pad->AbsPixeltoX(px));
1318 Double_t y = pad->PadtoY(pad->AbsPixeltoY(py));
1321 bool docheck =
false;
1322 bool iscreated =
false;
1326 TObject *obj =
GetCanvas()->GetSelected();
1328 if (obj->InheritsFrom(TGo4Marker::Class())
1329 || obj->InheritsFrom(TGo4WinCondView::Class())
1330 || obj->InheritsFrom(TGo4PolyCondView::Class()))
1338 gROOT->SetEditorMode(
"");
1345 mark->SetMarkerColor((ix) % 6 + 2);
1365 gROOT->SetEditorMode(
"");
1367 Double_t xmin(x), xmax(x), ymin(y), ymax(y);
1372 bool fbTwoDimRegion = (hist != 0) && (hist->GetDimension() > 1);
1374 QString name =
"Region " + QString::number(ix + 1);
1375 conny =
new TGo4WinCond(name.toLatin1().constData());
1383 conny->SetFillStyle(3002);
1392 if(conny==0)
return;
1397 if(conny==0)
return;
1404 std::cout <<
"TGo4ViewPanel:PadClickedSlot() NEVER COME HERE" << std::endl;
1409 conny->
SetValues(xmin, xmax, ymin, ymax);
1433 gROOT->SetEditorMode(
"");
1442 QString name =
"Polygon " + QString::number(ix + 1);
1453 TCutG* cut = cond->
GetCut(kTRUE);
1466 TCutG* cut = cond->
GetCut(kFALSE);
1470 cut->SetPoint(0, x, y);
1471 cut->SetPoint(1, x, y);
1484 cond->SetFillStyle(3002);
1506 gROOT->SetEditorMode(
"");
1509 QString name = QString(
"Label ") + QString::number(ix + 1);
1511 QString txt = QInputDialog::getText(
this,
1512 "Enter new LaTeX label text:", name, QLineEdit::Normal,
1514 if (ok && (txt.length() > 0)) {
1515 TLatex* latex =
new TLatex(x, y, name.toLatin1().constData());
1516 latex->SetName(name.toLatin1().constData());
1517 latex->SetTitle(txt.toLatin1().constData());
1545 gROOT->SetEditorMode(
"");
1548 TArrow* arrow =
new TArrow(x, y, x, y, 0.02);
1561 std::cout <<
"TGo4ViewPanel:MouseClick() NEVER COME HERE" << std::endl;
1619 bool needredraw =
false;
1620 bool needupdate =
false;
1621 bool needrefresh =
true;
1622 bool docheck =
false;
1647 bool delcond =
true;
1648 TCutG* cut = cond->
GetCut(kFALSE);
1650 int n = cut->GetN();
1652 cut->GetPoint(0, x, y);
1656 cut->SetPoint(n, x, y);
1661 cond->SetFillStyle(3002);
1664 if (delcond && candelete) {
1755 Long_t offset =obj->IsA()->GetDataMemberOffset(
"fHistogram");
1756 if (offset <= 0)
return 0;
1758 TH1 **hist = (TH1 **)((
char*) obj + offset);
1762 if (obj->IsA()==THStack::Class())
1765 if (obj->IsA() == TMultiGraph::Class())
1768 TGraph *gr =
dynamic_cast<TGraph *
> (obj);
1769 if (gr)
return gr->GetHistogram();
1777 TPad* pad =
dynamic_cast<TPad*
>(obj);
1783 if ((strcmp(cmdname,
"UnZoom") == 0) && obj->InheritsFrom(TAxis::Class())) {
1808 if (!framehisto)
continue;
1810 if (framehisto->GetXaxis() != obj)
continue;
1812 TIter next(hs->GetHists());
1814 while ((hs_h1 = (TH1*) next()) != 0)
1815 hs_h1->GetXaxis()->UnZoom();
1818 }
while (iter.
next());
1826 TCanvasImp *imp =
GetCanvas()->GetCanvasImp();
1854 Int_t npts = markers.GetEntries();
1859 TArrayD x(npts), y(npts);
1861 for (Int_t j = 0; j < npts; ++j) {
1864 std::cout <<
"NEVER COME HERE: no marker at index " << j << std::endl;
1867 x[j] = mark->GetX();
1868 y[j] = mark->GetY();
1873 TString grname =
GetPanelName() + TString(
"-Markergraph");
1874 TGraph* graf =
new TGraph(npts, x.GetArray(), y.GetArray());
1875 graf->SetName(grname.Data());
1876 graf->SetMarkerStyle(28);
1884 if ((padopt == 0) || (slot == 0))
return;
1899 for (
int n = 0; n < slot->
NumChilds(); n++) {
1910 if (dynamic_cast<TLatex*>(obj) || dynamic_cast<TF1*>(obj)) {
1912 if (dynamic_cast<TGo4ObjectProxy*>(subslot->
GetProxy())) {
1915 }
else if (dynamic_cast<TGo4LinkProxy*>(subslot->
GetProxy())) {
1920 TGo4Log::Error(
"MakePictureForPad NEVER COME HERE, unknown proxy type");
1947 if (nm!=0) pic->
AddObjName(nm->GetName(), drawopt);
1950 Int_t rebinx, rebiny;
1951 if (subslot->
GetIntPar(
"::HasRebinX", rebinx))
1953 if (subslot->
GetIntPar(
"::HasRebinY", rebiny))
1959 for (
int n = 0; n < slot->
NumChilds(); n++) {
1965 if (pads.GetLast() < 0)
1969 int xcnt = 0, sizex = 1, sizey = 1;
1970 for (
int n = 0; n <= pads.GetLast(); n++) {
1971 TPad* subpad = (TPad*) pads.At(n);
1972 double mitx = subpad->GetXlowNDC() + subpad->GetWNDC() / 2.;
1984 while (sizex * sizey <= pads.GetLast())
1989 for (
int ny = 0; ny < sizey; ny++)
1990 for (
int nx = 0; nx < sizex; nx++) {
1991 int indx = ny * sizex + nx;
1992 if (indx > pads.GetLast())
1994 TPad* subpad = (TPad*) pads.At(indx);
2002 if (dlg.exec() != QDialog::Accepted)
2007 QString outfile =
"~/go4printout.ps";
2010 QString DelCmd = QString(
"rm -f ") + outfile;
2012 GetCanvas()->Print(outfile.toLatin1().constData());
2013 gSystem->Exec(PrnCmd.toLatin1().constData());
2014 gSystem->Exec(DelCmd.toLatin1().constData());
2019 bool visible =
false;
2020 std::cout <<
"DDDDDDDDD TGo4ViewPanel::StartRootEditor()" << std::endl;
2059 for (
int n = 0; n < padslot->
NumChilds(); n++) {
2065 if (itemname != 0) {
2074 if (pad == 0)
return;
2076 double defleft =gStyle->GetPadLeftMargin();
2077 double defright =gStyle->GetPadRightMargin();
2078 double deftop =gStyle->GetPadTopMargin();
2079 double defbottom =gStyle->GetPadBottomMargin();
2081 double dx = fabs(pad->AbsPixeltoX(1) - pad->AbsPixeltoX(0));
2082 double dy = fabs(pad->AbsPixeltoY(1) - pad->AbsPixeltoY(0));
2084 if ((dx <= 0) || (dy <= 0))
return;
2085 double ratio = dx / dy;
2087 if(fabs(1.0-ratio) < 1.0E-3)
2096 double left = pad->GetLeftMargin();
2097 double right = pad->GetRightMargin();
2098 double change = (1. - left - right) * (1 - ratio);
2100 double newleft = left + change / 2.;
2101 double newright = right + change / 2.;
2102 double newtop = pad->GetTopMargin();
2103 double newbottom = pad->GetBottomMargin();
2106 double shrink=newtop- deftop;
2107 if(shrink>newleft-defleft) shrink = newleft-defleft;
2108 if(shrink>newright-defright) shrink = newright-defright;
2111 newtop = newtop - shrink;
2112 newbottom = newbottom - shrink;
2113 newleft = newleft - shrink;
2114 newright = newright - shrink;
2119 pad->SetLeftMargin(newleft);
2120 pad->SetRightMargin(newright);
2121 pad->SetTopMargin(newtop);
2122 pad->SetBottomMargin(newbottom);
2125 double bottom = pad->GetBottomMargin();
2126 double top = pad->GetTopMargin();
2127 double change = (1. - bottom - top) * (1. - 1 / ratio);
2129 double newleft=pad->GetLeftMargin();
2130 double newright=pad->GetRightMargin();
2131 double newtop= top + change / 2.;
2132 double newbottom= bottom + change / 2.;
2135 double shrink=newleft - defleft;
2136 if(shrink>newtop-deftop) shrink=newtop-deftop;
2137 if(shrink>newbottom-defbottom) shrink=newbottom-defbottom;
2139 newtop = newtop - shrink;
2140 newbottom = newbottom -shrink;
2141 newleft = newleft- shrink;
2142 newright = newright - shrink;
2147 pad->SetTopMargin(newtop);
2148 pad->SetBottomMargin(newbottom);
2149 pad->SetLeftMargin(newleft);
2150 pad->SetRightMargin(newright);
2156 if (pad == 0)
return;
2157 pad->SetLeftMargin(gStyle->GetPadLeftMargin());
2158 pad->SetRightMargin(gStyle->GetPadRightMargin());
2159 pad->SetTopMargin(gStyle->GetPadTopMargin());
2160 pad->SetBottomMargin(gStyle->GetPadBottomMargin());
2236 if (selected != wasselected) {
2283 bool setdefaults =
false;
2289 slot = parent->
FindChild(pad->GetName());
2304 bool issubpads =
false;
2306 bool isdupluicate =
false;
2312 isdupluicate =
false;
2313 TIter iter(pad->GetListOfPrimitives());
2315 while ((obj = iter()) != 0) {
2316 TPad* subpad =
dynamic_cast<TPad*
>(obj);
2320 if (subpads.FindObject(subpad->GetName()) != 0)
2321 isdupluicate =
true;
2323 subpads.Add(subpad);
2326 pad->GetListOfPrimitives()->RemoveAll(&subpads);
2332 }
while (isdupluicate);
2335 for (
int n = slot->
NumChilds() - 1; n >= 0; n--) {
2339 if (pad->GetListOfPrimitives()->FindObject(subpad) == 0)
2352 TIter iter(pad->GetListOfPrimitives());
2353 TObjArray removedItems;
2355 while ((obj = iter()) != 0) {
2356 TPad* subpad =
dynamic_cast<TPad*
>(obj);
2360 removedItems.Add(obj);
2363 pad->GetListOfPrimitives()->RemoveAll(&removedItems);
2370 TObject* obj,
bool owner,
const char* drawopt)
2375 if (owner)
delete obj;
2389 if ((cl != 0) && cl->InheritsFrom(TGo4Condition::Class()))
2397 tgtslot =
AddNewSlot(brslot->GetName(), padslot);
2406 QString newslotname = itemname;
2407 if ((newslotname.length() == 0)
2408 || (padslot->
FindChild(newslotname.toLatin1().constData()) != 0)) {
2411 if ((itemname == 0) || (*itemname == 0))
2412 newslotname =
"::SpecialObject_";
2414 newslotname = itemname;
2415 newslotname += QString::number(cnt++);
2416 }
while (padslot->
FindChild(newslotname.toLatin1().constData()) != 0);
2418 tgtslot =
AddNewSlot(newslotname.toLatin1().constData(), padslot);
2422 if (tgtslot == 0)
return 0;
2427 tgtslot->
SetPar(
"::FirstDraw",
"true");
2435 if ((kind < 100) && (drawopt != 0))
2446 return slot == 0 ? 0 : slot->
FindChild(name);
2475 for (
int n = 0; n < padslot->
NumChilds(); n++) {
2490 if ((slot == 0) || (objs == 0))
2493 for (
int n = 0; n < slot->
NumChilds(); n++) {
2498 if ((kind !=
kind_Link) && ((selectkind < 0) || (kind == selectkind))) {
2511 if ((slot == 0) || (padopt == 0))
2516 for (
int n = slot->
NumChilds() - 1; n >= 0; n--) {
2522 && ((kindtodelete < 0) || (kind == kindtodelete))) {
2557 if ((pad == 0) || (pic == 0) || (padslot == 0))
2560 bool optchanged =
false;
2561 TObjLink* link = pad->GetListOfPrimitives()->FirstLink();
2564 const char* clname = link->GetObject()->ClassName();
2565 if ((strcmp(clname,
"TFrame") == 0) || (strcmp(clname,
"TLegend") == 0)) {
2572 link = link->Next();
2580 TString newopt(link->GetOption());
2588 if (!oldopt.Contains(
"asimage"))
2589 if ((newopt.Length() != oldopt.Length())
2590 || (newopt.CompareTo(oldopt, TString::kIgnoreCase) != 0)) {
2595 TH1* h1 =
dynamic_cast<TH1*
>(link->GetObject());
2598 TGraph* gr =
dynamic_cast<TGraph*
> (link->GetObject());
2604 dynamic_cast<TPaveStats*
>(h1->GetListOfFunctions()->FindObject(
"stats"));
2605 if (h1->TestBit(TH1::kNoStats)) {
2612 TAxis* xax = h1->GetXaxis();
2638 dynamic_cast<TPaveText*
>(pad->GetListOfPrimitives()->FindObject(
"title"));
2644 TObjArray objs, objslots;
2653 TObjArray* objs, TObjArray* objslots)
2658 if ((pad != 0) && (pic != 0)) {
2659 if (padslot->
GetPar(
"::DrawOptAssigned") != 0) {
2661 }
else if (!onlyscan) {
2663 padslot->
SetPar(
"::DrawOptAssigned",
"1");
2667 if ((padslot == 0) || (pic == 0) || (objs == 0) || (objslots == 0))
2670 for (
int n = 0; n <= objs->GetLast(); n++) {
2671 TObject* obj = objs->At(n);
2674 if ((obj == 0) || (subslot == 0))
2677 if (subslot->
GetPar(
"::DrawOptAssigned") != 0) {
2679 }
else if (!onlyscan) {
2681 subslot->
SetPar(
"::DrawOptAssigned",
"1");
2687 TObjArray* objslots,
int modifier)
2692 if ((slot == 0) || (objs == 0))
2695 TObjArray mainslots;
2697 int lastobjtype = 0;
2699 for (
int n = 0; n < slot->
NumChilds(); n++) {
2713 if (obj->InheritsFrom(TH1::Class()))
2715 else if (obj->InheritsFrom(TGraph::Class()))
2717 else if (obj->InheritsFrom(TMultiGraph::Class()))
2719 else if (obj->InheritsFrom(THStack::Class()))
2725 lastobjtype = objtype;
2726 mainslots.Add(subslot);
2730 Bool_t deletesomething = kFALSE;
2732 for (
int n = 0; n <= mainslots.GetLast(); n++) {
2736 if (obj->InheritsFrom(TH1::Class()))
2738 else if (obj->InheritsFrom(TGraph::Class()))
2740 else if (obj->InheritsFrom(TMultiGraph::Class()))
2742 else if (obj->InheritsFrom(THStack::Class()))
2748 if ((n < mainslots.GetLast())
2749 && ((modifier == 2) || ((modifier == 1) && (lastobjtype != objtype)))) {
2751 deletesomething = kTRUE;
2755 objslots->Add(subslot);
2765 if (deletesomething)
2768 for (
int n = 0; n < slot->
NumChilds(); n++) {
2777 objslots->Add(subslot);
2784 if (indx<0) indx = 0;
2786 switch (indx % 10) {
2787 case 0:
return kBlack;
2788 case 1:
return kRed;
2789 case 2:
return kGreen;
2790 case 3:
return kBlue;
2791 case 4:
return kCyan;
2792 case 5:
return kOrange;
2793 case 6:
return kSpring;
2794 case 7:
return kViolet;
2795 case 8:
return kPink;
2796 case 9:
return kAzure;
2805 TObjArray * objslots,
bool showitems)
2807 if ((sislot == 0) || (objs == 0) || (padopt == 0))
return 0;
2810 Bool_t ishstack = kFALSE;
2811 Bool_t isgstack = kFALSE;
2812 Bool_t iserror = kFALSE;
2813 Bool_t resetcolors = kFALSE;
2815 for (
int n = 0; n <= objs->GetLast(); n++) {
2816 TObject* obj = objs->At(n);
2817 if (obj->InheritsFrom(TH1::Class()))
2819 else if (obj->InheritsFrom(TGraph::Class()))
2826 if (iserror || (ishstack && isgstack)) {
2827 TGo4Log::Error(
"Superimpose of multiple objects with different types");
2828 std::cout<<
"Superimpose of multiple objects with different types"<< std::endl;
2833 THStack* hs =
dynamic_cast<THStack*
>(oldobj);
2836 hs =
new THStack(objs->First()->GetName(), objs->First()->GetTitle());
2838 resetcolors = kTRUE;
2841 hs->GetHists()->Clear();
2844 for (
int n = 0; n <= objs->GetLast(); n++) {
2845 TH1* histo = (TH1*) objs->At(n);
2849 Int_t objindx = padslot->
GetIndexOf(objslot);
2857 histo->GetXaxis()->UnZoom();
2865 hs->Add(histo, drawopt);
2868 }
else if (isgstack) {
2869 TMultiGraph* mgr =
dynamic_cast<TMultiGraph*
>(oldobj);
2871 mgr =
new TMultiGraph(objs->First()->GetName(),
2872 objs->First()->GetTitle());
2874 resetcolors = kTRUE;
2875 }
else if (mgr->GetListOfGraphs()) {
2876 mgr->GetListOfGraphs()->Clear();
2879 for (
int n = 0; n <= objs->GetLast(); n++) {
2880 TGraph* gr = (TGraph*) objs->At(n);
2886 if (drawopt.Length() == 0)
2888 if (drawopt.Length() == 0)
2894 if (n > 0) drawopt.ReplaceAll(
"a",
"");
2896 Bool_t first_draw = objslot->
GetPar(
"::FirstDraw") != 0;
2898 Int_t objindx = padslot->
GetIndexOf(objslot);
2903 gr->SetLineColor(nextcol);
2904 gr->SetMarkerColor(nextcol);
2909 if (first_draw && (n==0)) {
2910 TAxis *ax = gr->GetXaxis();
2911 if ((ax!=0) && ax->GetTimeDisplay()) {
2920 mgr->Add(gr, drawopt.Data());
2925 if ((ishstack || isgstack) && (legslot != 0)) {
2929 double miny = 0.94 - 0.03 * objs->GetLast();
2930 if (miny < 0.6) miny = 0.6;
else if (miny>0.92) miny = 0.92;
2931 legend =
new TLegend(0.6, miny, 0.95, 0.99);
2932 legend->SetBorderSize(2);
2933 legend->SetName(
"fitlegend");
2939 for(
int n=0;n<=objs->GetLast();n++) {
2940 TObject* stob = objs->At(n);
2942 const char* objname = stob->GetName();
2944 if (showitems && (objslots!=0)) {
2946 if (itemname!=0) objname = itemname;
2949 TString ldrawopt =
"l";
2955 if (drawopt.Contains(
"l")) ldrawopt+=
"l";
2956 if (drawopt.Contains(
"p")) ldrawopt+=
"p";
2959 if (ldrawopt.Length()==0) ldrawopt =
"l";
2961 legend->AddEntry(stob, objname, ldrawopt.Data());
2973 if ((pad == 0) || (padslot == 0))
return;
2978 if ((numX > 1) || (numY > 1)) {
2979 pad->Divide(numX, numY);
2994 tgtslot =
new TGo4Slot(padslot,
"::ThisPad",
"Special object");
3008 while (iter.
next()) {
3031 for (
int n = 0; n < padslot->
NumChilds(); n++)
3060 while (iter.
next()) {
3084 while (iter.
next()) {
3107 while (iter.
next()) {
3117 if ((pad == 0) || (slot == 0) || (obj == 0))
3120 for (
int n = 0; n < slot->
NumChilds(); n++) {
3130 return padslot == 0 ? 0 : padslot->
FindChild(
"::Superimpose");
3136 if ((pad == 0) || (slot == 0))
3139 for (
int n = 0; n < slot->
NumChilds(); n++) {
3202 tgtslot =
new TGo4Slot(padslot,
"::PadOptions",
"Pad options slot");
3227 if ((pad == 0) || (padslot == 0))
3241 if (obj->InheritsFrom(TH1::Class()))
3246 if (obj->InheritsFrom(TGraph::Class()))
3250 if (obj->InheritsFrom(THStack::Class()))
3253 if (obj->InheritsFrom(TMultiGraph::Class())) {
3254 TMultiGraph* mg =
dynamic_cast<TMultiGraph*
>(obj);
3261 TIter iter(mg->GetListOfGraphs());
3262 while ((gr = (TGraph*) iter()) != 0) {
3295 TObjArray objs, objslots;
3298 Int_t nselectitem = 0;
3302 if ((selected > objs.GetLast())
3316 QString fulllist =
"";
3317 QString selslotname =
"";
3319 for (
int n = 0; n <= objslots.GetLast(); n++) {
3325 QString subslotname = subslot->GetName();
3326 if (n == selected) {
3327 subslotname = QString(
"[") + subslotname + QString(
"]");
3328 selslotname = subslotname;
3330 if (n > 0) fulllist +=
", ";
3331 fulllist += subslotname;
3335 && (selected < objslots.GetLast())) {
3338 QString(
"Show ") + selslotname + QString(
" on top"),
3343 fulllist = QString(
"[") + fulllist + QString(
"]");
3347 if (nselectitem > 0) {
3354 if (fulllist.length() > 0) {
3359 if (capt.length() > 60) {
3365 setWindowTitle(capt);
3383 slot->
SetPar(
"::DrawOpt", drawopt);
3393 if (!slot->
GetIntPar(
"::DrawKind", kind))
3400 return (slot == 0) ? 0 : slot->
GetPar(
"::DrawOpt");
3406 slot->
SetIntPar(
"::SelectedObject", indx);
3414 if (!slot->
GetIntPar(
"::SelectedObject", indx))
3423 if ((slot == 0) || (padopt == 0))
3435 TObjArray objs, objslots;
3438 if (objs.GetLast() < 0)
3441 if ((indx > objs.GetLast()) || (indx < 0))
3452 return objs.At(indx);
3459 if ((slot == 0) || (padopt == 0))
3464 TObjArray objs, objslots;
3468 if ((objs.GetLast() <= 0) || (indx == objs.GetLast()))
3484 if ((pad == 0) || (padslot == 0))
return;
3486 TObjArray objs, objslots;
3490 if (indx < 0) indx = 0;
3492 TH1* selhisto =
dynamic_cast<TH1*
>((indx <= objs.GetLast()) ? objs.At(indx) : 0);
3496 for (
int n = 0; n < padslot->
NumChilds(); n++) {
3500 if (obj == 0)
continue;
3507 if (obj->InheritsFrom(TGo4Condition::Class()))
3509 else if (obj->InheritsFrom(TGo4Marker::Class()))
3522 if (objs.FindObject(oldhisto) == 0)
3525 if (oldhisto == 0) {
3528 }
else if (mark != 0) {
3540 setWindowTitle(mycaption);
3547 if ((pad == 0) || (padslot == 0))
3557 for (
int n = 0; n < padslot->
NumChilds(); n++) {
3567 if ((kind < 0) || (kind >= 100))
3571 if (obj->InheritsFrom(TGo4Condition::Class())) {
3576 cond->SetFillStyle(3444);
3581 if (obj->InheritsFrom(TLatex::Class())) {
3586 if (obj->InheritsFrom(TF1::Class())) {
3597 canv =
dynamic_cast<TCanvas*
>(obj);
3628 TVirtualPad* padsav = gPad;
3641 if ((pad == 0) || (pic == 0))
return;
3649 for (Int_t posy = 0; posy < pic->
GetDivY(); posy++)
3650 for (Int_t posx = 0; posx < pic->
GetDivX(); posx++) {
3654 (TPad*) pad->GetPad(posy * pic->
GetDivX() + posx + 1),
3718 while ((obj = iter()) != 0) {
3719 Option_t* drawopt = iter.GetOption();
3720 if (dynamic_cast<TArrow*>(obj) != 0)
3722 else if (dynamic_cast<TLatex*>(obj) != 0)
3724 else if (dynamic_cast<TGo4Marker*>(obj) != 0)
3726 else if (dynamic_cast<TGo4WinCond*>(obj) != 0)
3728 else if (dynamic_cast<TGo4PolyCond*>(obj) != 0)
3730 else if (dynamic_cast<TPaveLabel*>(obj) != 0)
3732 drawopt ? drawopt :
"br");
3742 const char* srcpaditemname)
3744 if ((tgtpad == 0) || (srcpad == 0))
return;
3750 if ((padopt == 0) || (padslot == 0))
return;
3752 tgtpad->SetTickx(srcpad->GetTickx());
3753 tgtpad->SetTicky(srcpad->GetTicky());
3754 tgtpad->SetGridx(srcpad->GetGridx());
3755 tgtpad->SetGridy(srcpad->GetGridy());
3756 tgtpad->SetBorderSize(srcpad->GetBorderSize());
3757 tgtpad->SetBorderMode(srcpad->GetBorderMode());
3758 srcpad->TAttLine::Copy(*tgtpad);
3759 srcpad->TAttFill::Copy(*tgtpad);
3760 srcpad->TAttPad::Copy(*tgtpad);
3762 tgtpad->SetPhi(srcpad->GetPhi());
3763 tgtpad->SetTheta(srcpad->GetTheta());
3765 int nsubpads = 0, nmain = 0, mainkind = 0;
3766 TObjLink* link = srcpad->GetListOfPrimitives()->FirstLink();
3768 TObject* obj = link->GetObject();
3769 const char* drawopt = link->GetOption();
3775 TPad* srcsubpad =
dynamic_cast<TPad*
>(obj);
3777 TString itemname = TString::Format(
"%s/%s", srcpaditemname,
3780 if (srcsubpad != 0) {
3782 QString subpadname = tgtpad->GetName();
3784 subpadname += QString::number(nsubpads);
3786 Double_t xlow, ylow, xup, yup;
3788 srcsubpad->GetPadPar(xlow, ylow, xup, yup);
3791 TPad* tgtsubpad =
new TPad(subpadname.toLatin1().constData(),
3792 srcsubpad->GetName(), xlow, ylow, xup, yup);
3793 tgtsubpad->SetNumber(nsubpads);
3801 }
else if (dynamic_cast<TGo4Condition*>(obj) != 0) {
3805 }
else if (dynamic_cast<TGo4Marker*>(obj) != 0) {
3809 }
else if (dynamic_cast<TLatex*>(obj) != 0) {
3812 }
else if (dynamic_cast<TPaveLabel*>(obj) != 0) {
3814 kTRUE, drawopt ? drawopt :
"br");
3815 }
else if (dynamic_cast<TArrow*>(obj) != 0) {
3820 if (dynamic_cast<TH1*>(obj) != 0) {
3825 if (dynamic_cast<TGraph*>(obj) != 0) {
3830 if (dynamic_cast<THStack*>(obj) != 0) {
3835 if (dynamic_cast<TMultiGraph*>(obj) != 0) {
3844 if ((kind > 0) && ((mainkind == 0) || ((kind == mainkind) && (kind < 3)))) {
3853 if ((h1 != 0) && (nmain == 0)) {
3855 Int_t ndim = h1->GetDimension();
3862 Double_t selmin = h1->GetMinimum();
3863 Double_t selmax = h1->GetMaximum();
3865 if (selmin < selmax)
3866 padopt->
SetRange(ndim, selmin, selmax);
3869 !h1->TestBit(TH1::kIsZoomed) || (selmin >= selmax));
3876 link = link->Next();
3904 gROOT->SetEscape(kFALSE);
3912 Bool_t oldmodified = gPad->IsModified();
3915 dummy.ExecuteEvent(kButton1Up, 0, 0);
3916 gPad->Modified(oldmodified);
3921 bool isanychildmodified =
false;
3922 bool ispadupdatecalled =
false;
3924 QTime starttm = QTime::currentTime();
3941 if (isanychildmodified) {
3943 ispadupdatecalled =
true;
3946 int delay = starttm.msecsTo(QTime::currentTime());
3947 intime = (delay >= 0) && (delay < 100);
3949 }
while (!force && isanychildmodified && intime);
3957 if (!ispadupdatecalled)
3964 if (!force && isanychildmodified)
3971 if (slot == 0)
return false;
3974 if (padopt == 0)
return false;
3976 bool ischilds =
false;
3977 bool ischildmodified =
false;
3984 Int_t lastdrawnpad = 0;
3986 if (!slot->
GetIntPar(
"::LastDrawnPad", lastdrawnpad))
3989 Int_t subpadindx = 0, numchilds = slot->
NumChilds();
3992 for (
int n = 0; n < numchilds; n++) {
3993 subpadindx = (n + lastdrawnpad);
3994 if (numchilds > 0) subpadindx = subpadindx % numchilds;
3996 if (!subpad)
continue;
3999 ischildmodified =
true;
4004 if (!force && ischildmodified)
4005 slot->
SetIntPar(
"::LastDrawnPad", subpadindx);
4010 return ischildmodified;
4018 if (ischilds)
return ischildmodified;
4027 TObjArray objs, objslots;
4038 if (objs.GetLast() < 0) {
4053 TObject* drawobj = 0;
4056 Bool_t dosuperimpose = objs.GetLast() > 0;
4060 Bool_t doasiimage = !dosuperimpose && !
fxWCanvas &&
4061 objs.Last()->InheritsFrom(TH2::Class());
4063 if (drawopt && TString(drawopt).Contains(
"asimage")) {
4064 if (!doasiimage) { drawopt =
"col"; padopt->
SetDrawOption(
"col", 0); }
4066 doasiimage = kFALSE;
4069 if (dosuperimpose) {
4071 sislot =
new TGo4Slot(slot,
"::Superimpose",
"place for superimpose object");
4074 legslot =
new TGo4Slot(slot,
"::Legend",
"place for legends object");
4084 dosuperimpose = kFALSE;
4087 if (!dosuperimpose) {
4096 drawobj = objs.Last();
4100 asihisto =
dynamic_cast<TH2*
>(drawobj);
4105 asislot =
new TGo4Slot(slot,
"::ASImage",
"place for Go4 ASI image");
4111 updatecontent =
true;
4129 bool first_draw = (slot->
GetPar(
"::PadFirstDraw") == 0);
4130 if (first_draw) slot->
SetPar(
"::PadFirstDraw",
"true");
4132 if (drawobj->InheritsFrom(TH1::Class())) {
4133 TH1* h1 = (TH1*) drawobj;
4134 h1->SetBit(kCanDelete, kFALSE);
4136 }
else if (drawobj->InheritsFrom(THStack::Class())) {
4137 THStack* hs = (THStack*) drawobj;
4138 RedrawStack(pad, padopt, hs, dosuperimpose, updatecontent);
4139 }
else if (drawobj->InheritsFrom(TGraph::Class())) {
4140 TGraph* gr = (TGraph*) drawobj;
4141 RedrawGraph(pad, padopt, gr, updatecontent, first_draw);
4142 }
else if (drawobj->InheritsFrom(TMultiGraph::Class())) {
4143 TMultiGraph* mg = (TMultiGraph*) drawobj;
4145 }
else if (dynamic_cast<TGo4ASImage*>(drawobj) != 0) {
4147 RedrawImage(pad, padopt, ai, asihisto, updatecontent);
4164 if ((pad == 0) || (padopt == 0) || (his == 0))
return;
4170 if (drawopt.Length() == 0) {
4171 if (his->GetDimension() == 1)
4173 else if (his->GetDimension() == 2)
4175 else if (his->GetDimension() == 3)
4191 if (nlvl > 0) his->SetContour(nlvl);
4194 his->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4195 his->Draw(drawopt.Data());
4201 bool dosuperimpose,
bool scancontent)
4203 if ((pad == 0) || (padopt == 0) || (hs == 0))
return;
4206 TIter iter(hs->GetHists());
4209 while ((h1 = (TH1*) iter()) != 0) {
4219 if (drawopt.Length() == 0)
4224 hs->Draw(drawopt.Data());
4227 if (framehisto == 0)
return;
4229 framehisto->SetStats(
false);
4230 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4231 TH1* h1 =
dynamic_cast<TH1*
>(hs->GetHists() ? hs->GetHists()->First() : 0);
4233 hs->SetTitle(h1->GetTitle());
4234 framehisto->SetTitle(h1->GetTitle());
4235 framehisto->GetXaxis()->SetTitle(h1->GetXaxis()->GetTitle());
4236 framehisto->GetYaxis()->SetTitle(h1->GetYaxis()->GetTitle());
4237 framehisto->GetZaxis()->SetTitle(h1->GetZaxis()->GetTitle());
4245 if ((pad == 0) || (padopt == 0) || (gr == 0))
return;
4249 gr->SetEditable(kFALSE);
4256 TAxis *ax = gr->GetXaxis();
4257 if ((ax!=0) && ax->GetTimeDisplay()) {
4261 if (drawopt.Length() == 0) {
4277 if (drawopt.Length() == 0)
4283 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4286 gr->Draw(drawopt.Data());
4289 framehisto = gr->GetHistogram();
4290 if (framehisto && ((framehisto->TestBit(TH1::kNoStats) == padopt->
IsHisStats()) || (framehisto->TestBit(TH1::kNoTitle) == padopt->
IsHisTitle()))) {
4292 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4293 gr->Draw(drawopt.Data());
4301 TMultiGraph * mg,
bool dosuperimpose,
bool scancontent)
4303 if ((pad == 0) || (padopt == 0) || (mg == 0))
return;
4305 TIter iter(mg->GetListOfGraphs());
4306 TGraph *gr(0), *firstgr(0);
4308 while ((gr = (TGraph*) iter()) != 0) {
4310 gr->SetEditable(kFALSE);
4320 if (drawopt.Length() == 0)
4326 mg->Draw(drawopt.Data());
4330 TH1* framehisto = (dosuperimpose && (firstgr != 0)) ? firstgr->GetHistogram() : mg->GetHistogram();
4332 if (framehisto == 0) {
4334 mg->Draw(drawopt.Data());
4335 framehisto = (dosuperimpose && (firstgr != 0)) ? firstgr->GetHistogram() : mg->GetHistogram();
4338 if (framehisto == 0) {
4339 TGo4Log::Error(
"Internal problem with MultiGraph drawing - cannot access frame histo");
4346 Double_t miny, maxy, selmin, selmax;
4349 if (maxy <= 0) maxy = 1.;
4350 if ((miny <= 0) || (miny >= maxy)) {
4352 if (miny > 1.) miny = 1.;
4355 maxy *= ((maxy>0) ? 1.1 : 0.9);
4356 miny *= ((miny>0) ? 0.9 : 1.1);
4358 framehisto->SetMaximum(maxy);
4359 framehisto->SetMinimum(miny);
4362 framehisto->SetStats(kFALSE);
4363 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4367 mg->SetTitle(firstgr->GetTitle());
4368 framehisto->SetTitle(firstgr->GetTitle());
4369 framehisto->GetXaxis()->SetTitle(firstgr->GetXaxis()->GetTitle());
4370 framehisto->GetYaxis()->SetTitle(firstgr->GetYaxis()->GetTitle());
4373 mg->Draw(drawopt.Data());
4377 TH2* asihisto,
bool scancontent)
4379 if ((pad == 0) || (padopt == 0) || (im == 0))
return;
4388 double uminx, umaxx, uminy, umaxy;
4393 im->SetPaletteEnabled(drawopt.Contains(
"Z"));
4401 if (legslot == 0)
return;
4404 if(legend!=0) legend->Draw();
4409 if ((pad == 0) || (padslot == 0))
4415 TObject* selectedobj = 0;
4416 const char* selectdrawopt = 0;
4418 for (
int n = 0; n < padslot->
NumChilds(); n++) {
4431 if(obj->InheritsFrom(TF1::Class())){
4432 if(!pad->GetListOfPrimitives()->IsEmpty())
4433 drawopt.Append(
"LSAME");
4434 TF1* func =
dynamic_cast<TF1*
>(obj);
4435 Int_t objindx = padslot->
GetIndexOf(subslot);
4436 func->SetLineColor(
GetAutoColor(((objindx+7) % 9) + 1));
4439 if ((selname == obj->GetName()) && (selectedobj == 0)) {
4441 selectdrawopt = drawopt.Data();
4444 obj->Draw(drawopt.Data());
4450 if (selectedobj != 0){
4452 selectedobj->Draw(selectdrawopt ? selectdrawopt :
"");
4478 int value,
const char* drawopt)
4482 if (subopt == 0)
return;
4499 subpad->SetFillColor(value);
4500 if (subpad->GetFrame())
4501 subpad->GetFrame()->SetFillColor(value);
4526 gStyle->SetPalette(value);
4536 if (slot == 0)
return;
4552 if(backup) col=backup->GetFillColor();
4553 pad->SetFillColor((Color_t) col);
4556 TIter iter(pad->GetListOfPrimitives());
4558 while ((obj = iter()) != 0) {
4559 TPad* subpad =
dynamic_cast<TPad*
>(obj);
4560 TFrame* fram =
dynamic_cast<TFrame*
>(obj);
4566 backpad=
dynamic_cast<TPad*
>(backup->GetListOfPrimitives()->FindObject(subpad->GetName()));
4581 TFrame* backframe=
dynamic_cast<TFrame*
>(backup->GetListOfPrimitives()->FindObject(fram->GetName()));
4584 col=backframe->GetFillColor();
4589 fram->SetFillColor((Color_t) col);
4610 if (padslot == 0)
return;
4612 for (
int n = padslot->
NumChilds() - 1; n >= 0; n--) {
4625 if ((slot == 0) || (padopt == 0))
4636 for (
int n = slot->
NumChilds() - 1; n >= 0; n--) {
4650 pad->GetListOfPrimitives()->Remove(subpad);
4654 if (
GetCanvas()->GetSelectedPad() == subpad)
4667 if (pad == 0)
return;
4680 int fiPadcolorR, fiPadcolorG, fiPadcolorB;
4682 int padfillcolor = TColor::GetColor(fiPadcolorR, fiPadcolorG, fiPadcolorB);
4684 if (padfillcolor != 0) {
4691 gVirtualX->GetPlanes(nplanes);
4694 TColor *normal = gROOT->GetColor(padfillcolor);
4697 normal->GetHLS(h, l, s);
4698 const char* cname = normal->GetName();
4700 Float_t dr, dg, db, lr, lg, lb;
4701 TColor *dark = gROOT->GetColor(100 + padfillcolor);
4703 new TColor(100 + padfillcolor, -1, -1, -1,
4704 Form(
"%s%s", cname,
"_dark"));
4705 dark = gROOT->GetColor(100 + padfillcolor);
4707 TColor *light = gROOT->GetColor(150 + padfillcolor);
4709 new TColor(150 + padfillcolor, -1, -1, -1,
4710 Form(
"%s%s", cname,
"_bright"));
4711 light = gROOT->GetColor(150 + padfillcolor);
4715 TColor::HLStoRGB(h, 0.7 * l, s, dr, dg, db);
4718 dark->SetRGB(dr, dg, db);
4720 dark->SetRGB(0.3, 0.3, 0.3);
4724 TColor::HLStoRGB(h, 1.2 * l, s, lr, lg, lb);
4727 light->SetRGB(lr, lg, lb);
4729 light->SetRGB(0.8, 0.8, 0.8);
4732 TGo4Log::Error(
"Internal problem in view panel: Could not assign root shadow colors for number %d", padfillcolor);
4737 pad->SetFillColor(padfillcolor);
4760 TString output = pad->GetName();
4761 output.Append(
": ");
4765 output.Append(
" SuperImpose:");
4768 output.Append(
" All Pads:");
4769 output.Append(
" Ready");
4776 printf(
"Implement display pad status in web canvas\n");
4793 if ((xaction == 0) && (yaction == 0) && (zaction == 0)) {
4802 while (iter.
next()) {
4805 if (padopt == 0)
continue;
4812 if ((xaction == 0) && (yaction == 0) && (zaction == 0)) {
4813 padopt->ClearRange();
4814 padopt->SetAutoScale(
true);
4816 padopt->SetPadModified();
4826 if (action <= 0)
return;
4828 double new_umin, new_umax, fmin, fmax, tmin, tmax;
4829 double fact = expandfactor / 100.;
4831 bool sel = padopt->
GetRange(naxis, new_umin, new_umax) && (action!=6);
4838 if (!sel || (new_umin >= new_umax)) { new_umin = fmin; new_umax = fmax; }
4840 double shift = (new_umax - new_umin) * fact;
4842 if (shift <= 0)
return;
4846 if ((new_umax + shift) > fmax)
4847 shift = fmax - new_umax;
4852 if (new_umin - shift < fmin)
4853 shift = new_umin - fmin;
4872 tmax = (-fact * new_umin + (1. - fact) * new_umax)
4874 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4877 tmax = (-fact * new_umin + new_umax) / (1. - fact);
4878 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4884 tmax = (-fact * new_umin + (1. - fact) * new_umax)
4886 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4889 tmax = (-fact * new_umin + new_umax) / (1. - fact);
4890 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4896 if (new_umin < fmin)
4898 if (new_umax > fmax)
4904 TH1* padhist =
dynamic_cast<TH1*
>(padobj);
4906 if (padhist==0)
break;
4908 if (naxis >= ndim)
break;
4910 TAxis* axis = padhist->GetXaxis();
4911 if (naxis==1) axis = padhist->GetYaxis();
4912 if (naxis==2) axis = padhist->GetZaxis();
4915 Int_t sel_l = sel ? axis->GetFirst() : 0;
4916 Int_t sel_r = sel ? axis->GetLast() : axis->GetNbins();
4918 Int_t firstbin(0), lastbin(0);
4921 if ((ndim==1) && (naxis==0)) {
4922 for (Int_t n1 = 1; n1<=padhist->GetNbinsX(); n1++) {
4923 Double_t v = padhist->GetBinContent(n1);
4924 if (TMath::Abs(v)<1e-10)
continue;
4925 if ((n1<sel_l) || (n1>sel_r))
continue;
4927 if (firstbin==0) firstbin = n1;
4932 if ((ndim==2) && (naxis<2))
4933 for (Int_t n1 = 1; n1<=padhist->GetNbinsX(); n1++)
4934 for (Int_t n2 = 1; n2<=padhist->GetNbinsY(); n2++) {
4935 Double_t v = padhist->GetBinContent(n1,n2);
4936 if (TMath::Abs(v)<1e-10)
continue;
4937 Int_t bin = naxis==0 ? n1 : n2;
4938 if ((bin<sel_l) || (bin>sel_r))
continue;
4939 if ((lastbin==0) || (bin>lastbin)) lastbin = bin;
4940 if ((firstbin==0) || (bin<firstbin)) firstbin = bin;
4944 if ((ndim==3) && (naxis<3))
4945 for (Int_t n1 = 1; n1<=padhist->GetNbinsX(); n1++)
4946 for (Int_t n2 = 1; n2<=padhist->GetNbinsY(); n2++)
4947 for (Int_t n3 = 1; n3<=padhist->GetNbinsZ(); n3++) {
4948 Double_t v = padhist->GetBinContent(n1,n2,n3);
4949 if (TMath::Abs(v)<1e-10)
continue;
4950 Int_t bin = naxis==0 ? n1 : ((naxis==1) ? n2 : n3);
4951 if ((bin<sel_l) || (bin>sel_r))
continue;
4952 if ((lastbin==0) || (bin>lastbin)) lastbin = bin;
4953 if ((firstbin==0) || (bin<firstbin)) firstbin = bin;
4958 if (firstbin >= lastbin) { firstbin--; lastbin++; }
4960 if (firstbin<=3) firstbin = 1;
4961 if (lastbin >=axis->GetNbins()-3) lastbin = axis->GetNbins();
4963 Double_t left = axis->GetBinLowEdge(firstbin);
4964 Double_t right = axis->GetBinUpEdge(lastbin);
4966 Double_t margin = (right - left) * fact;
4967 left -= margin; right += margin;
4969 if ((left <= new_umin) && (right >= new_umax))
return;
4971 if (left > new_umin) new_umin = left;
4972 if (right < new_umax) new_umax = right;
4974 if (action==6) axis->SetRange(firstbin,lastbin);
4987 if (padopt->
GetRange(naxis, new_umin, new_umax))
4993 if ((h1 == 0) || (padopt == 0))
return;
4995 TAxis* xax = h1->GetXaxis();
4996 TAxis* yax = h1->GetYaxis();
4997 TAxis* zax = h1->GetZaxis();
4998 int ndim = h1->GetDimension();
5003 xax->GetBinUpEdge(xax->GetNbins()));
5006 yax->GetBinUpEdge(yax->GetNbins()));
5012 zax->GetBinUpEdge(zax->GetNbins()));
5019 Int_t dimindx = (ndim == 1) ? 1 : 2;
5021 Double_t minimum = 0, maximum = 0;
5022 Bool_t first = kTRUE;
5023 if (!isfirsthisto) {
5028 for (Int_t biny = 1; biny <= yax->GetNbins(); biny++)
5029 for (Int_t binx = 1; binx <= xax->GetNbins(); binx++) {
5030 Int_t bin = h1->GetBin(binx, biny);
5031 Double_t value = h1->GetBinContent(bin);
5037 if (value < minimum)
5039 else if (value > maximum)
5048 if ((gr == 0) || (padopt == 0))
return;
5050 Double_t minx(0), maxx(0), miny(0), maxy(0), xx, yy;
5052 if (gr->GetN() > 0) {
5053 gr->GetPoint(0, minx, miny);
5062 for (Int_t n = 0; n < gr->GetN(); n++) {
5063 gr->GetPoint(n, xx, yy);
5085 if ((h1 == 0) || (padopt == 0) || (pad == 0))
return;
5091 double hmin(0.), hmax(0.), umin, umax;
5093 TAxis* ax = h1->GetXaxis();
5099 }
else if (padopt->
GetRange(0, umin, umax)) {
5104 Int_t i1 = ax->FindFixBin(umin);
5105 Int_t i2 = ax->FindFixBin(umax);
5106 if (i1<i2) ax->SetRange(i1,i2);
5107 else { ax->UnZoom(); padopt->
ClearRange(0); }
5112 TAxis* ay = h1->GetYaxis();
5114 if (padopt->
GetRange(1, umin, umax)) {
5115 if (!autoscale && (ndim == 1)) {
5126 Int_t i1 = ay->FindFixBin(umin);
5127 Int_t i2 = ay->FindFixBin(umax);
5128 if (i1<i2) { ay->SetRange(i1,i2); ay = 0; }
5136 if ((ndim==1) && (h1->GetMinimum()==0) && (h1->GetMaximum()==1)) {
5142 TAxis* az = h1->GetZaxis();
5144 if (padopt->
GetRange(2, umin, umax) && (ndim > 1)) {
5145 if (!autoscale && (ndim == 2)) {
5155 Int_t i1 = az->FindFixBin(umin);
5156 Int_t i2 = az->FindFixBin(umax);
5157 if (i1<i2) { az->SetRange(i1,i2); az = 0; }
5170 if (hmax <= 0) hmax = 1.;
5171 if ((hmin <= 0) || (hmin >= hmax)) {
5173 if (hmin > 1.) hmin = 1;
5177 h1->SetMinimum(hmin);
5178 h1->SetMaximum(hmax);
5179 h1->SetBit(TH1::kIsZoomed);
5181 hs->SetMinimum(hmin);
5182 hs->SetMaximum(hmax);
5190 TIter next(hs->GetHists());
5192 while ((hs_h1 = (TH1*) next()) != 0) {
5193 if (padopt->
GetRange(0, umin, umax)) {
5197 TAxis* ax = hs_h1->GetXaxis();
5198 Int_t i1 = ax->FindFixBin(umin);
5199 Int_t i2 = ax->FindFixBin(umax);
5200 if (i1<i2) { ax->SetRange(i1,i2); }
5201 else { ax->UnZoom(); padopt->
ClearRange(0); }
5203 hs_h1->GetXaxis()->UnZoom();
5206 hs_h1->GetYaxis()->UnZoom();
5207 hs_h1->SetMinimum();
5208 hs_h1->SetMaximum();
5218 h1->ResetBit(TH1::kIsZoomed);
5224 Double_t selmin = h1->GetMinimum();
5225 Double_t selmax = h1->GetMaximum();
5227 if (selmin >= selmax) {
5230 bool islogscale = (ndim == 1) && (padopt->
GetLogScale(1) > 0);
5233 if ((selmin > 0) && (selmax > 0)) {
5234 selmin = TMath::Log10(selmin) + TMath::Log10(0.5);
5235 selmin = TMath::Power(10, selmin);
5236 selmax = TMath::Log10(selmax)
5237 + TMath::Log10(2 * (0.9 / 0.95));
5238 selmax = TMath::Power(10, selmax);
5242 Double_t yMARGIN = gStyle->GetHistTopMargin();
5243 Double_t dymin = yMARGIN * (selmax - selmin);
5244 if ((selmin >= 0) && (selmin - dymin < 0))
5248 selmax += yMARGIN * (selmax - selmin);
5251 padopt->
SetRange(ndim, selmin, selmax);
5258 dynamic_cast<TPaveStats*
>(h1->GetListOfFunctions()->FindObject(
"stats"));
5260 stats =
new TPaveStats(
5261 gStyle->GetStatX()-gStyle->GetStatW(),
5262 gStyle->GetStatY()-gStyle->GetStatH(),
5264 gStyle->GetStatY(),
"brNDC");
5265 stats->SetParent(h1);
5266 stats->UseCurrentStyle();
5267 stats->SetName(
"stats");
5268 h1->GetListOfFunctions()->Add(stats);
5269 stats->ConvertNDCtoPad();
5276 dynamic_cast<TPaveText*
>(pad->GetListOfPrimitives()->FindObject(
"title"));
5279 titl =
new TPaveText(gStyle->GetTitleX()-gStyle->GetTitleW(),
5280 gStyle->GetTitleY()-gStyle->GetTitleH(),
5281 gStyle->GetTitleX(),
5282 gStyle->GetTitleY(),
"blNDC");
5283 titl->UseCurrentStyle();
5284 titl->SetFillColor(gStyle->GetTitleFillColor());
5285 titl->SetFillStyle(gStyle->GetTitleStyle());
5286 titl->SetName(
"title");
5287 titl->SetBorderSize(gStyle->GetTitleBorderSize());
5288 titl->SetTextColor(gStyle->GetTitleTextColor());
5289 titl->SetTextFont(gStyle->GetTitleFont(
""));
5290 if (gStyle->GetTitleFont(
"")%10 > 2)
5291 titl->SetTextSize(gStyle->GetTitleFontSize());
5292 titl->AddText(h1->GetTitle());
5293 titl->SetBit(kCanDelete);
5294 pad->GetListOfPrimitives()->Add(titl);
5295 titl->ConvertNDCtoPad();
5301 TAxis* xax = h1->GetXaxis();
5317 if (padopt == 0)
return false;
5321 if ((naxis < 0) || (naxis > NumDim))
return false;
5323 bool res = padopt->
GetRange(naxis, min, max);
5324 if (!res || (min >= max))
5330 double selmin,
double selmax,
bool force)
5332 if ((selmin == -1.) && (selmax == -1.))
return false;
5334 double min, max, umin, umax;
5337 bool sel = padopt->
GetRange(naxis, umin, umax);
5339 if (!full || (min >= max) || (selmin >= selmax)) {
5344 double delta = (max - min) / 100000.;
5345 bool changed =
false;
5348 if (fabs(umin - selmin) > delta) {
5352 if (fabs(umax - selmax) > delta) {
5362 if ((selmin < min + delta) && (selmax > max - delta) && !force) {
5365 padopt->
SetRange(naxis, umin, umax);
5373 Double_t selmin, selmax;
5376 if (((ax->GetFirst() <= 0) && (ax->GetLast() >= ax->GetNbins() - 1))
5377 || (ax->GetFirst() >= ax->GetLast())) {
5381 selmin = ax->GetBinCenter(ax->GetFirst());
5382 selmax = ax->GetBinCenter(ax->GetLast());
5409 bool iszoomed = h1->TestBit(TH1::kIsZoomed);
5415 Double_t selmin = h1->GetMinimum();
5416 Double_t selmax = h1->GetMaximum();
5419 padopt->
SetRange(ndim, selmin, selmax);
5420 }
else if (selmin >= selmax) {
5424 bool islogscale = (ndim == 1) && (pad->GetLogy() > 0);
5427 if ((selmin > 0) && (selmax > 0)) {
5428 selmin = TMath::Log10(selmin) + TMath::Log10(0.5);
5429 selmin = TMath::Power(10, selmin);
5430 selmax = TMath::Log10(selmax)
5431 + TMath::Log10(2 * (0.9 / 0.95));
5432 selmax = TMath::Power(10, selmax);
5436 Double_t yMARGIN = 0.05;
5437 #if ROOT_VERSION_CODE > ROOT_VERSION(5,0,9)
5438 yMARGIN = gStyle->GetHistTopMargin();
5440 Double_t dymin = yMARGIN * (selmax - selmin);
5441 if ((selmin >= 0) && (selmin - dymin < 0))
5445 selmax += yMARGIN * (selmax - selmin);
5448 padopt->
SetRange(ndim, selmin, selmax);
5457 Double_t rxmin, rxmax, rymin, rymax;
5458 pad->GetRangeAxis(rxmin, rymin, rxmax, rymax);
5460 if (pad->GetLogx() > 0) {
5461 rxmin = TMath::Power(10., rxmin);
5462 rxmax = TMath::Power(10., rxmax);
5465 if (pad->GetLogy() > 0) {
5466 rymin = TMath::Power(10., rymin);
5467 rymax = TMath::Power(10., rymax);
5474 double rymin,
double rymax)
5481 if (padopt == 0)
return;
5490 double& xmax,
double& ymin,
double& ymax,
double& zmin,
double& zmax)
5494 if (padopt == 0)
return;
5508 QCheckBox* box1 = findChild<QCheckBox*>(
"ApplyToAllCheck");
5509 if (box1 != 0) box1->setChecked(on);
5516 bool modified =
false;
5517 bool applytoall =
false;
5518 bool redraw_immediately = (selpad == 0);
5537 while (iter.
next()) {
5542 if (on != padopt->IsAutoScale())
5543 padopt->SetPadModified();
5544 padopt->SetAutoScale(on);
5545 modified = modified || padopt->IsPadModified();
5549 if (modified && redraw_immediately)
5554 double ymax,
double zmin,
double zmax)
5582 while (iter.
next()) {
5587 Int_t ndim = padopt->GetFullRangeDim();
5593 if (!padopt->IsAutoScale()) {
5600 padopt->SetPadModified();
5619 if (slot == 0)
return;
5621 if (padopt == 0)
return;
5643 if (obj && !obj->InheritsFrom(THStack::Class()) && !obj->InheritsFrom(TMultiGraph::Class())) {
5721 for (
int n = 0; n < slot->
NumChilds(); n++) {
5740 basename =
"Marker";
5743 basename =
"Window";
5746 basename =
"Polygon";
5755 basename =
"Something";
5762 slotname = basename + QString::number(cnt++);
5763 }
while (padslot->
FindChild(slotname.toLatin1().constData()) != 0);
5776 for (
int n = 0; n < slot->
NumChilds(); n++) {
5779 if (drawkind != kind)
5782 if (subslot != activeslot)
5785 subslot->
SetPar(
"::ActiveMarker",
"1");
5794 if ((kind == selkind) && (selobj != 0))
5801 TObject* lastobj = 0;
5803 for (
int n = 0; n < slot->
NumChilds(); n++) {
5806 if (drawkind != kind)
5810 if (subslot->
GetPar(
"::ActiveMarker") != 0)
5820 return (obj == 0) ? QString(
"null") : QString(obj->GetName());
5831 #if ROOT_VERSION_CODE < ROOT_VERSION(4,0,8)
5834 while (iter.next()) {
5861 QString mycaption = windowTitle();
5862 QString oldtitle = mycaption.remove(
fPanelName +
": ");
5863 QString text = QInputDialog::getText(
this,
GetPanelName(),
5864 "Enter Viewpanel Title:", QLineEdit::Normal, oldtitle, &ok);
5865 if (ok && !text.isEmpty())
5876 QString text = QInputDialog::getText(
this,
GetPanelName(),
5877 "Enter Axis time format:", QLineEdit::Normal, oldfmt, &ok);
5878 if (ok && !text.isEmpty()) {
5890 bool s = act ? act->isChecked() :
false;
virtual void SetMouseMode(int mode)
virtual void ShootRepaintTimer()
virtual Bool_t IsXRMSDraw()
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 linkedRemoved(TGo4Slot *slot, TObject *obj)
virtual void ResetWidget()
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)
virtual Double_t GetYLow()
virtual void linkedUpdated(TGo4Slot *slot, TObject *obj)
bool IsContentModified() const
Bool_t GetIntPar(const char *name, Int_t &value)
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)
const char * GetXAxisTimeFormat()
virtual const char * GetName() const
virtual TGo4Slot * GetSuperimposeSlot(TGo4Slot *slot)
virtual void ApplyToAllToggled(bool)
QSignalMapper * fOptionsMap
virtual void RedrawImage(TPad *pad, TGo4Picture *padopt, TGo4ASImage *im, TH2 *asihisto, bool scancontent)
bool isStatusBarVisible()
void SetAutoZoom(bool on)
void SetIntPar(const char *name, Int_t value)
virtual void StartConditionEditor()
virtual const char * GetDrawObjectLinkName(TPad *pad, TObject *obj)
virtual void SetFreezeMouseMode(bool on)
virtual void MakePictureForPad(TGo4Picture *pic, TPad *pad, bool useitemname)
void AddObjName(const char *name, Option_t *DrawOption=0)
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
Int_t GetLogScale(Int_t nscale=0)
virtual void RedrawMultiGraph(TPad *pad, TGo4Picture *padopt, TMultiGraph *mg, bool dosuperimpose, bool scancontent)
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 getCanvasColor(int &red, int &green, int &blue)
Int_t GetIndexOf(TGo4Slot *child)
virtual QString GetSelectedMarkerName(TPad *pad)
virtual void StartConditionEditing(TPad *pad)
virtual Int_t IsChanged()
static TString NextAvailableName()
void CopyOptionsFrom(TGo4Picture *source)
virtual bool GetVisibleRange(TPad *pad, int naxis, double &min, double &max)
static bool CanDrawItem(int cando)
TGo4Proxy * GetProxy() const
static TGo4MdiArea * Instance()
virtual TGo4Slot * GetDrawObjectSlot(TPad *pad, const char *name)
static Int_t GetInstances()
const char * GetObjName(Int_t n)
const char * NoStackDrawOption
virtual const char * GetPanelName()
virtual bool IsAutoZoomFlag()
Bool_t IsHisStats() const
virtual bool ScanDrawOptions(TPad *pad, TGo4Slot *padslot, TGo4Picture *pic, bool onlyscan)
virtual TObject * GetActiveObj(TPad *pad, int kind)
Bool_t GetTitleAttr(TPaveText *titl)
void storePanelSize(QWidget *w, const QString &kind="ViewPanel")
virtual void ResizeGedEditor()
Int_t ItemCanDo(const char *name)
void SetHistogram(TH1 *histo)
virtual void SetYRMSDraw(Bool_t on)
void SetValuesDirect(TCutG *newcut)
virtual void SaveCanvas()
TGo4Slot * getslot() const
virtual void ProcessMarkersClear(TPad *pad, bool withsubpads)
Bool_t GetRange(Int_t naxis, Double_t &min, Double_t &max) const
Bool_t GetFullRange(Int_t naxis, Double_t &min, Double_t &max)
virtual void ProduceGraphFromMarkers()
virtual void GetConditionBtn_clicked()
const char * GetPar(const char *name) const
Int_t GetRebinY(Int_t index=UndefIndex)
virtual TGo4Slot * GetPanelSlot()
TClass * ItemClass(const char *name)
virtual void PadDoubleClickedSlot(TPad *pad, int evx=-1, int evy=-1)
virtual void InfoConditionBtn_clicked()
virtual void AutoScaleToggled(bool)
virtual Option_t * GetDrawOption() const
Graphic Qt Widget based Canvas.
virtual void ClosePanel()
virtual void ProducePicture()
virtual const char * GetDrawItemName(int itemcnt=0)
virtual void SetAutoZoomFlag(bool on)
bool fbLeaveFocusAfterCondEnd
virtual TGo4Slot * GetPadMainObjectSlot(TPad *pad)
virtual void CompleteInitialization()
virtual void SetWorkHistogram(TH1 *histo)
virtual void ProcessPadDoubleClick()
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 resizeEvent(QResizeEvent *e)
virtual void ClearCanvas()
virtual void Draw(Option_t *opt="")
virtual void DelSelectedMarker_clicked()
virtual void Divide(int numX, int numY)
void SetXAxisTimeFormat(const char *format)
virtual void StartRootEditor()
void ChangeDrawOption(Int_t kind, Int_t value)
TGo4Picture * Pic(Int_t posy, Int_t posx)
virtual void LogMarkerValues()
virtual void SetCursorMode(bool on)
virtual bool IsAcceptDrag(const char *itemname, TClass *cl, int kind)
virtual void CheckForSpecialObjects(TPad *pad, TGo4Slot *padslot)
TH1 * GetHistogram() const
void activateEditor(TPad *pad=0, TObject *obj=0)
virtual void TakeFullRangeFromGraph(TGraph *gr, TGo4Picture *padopt, bool isfirst)
virtual void UpdatePanelCaption()
TCutG * GetCut(Bool_t changeowner)
virtual void ShowEventStatus()
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()
Bool_t GetStatsAttr(TPaveStats *stats)
virtual void ProducePadsList(TObjArray *arr, TPad *toppad)
virtual void SetApplyToAllFlag(bool on)
virtual void AllocatePadOptions(TPad *pad)
bool IsApplyToAll() const
void SetApplyToAll(bool on)
virtual bool IsConditionSelected(TPad *pad)
virtual bool IsRepaintTimerActive()
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)
TGo4Slot * FindChild(const char *name)
void SetDivision(Int_t ndivy, Int_t ndivx)
virtual TGo4Slot * AddNewSlot(const char *name, TGo4Slot *parent)
virtual void Draw(Option_t *opt="")
virtual void SaveMarkers()
virtual void ProcessCanvasAdopt(TPad *tgtpad, TPad *srcpad, const char *srcitemname)
TH1D * GetHistogram(const char *HistogramName)
virtual void SetSelectedMarker(TPad *pad, const QString &selname, int selindex)
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)
TGo4Slot * GetParent() const
virtual void PadRangeAxisChanged(TPad *pad)
virtual void MarkPadModified(TPad *pad)
virtual void DropOnPad(TPad *pad, const char *itemname, TClass *cl, int kind)
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 Bool_t IsXMeanDraw()
virtual void SelectedMarkerCmb_activated(int indx)
virtual void ClearPad(TPad *pad, bool removeitems, bool removesubpads)
Bool_t GetFrameAttr(TPad *pad)
virtual TPad * FindPadWithItem(const char *itemname)
virtual void SetSelectedRangeToHisto(TPad *pad, TH1 *h1, THStack *hs, TGo4Picture *padopt, bool ishisto)
virtual int GetNumMarkers(TPad *pad, int kind)
bool IsSuperimpose() const
virtual void PadDeleted(TPad *pad)
virtual void linkedObjectUpdated(const char *linkname, TObject *obj)
void RemovePar(const char *name)
virtual void SetRegionMode(bool on)
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)
virtual void RedrawGraph(TPad *pad, TGo4Picture *padopt, TGraph *gr, bool scancontent, bool first_draw)
Bool_t IsXAxisTimeDisplay()
virtual void OptionsMenuItemActivated(int)
bool IsPadModified() const
virtual Bool_t IsXMaxDraw()
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)
virtual Double_t GetXLow()
TGo4Slot * BrowserSlot(const char *item)
virtual void SetValues(Double_t low1, Double_t up1)
Int_t GetHisContour() const
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)
Bool_t GetRangeY(Double_t &min, Double_t &max) const
virtual void panelSlot(TGo4ViewPanel *panel, TPad *pad, int signalid)
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)
virtual void SetSelectedMarkerByMouseClick(TPad *pad, const char *name)
TH1 * Get_fHistogram(TObject *obj, bool force=false)
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)
TGo4ViewPanel(QWidget *parent=0, const char *name=0)
virtual void SetChanged(Bool_t on=kTRUE)
virtual TH1 * GetPadHistogram(TPad *pad)
virtual void SetPadSuperImpose(TPad *pad, bool on)
virtual bool TakeSelectedAxisRange(int naxis, TGo4Picture *padopt, double selmin, double selmax, bool force)
virtual void ClearPadItems(TGo4Slot *padslot, TGo4Slot *remain)
QCheckBox * fAutoScaleCheck
TPadGuard(TVirtualPad *repl=0)
Bool_t IsHisTitle() const
virtual void SetLateXMode(bool on)
virtual void RefreshButtons()
bool IsLegendDraw() const
void GetDrawAttributes(TObject *obj, Int_t index=UndefIndex)
void SetSuperimpose(bool on)
Bool_t IsTitleDate() const
void SetDrawAttributes(TObject *obj, Int_t index=UndefIndex)
void setStatusBar(QStatusBar *bar)
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)
TPad * fxDoubleClickTimerPad
virtual void SetActiveObj(TPad *pad, int kind, TGo4Slot *activeslot)
TGo4Condition * At(Int_t i)
virtual void CollectSpecialObjects(TPad *pad, TObjArray *objs, int selectkind)
virtual void LoadMarkers()
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)
Int_t GetRebinX(Int_t index=UndefIndex)
Int_t GetFullRangeDim() const
virtual int GetNumberOfPads(TPad *toppad)
void SetPar(const char *name, const char *value)
virtual TPad * GetActivePad()
void SetSelectedPad(TPad *pad)
void SetContentModified(bool on=true)
virtual void SetMarkerPanel()
void AddSpecialObject(TObject *obj, Option_t *drawopt=0)
TGo4Slot * GetChild(Int_t n) const
Bool_t IsTitleItem() const
virtual void SuperImposeToggled(bool)
Bool_t IsTitleTime() const
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)
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)
virtual void SetDrawOption(Option_t *option="")
virtual void checkResizeSlot()
virtual TCanvas * GetCanvas()
void setEditorFrame(QFrame *fr)
void activateEditor(TPad *pad, TObject *obj)
void setStatusBarVisible(bool flag)
static void Error(const char *text,...)
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)
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 bool IsWebCanvas() const
virtual void MenuCommandExecutedSlot(TObject *obj, const char *cmdname)
Bool_t next(Bool_t goesinto=kTRUE)
virtual void ResetPadFillColors(TPad *pad, int col, TPad *backup=0)
virtual int GetSelectedObjectIndex(TGo4Slot *slot)
virtual void CanvasUpdatedSlot()
virtual void ChangeDrawOptionForPad(TGo4Slot *padslot, int kind, int value, const char *drawopt)
virtual void SetAutoScale(bool on, TPad *selpad)
TList * GetSpecialObjects() const