28 #include "TVirtualPadEditor.h"
29 #include "TVirtualX.h"
31 #include "Riostream.h"
34 #include "TMultiGraph.h"
44 #include "TPaveStats.h"
45 #include "TPaveLabel.h"
47 #include "TLegendEntry.h"
58 #include "TGedEditor.h"
63 #include <QFileDialog>
65 #include <QInputDialog>
69 #include <QtCore/QSignalMapper>
87 #include "TGo4LockGuard.h"
132 MarkerPanel->setVisible(
false);
153 #if (QT_VERSION >= 0x040600)
157 QMenu* fileMenu =
fMenuBar->addMenu(
"F&ile");
158 fileMenu->addAction(
"&Save as...",
this, SLOT(
SaveCanvas()));
159 fileMenu->addAction(
"Print...",
this, SLOT(
PrintCanvas()));
160 fileMenu->addAction(
"Produce &Picture",
this, SLOT(
ProducePicture()));
161 fileMenu->addAction(
"Produce &Graph from markers",
this,
167 fileMenu->addAction(
"Cl&ose",
this, SLOT(close()));
170 QMenu* editMenu =
fMenuBar->addMenu(
"&Edit");
175 QAction* act =
AddChkAction(editMenu,
"Show &ROOT attributes editor",
178 act->setEnabled(
false);
188 editMenu->addAction(
"Start &condition editor",
this,
191 editMenu->addSeparator();
194 editMenu->addAction(
"Clear c&anvas",
this, SLOT(
ClearCanvas()));
197 connect(
fSelectMap, SIGNAL(mapped(
int)),
this,
228 QCheckBox* box1 =
new QCheckBox(
"Apply to all", MenuFrame);
229 box1->setObjectName(
"ApplyToAllCheck");
236 QHBoxLayout* menugrid =
new QHBoxLayout(0);
237 menugrid->setMargin(0);
238 menugrid->setSpacing(0);
239 menugrid->addWidget(
fMenuBar, 10, Qt::AlignLeft);
240 menugrid->addWidget(box1, 1, Qt::AlignRight);
243 gridLayout->addLayout(menugrid, 0, 0, 1, 2);
252 connect(
GetQCanvas(), SIGNAL(SelectedPadChanged(TPad*)),
this,
254 connect(
GetQCanvas(), SIGNAL(PadClicked(TPad*)),
this,
256 connect(
GetQCanvas(), SIGNAL(PadDoubleClicked(TPad*)),
this,
258 connect(
GetQCanvas(), SIGNAL(MenuCommandExecuted(TObject*,
const char*)),
260 connect(
GetQCanvas(), SIGNAL(CanvasLeaveEvent()),
this,
262 connect(
GetQCanvas(), SIGNAL(CanvasUpdated()),
this,
297 if (gROOT->GetSelectedPad() != 0)
298 if (
IsPanelPad((TPad*) gROOT->GetSelectedPad()))
299 gROOT->SetSelectedPad(0);
322 return new TGo4Slot(parent, name,
"title");
335 if (strcmp(linkname,
"PadRangeAxisChanged") == 0) {
337 }
else if (strcmp(linkname,
"PadModified") == 0) {
386 TPad* pad = (TPad*) obj;
415 || cl->InheritsFrom(TGo4Condition::Class());
423 if (cl->InheritsFrom(TGo4Fitter::Class())) {
430 && !cl->InheritsFrom(TGo4Condition::Class()))
455 QVBoxLayout* gedlayout =
new QVBoxLayout(EditorFrame);
456 gedlayout->setContentsMargins(0, 0, 0, 0);
492 if (padslot == 0)
return QString::null;
493 return QString(padslot->
GetPar(
"::SelMarker"));
499 if (padslot == 0)
return -1;
501 if (!padslot->
GetIntPar(
"::SelIndex", selindex))
return -1;
508 if (selobj != 0) *selobj = 0;
514 if ((padslot == 0) || (selname.length() == 0))
return 0;
516 for (
int n = 0; n < padslot->
NumChilds(); n++) {
521 if ((drawkind ==
kind_Link) && (obj != 0)) {
522 if (obj->InheritsFrom(TGo4Condition::Class()))
530 if ((obj == 0) || (selname != obj->GetName()))
535 if (obj->InheritsFrom(TGo4CondArray::Class())) {
538 if ((selindex >= 0) && (selindex < arr->
GetNumber()))
539 selcond = arr->
At(selindex);
544 if (selcond->InheritsFrom(TGo4WinCond::Class()))
546 else if (selcond->InheritsFrom(TGo4PolyCond::Class()))
571 while (iter.
next()) {
577 if (strcmp(linkname, itemname) == 0)
589 while (iter.
next()) {
595 if (cnt++ == itemcnt)
return linkname;
611 while (iter.
next()) {
616 if ((linkname != 0) && (strcmp(linkname, itemname) == 0)) {
617 delslots.Add(subslot);
625 if (delslots.GetLast() >= 0) {
640 if (selname.length() == 0)
650 if (selname.length() > 0)
651 padslot->
SetPar(
"::SelMarker", selname.toLatin1().constData());
656 padslot->
SetIntPar(
"::SelIndex", selindex);
661 TObject* newselobj = 0;
664 if ((selindex >= 0) && (newselslot != 0)) {
665 QString drawopt(
"sel=");
666 drawopt += QString::number(selindex);
670 if (((oldselindex != selindex) || (oldselname != selname))
671 && ((oldselindex >= 0) || (selindex >= 0))) {
674 }
else if (newselobj != 0) {
689 if (padslot == 0)
return;
693 for (
int n = 0; n < padslot->
NumChilds(); n++) {
699 if ((obj != 0) && (strcmp(obj->GetName(), name) == 0)) {
709 if (cond==0)
continue;
711 if (strcmp(cond->GetName(), name) == 0) {
714 if (cond->InheritsFrom(TGo4PolyCond::Class()))
728 for (
int ncon = 0; ncon < arr->
GetNumber(); ncon++)
729 if (strcmp(arr->
At(ncon)->GetName(), name) == 0) {
731 if (arr->
At(ncon)->InheritsFrom(TGo4PolyCond::Class()))
755 FreezeMode->setChecked(
false);
756 RegionB->setChecked(
true);
759 FreezeMode->setChecked(
false);
760 PolyB->setChecked(
true);
800 if (selectedkind != kind)
852 GetConditionBtn->setVisible(iscondition);
853 InfoConditionBtn->setVisible(iscondition);
854 EditConditionBtn->setVisible(iscondition);
855 SetConditionBtn->setVisible(iscondition);
860 ModifyConditionBtn->setVisible((cond != 0) && (cond->
IsChanged() != 0));
862 QString iconname =
":/icons/right.png";
863 QString tooltip =
"Refresh condition from analysis";
865 iconname =
":/icons/refresh.png";
866 tooltip =
"Refresh condition from source";
868 GetConditionBtn->setIcon(QIcon(iconname));
869 GetConditionBtn->setToolTip(tooltip);
872 ModifyConditionBtn->setVisible(
false);
876 CursorB->setChecked(
false);
877 RegionB->setChecked(
false);
878 LatexB->setChecked(
false);
879 DrawB->setChecked(
false);
880 PolyB->setChecked(
false);
883 CursorB->setChecked(
true);
884 RegionB->setChecked(
false);
885 LatexB->setChecked(
false);
886 DrawB->setChecked(
false);
887 PolyB->setChecked(
false);
890 CursorB->setChecked(
false);
891 RegionB->setChecked(
true);
892 LatexB->setChecked(
false);
893 DrawB->setChecked(
false);
894 PolyB->setChecked(
false);
897 CursorB->setChecked(
false);
898 RegionB->setChecked(
false);
899 LatexB->setChecked(
false);
900 DrawB->setChecked(
false);
901 PolyB->setChecked(
true);
904 CursorB->setChecked(
false);
905 RegionB->setChecked(
false);
906 LatexB->setChecked(
true);
907 DrawB->setChecked(
false);
908 PolyB->setChecked(
false);
911 CursorB->setChecked(
false);
912 RegionB->setChecked(
false);
913 LatexB->setChecked(
false);
914 DrawB->setChecked(
true);
915 PolyB->setChecked(
false);
918 CursorB->setChecked(
false);
919 RegionB->setChecked(
false);
920 LatexB->setChecked(
false);
921 DrawB->setChecked(
false);
922 PolyB->setChecked(
false);
927 SelectedMarkerCmb->clear();
928 SelectedMarkerCmb->addItem(
"new");
937 for (
int n = 0; n < slot->
NumChilds(); n++) {
946 if (obj->InheritsFrom(TGo4CondArray::Class())) {
948 for (
int ncon = 0; ncon < arr->
GetNumber(); ncon++) {
950 QString fullname(arr->GetName());
952 fullname += QString::number(ncon);
953 SelectedMarkerCmb->addItem(fullname);
955 if ((selname == obj->GetName()) && (selindex == ncon))
956 findindx = SelectedMarkerCmb->count() - 1;
959 SelectedMarkerCmb->addItem(obj->GetName());
960 if (selname == obj->GetName())
961 findindx = SelectedMarkerCmb->count() - 1;
971 SelectedMarkerCmb->setCurrentIndex(findindx);
972 DelSelectedMarker->setEnabled((findindx > 0) );
975 MarkerPanel->ensurePolished();
976 MarkerPanel->update();
989 QString selname = SelectedMarkerCmb->itemText(indx);
991 int p = selname.indexOf(
"/Sub");
993 selindex = selname.mid(p + 4).toInt();
1003 if ((slot != 0) && (drawkind > 0)) {
1014 if (slot == 0)
return;
1027 gROOT->SetEditorMode(
"");
1043 for (
int n = 0; n < slot->
NumChilds(); n++) {
1057 obj->Print(
"go4log");
1062 obj->Print(
"go4log-limits-stats");
1083 if (pad == 0)
return;
1090 if (!withsubpads)
return;
1093 if (slot == 0)
return;
1096 while (iter.
next()) {
1141 if (itemname != 0) {
1151 QFileDialog fd(
this,
"Save Markers of active pad into", QString(),
1152 "ROOT file (*.root)");
1153 fd.setFileMode(QFileDialog::AnyFile);
1154 fd.setAcceptMode(QFileDialog::AcceptSave);
1155 if (fd.exec() == QDialog::Accepted) {
1156 QStringList flst = fd.selectedFiles();
1160 QString filename = flst[0];
1161 if (!filename.endsWith(
".root"))
1162 filename.append(
".root");
1169 QFileDialog fd(
this,
"Load Marker setup from:", QString(),
1170 "ROOT file (*.root)");
1171 fd.setFileMode(QFileDialog::ExistingFile);
1172 if (fd.exec() == QDialog::Accepted) {
1173 QStringList flst = fd.selectedFiles();
1176 QString filename = flst[0];
1220 Int_t px = pad->GetEventX();
1221 Int_t py = pad->GetEventY();
1222 Double_t x = pad->PadtoX(pad->AbsPixeltoX(px));
1223 Double_t y = pad->PadtoY(pad->AbsPixeltoY(py));
1225 bool docheck =
false;
1226 bool iscreated =
false;
1230 TObject *obj =
GetCanvas()->GetSelected();
1232 if (obj->InheritsFrom(TGo4Marker::Class())
1233 || obj->InheritsFrom(TGo4WinCondView::Class())
1234 || obj->InheritsFrom(TGo4PolyCondView::Class()))
1242 gROOT->SetEditorMode(
"");
1248 mark->SetMarkerColor((ix) % 6 + 2);
1269 gROOT->SetEditorMode(
"");
1271 Double_t xmin(x), xmax(x), ymin(y), ymax(y);
1276 bool fbTwoDimRegion = (hist != 0) && (hist->GetDimension() > 1);
1278 QString name =
"Region " + QString::number(ix + 1);
1279 conny =
new TGo4WinCond(name.toLatin1().constData());
1287 conny->SetFillStyle(3002);
1296 if(conny==0)
return;
1301 if(conny==0)
return;
1308 std::cout <<
"TGo4ViewPanel:PadClickedSlot() NEVER COME HERE" << std::endl;
1313 conny->
SetValues(xmin, xmax, ymin, ymax);
1321 if (maincond!=0) maincond->
SetChanged(kTRUE);
1336 gROOT->SetEditorMode(
"");
1344 QString name =
"Polygon " + QString::number(ix + 1);
1353 TCutG* cut = cond->
GetCut(kTRUE);
1366 TCutG* cut = cond->
GetCut(kFALSE);
1371 cut->SetPoint(0, x, y);
1383 cond->SetFillStyle(3002);
1391 if (maincond!=0) maincond->
SetChanged(kTRUE);
1404 gROOT->SetEditorMode(
"");
1407 QString name = QString(
"Label ") + QString::number(ix + 1);
1409 QString txt = QInputDialog::getText(
this,
1410 "Enter new LaTeX label text:", name, QLineEdit::Normal,
1411 QString::null, &ok);
1412 if (ok && (txt.length() > 0)) {
1413 TLatex* latex =
new TLatex(x, y, name.toLatin1().constData());
1414 latex->SetName(name.toLatin1().constData());
1415 latex->SetTitle(txt.toLatin1().constData());
1438 gROOT->SetEditorMode(
"");
1441 TArrow* arrow =
new TArrow(x, y, x, y, 0.02);
1454 std::cout <<
"TGo4ViewPanel:MouseClick() NEVER COME HERE" << std::endl;
1506 bool needredraw =
false;
1507 bool needupdate =
false;
1508 bool needrefresh =
false;
1509 bool docheck =
false;
1533 bool delcond =
true;
1534 TCutG* cut = cond->
GetCut(kFALSE);
1536 int n = cut->GetN();
1538 cut->GetPoint(0, x, y);
1542 cut->SetPoint(n, x, y);
1547 cond->SetFillStyle(3002);
1550 if (delcond && candelete) {
1641 TPad* pad =
dynamic_cast<TPad*
>(obj);
1647 if ((strcmp(cmdname,
"UnZoom") == 0) && obj->InheritsFrom(TAxis::Class())) {
1671 TH1* framehisto = hs->GetHistogram();
1672 if (framehisto == 0)
continue;
1674 if (framehisto->GetXaxis() != obj)
continue;
1676 TIter next(hs->GetHists());
1678 while ((hs_h1 = (TH1*) next()) != 0)
1679 hs_h1->GetXaxis()->UnZoom();
1682 }
while (iter.
next());
1711 Int_t npts = markers.GetEntries();
1716 TArrayD x(npts), y(npts);
1718 for (Int_t j = 0; j < npts; ++j) {
1721 std::cout <<
"NEVER COME HERE: no marker at index " << j << std::endl;
1724 x[j] = mark->GetX();
1725 y[j] = mark->GetY();
1730 TString grname =
GetPanelName() + TString(
"-Markergraph");
1731 TGraph* graf =
new TGraph(npts, x.GetArray(), y.GetArray());
1732 graf->SetName(grname.Data());
1733 graf->SetMarkerStyle(28);
1741 if ((padopt == 0) || (slot == 0))
return;
1756 for (
int n = 0; n < slot->
NumChilds(); n++) {
1767 if (dynamic_cast<TLatex*>(obj) || dynamic_cast<TF1*>(obj)) {
1769 if (dynamic_cast<TGo4ObjectProxy*>(subslot->
GetProxy())) {
1772 }
else if (dynamic_cast<TGo4LinkProxy*>(subslot->
GetProxy())) {
1777 TGo4Log::Error(
"MakePictureForPad NEVER COME HERE, unknown proxy type");
1804 if (nm!=0) pic->
AddObjName(nm->GetName(), drawopt);
1807 Int_t rebinx, rebiny;
1808 if (subslot->
GetIntPar(
"::HasRebinX", rebinx))
1810 if (subslot->
GetIntPar(
"::HasRebinY", rebiny))
1816 for (
int n = 0; n < slot->
NumChilds(); n++) {
1822 if (pads.GetLast() < 0)
1826 int xcnt = 0, sizex = 1, sizey = 1;
1827 for (
int n = 0; n <= pads.GetLast(); n++) {
1828 TPad* subpad = (TPad*) pads.At(n);
1829 double mitx = subpad->GetXlowNDC() + subpad->GetWNDC() / 2.;
1841 while (sizex * sizey <= pads.GetLast())
1846 for (
int ny = 0; ny < sizey; ny++)
1847 for (
int nx = 0; nx < sizex; nx++) {
1848 int indx = ny * sizex + nx;
1849 if (indx > pads.GetLast())
1851 TPad* subpad = (TPad*) pads.At(indx);
1859 if (dlg.exec() != QDialog::Accepted)
1864 QString outfile =
"~/go4printout.ps";
1867 QString DelCmd = QString(
"rm -f ") + outfile;
1869 GetCanvas()->Print(outfile.toLatin1().constData());
1870 gSystem->Exec(PrnCmd.toLatin1().constData());
1871 gSystem->Exec(DelCmd.toLatin1().constData());
1876 #ifndef __NOGO4GED__
1883 #if QT_VERSION > QT_VERSION_CHECK(5,6,0)
1885 double scalefactor=(double) metric(QPaintDevice::PdmDevicePixelRatioScaled)/65536.;
1886 EditorFrame->setMinimumWidth( EditorFrame->minimumWidth()/scalefactor);
1890 fxPeditor = TVirtualPadEditor::LoadEditor();
1909 for (
int n = 0; n < padslot->
NumChilds(); n++) {
1915 if (itemname != 0) {
1924 if (pad == 0)
return;
1926 double defleft =gStyle->GetPadLeftMargin();
1927 double defright =gStyle->GetPadRightMargin();
1928 double deftop =gStyle->GetPadTopMargin();
1929 double defbottom =gStyle->GetPadBottomMargin();
1931 double dx = fabs(pad->AbsPixeltoX(1) - pad->AbsPixeltoX(0));
1932 double dy = fabs(pad->AbsPixeltoY(1) - pad->AbsPixeltoY(0));
1934 if ((dx <= 0) || (dy <= 0))
return;
1935 double ratio = dx / dy;
1937 if(fabs(1.0-ratio) < 1.0E-3)
1946 double left = pad->GetLeftMargin();
1947 double right = pad->GetRightMargin();
1948 double change = (1. - left - right) * (1 - ratio);
1950 double newleft=left + change / 2.;
1951 double newright=right + change / 2.;
1952 double newtop= pad->GetTopMargin();
1953 double newbottom= pad->GetBottomMargin();
1956 double shrink=newtop- deftop;
1957 if(shrink>newleft-defleft) shrink=newleft-defleft;
1958 if(shrink>newright-defright) shrink=newright-defright;
1961 newtop=newtop-shrink;
1962 newbottom=newbottom-shrink;
1963 newleft=newleft-shrink;
1964 newright=newright-shrink;
1969 pad->SetLeftMargin(newleft);
1970 pad->SetRightMargin(newright);
1971 pad->SetTopMargin(newtop);
1972 pad->SetBottomMargin(newbottom);
1975 double bottom = pad->GetBottomMargin();
1976 double top = pad->GetTopMargin();
1977 double change = (1. - bottom - top) * (1. - 1 / ratio);
1979 double newleft=pad->GetLeftMargin();
1980 double newright=pad->GetRightMargin();
1981 double newtop= top + change / 2.;
1982 double newbottom= bottom + change / 2.;
1985 double shrink=newleft - defleft;
1986 if(shrink>newtop-deftop) shrink=newtop-deftop;
1987 if(shrink>newbottom-defbottom) shrink=newbottom-defbottom;
1989 newtop=newtop - shrink;
1990 newbottom=newbottom -shrink;
1991 newleft=newleft- shrink;
1992 newright=newright - shrink;
1997 pad->SetTopMargin(newtop);
1998 pad->SetBottomMargin(newbottom);
1999 pad->SetLeftMargin(newleft);
2000 pad->SetRightMargin(newright);
2006 if (pad == 0)
return;
2007 pad->SetLeftMargin(gStyle->GetPadLeftMargin());
2008 pad->SetRightMargin(gStyle->GetPadRightMargin());
2009 pad->SetTopMargin(gStyle->GetPadTopMargin());
2010 pad->SetBottomMargin(gStyle->GetPadBottomMargin());
2086 if (selected != wasselected) {
2123 bool setdefaults =
false;
2129 slot = parent->
FindChild(pad->GetName());
2144 bool issubpads =
false;
2146 bool isdupluicate =
false;
2152 isdupluicate =
false;
2153 TIter iter(pad->GetListOfPrimitives());
2155 while ((obj = iter()) != 0) {
2156 TPad* subpad =
dynamic_cast<TPad*
>(obj);
2160 if (subpads.FindObject(subpad->GetName()) != 0)
2161 isdupluicate =
true;
2163 subpads.Add(subpad);
2166 pad->GetListOfPrimitives()->RemoveAll(&subpads);
2172 }
while (isdupluicate);
2175 for (
int n = slot->
NumChilds() - 1; n >= 0; n--) {
2179 if (pad->GetListOfPrimitives()->FindObject(subpad) == 0)
2191 TIter iter(pad->GetListOfPrimitives());
2192 TObjArray removedItems;
2194 while ((obj = iter()) != 0) {
2195 TPad* subpad =
dynamic_cast<TPad*
>(obj);
2199 removedItems.Add(obj);
2202 pad->GetListOfPrimitives()->RemoveAll(&removedItems);
2209 TObject* obj,
bool owner,
const char* drawopt)
2214 if (owner)
delete obj;
2228 if ((cl != 0) && cl->InheritsFrom(TGo4Condition::Class()))
2236 tgtslot =
AddNewSlot(brslot->GetName(), padslot);
2245 QString newslotname = itemname;
2246 if ((newslotname.length() == 0)
2247 || (padslot->
FindChild(newslotname.toLatin1().constData()) != 0)) {
2250 if ((itemname == 0) || (*itemname == 0))
2251 newslotname =
"::SpecialObject_";
2253 newslotname = itemname;
2254 newslotname += QString::number(cnt++);
2255 }
while (padslot->
FindChild(newslotname.toLatin1().constData()) != 0);
2257 tgtslot =
AddNewSlot(newslotname.toLatin1().constData(), padslot);
2261 if (tgtslot == 0)
return 0;
2266 tgtslot->
SetPar(
"::FirstDraw",
"true");
2274 if ((kind < 100) && (drawopt != 0))
2285 return slot == 0 ? 0 : slot->
FindChild(name);
2314 for (
int n = 0; n < padslot->
NumChilds(); n++) {
2329 if ((slot == 0) || (objs == 0))
2332 for (
int n = 0; n < slot->
NumChilds(); n++) {
2337 if ((kind !=
kind_Link) && ((selectkind < 0) || (kind == selectkind))) {
2350 if ((slot == 0) || (padopt == 0))
2355 for (
int n = slot->
NumChilds() - 1; n >= 0; n--) {
2361 && ((kindtodelete < 0) || (kind == kindtodelete))) {
2396 if ((pad == 0) || (pic == 0) || (padslot == 0))
2399 bool optchanged =
false;
2400 TObjLink* link = pad->GetListOfPrimitives()->FirstLink();
2403 const char* clname = link->GetObject()->ClassName();
2404 if ((strcmp(clname,
"TFrame") == 0) || (strcmp(clname,
"TLegend") == 0)) {
2411 link = link->Next();
2419 TString newopt(link->GetOption());
2427 if (!oldopt.Contains(
"asimage"))
2428 if ((newopt.Length() != oldopt.Length())
2429 || (newopt.CompareTo(oldopt, TString::kIgnoreCase) != 0)) {
2434 TH1* h1 =
dynamic_cast<TH1*
>(link->GetObject());
2437 TGraph* gr=
dynamic_cast<TGraph*
> (link->GetObject());
2438 if(gr) h1=gr->GetHistogram();
2443 dynamic_cast<TPaveStats*
>(h1->GetListOfFunctions()->FindObject(
"stats"));
2444 if (h1->TestBit(TH1::kNoStats)) {
2451 TAxis* xax = h1->GetXaxis();
2477 dynamic_cast<TPaveText*
>(pad->GetListOfPrimitives()->FindObject(
"title"));
2483 TObjArray objs, objslots;
2492 TObjArray* objs, TObjArray* objslots)
2497 if ((pad != 0) && (pic != 0))
2498 if (padslot->
GetPar(
"::DrawOptAssigned") != 0) {
2500 }
else if (!onlyscan) {
2502 padslot->
SetPar(
"::DrawOptAssigned",
"1");
2505 if ((padslot == 0) || (pic == 0) || (objs == 0) || (objslots == 0))
2508 for (
int n = 0; n <= objs->GetLast(); n++) {
2509 TObject* obj = objs->At(n);
2512 if ((obj == 0) || (subslot == 0))
2515 if (subslot->
GetPar(
"::DrawOptAssigned") != 0) {
2517 }
else if (!onlyscan) {
2519 subslot->
SetPar(
"::DrawOptAssigned",
"1");
2525 TObjArray* objslots,
int modifier)
2530 if ((slot == 0) || (objs == 0))
2533 TObjArray mainslots;
2535 int lastobjtype = 0;
2537 for (
int n = 0; n < slot->
NumChilds(); n++) {
2551 if (obj->InheritsFrom(TH1::Class()))
2553 else if (obj->InheritsFrom(TGraph::Class()))
2555 else if (obj->InheritsFrom(TMultiGraph::Class()))
2557 else if (obj->InheritsFrom(THStack::Class()))
2563 lastobjtype = objtype;
2564 mainslots.Add(subslot);
2568 Bool_t deletesomething = kFALSE;
2570 for (
int n = 0; n <= mainslots.GetLast(); n++) {
2574 if (obj->InheritsFrom(TH1::Class()))
2576 else if (obj->InheritsFrom(TGraph::Class()))
2578 else if (obj->InheritsFrom(TMultiGraph::Class()))
2580 else if (obj->InheritsFrom(THStack::Class()))
2586 if ((n < mainslots.GetLast())
2587 && ((modifier == 2) || ((modifier == 1) && (lastobjtype != objtype)))) {
2589 deletesomething = kTRUE;
2593 objslots->Add(subslot);
2603 if (deletesomething)
2606 for (
int n = 0; n < slot->
NumChilds(); n++) {
2615 objslots->Add(subslot);
2622 if (indx<0) indx = 0;
2624 switch (indx % 10) {
2625 case 0:
return kBlack;
2626 case 1:
return kRed;
2627 case 2:
return kGreen;
2628 case 3:
return kBlue;
2629 case 4:
return kCyan;
2630 case 5:
return kOrange;
2631 case 6:
return kSpring;
2632 case 7:
return kViolet;
2633 case 8:
return kPink;
2634 case 9:
return kAzure;
2643 TObjArray * objslots,
bool showitems)
2645 if ((sislot == 0) || (objs == 0) || (padopt == 0))
return 0;
2648 Bool_t ishstack = kFALSE;
2649 Bool_t isgstack = kFALSE;
2650 Bool_t iserror = kFALSE;
2651 Bool_t resetcolors = kFALSE;
2653 for (
int n = 0; n <= objs->GetLast(); n++) {
2654 TObject* obj = objs->At(n);
2655 if (obj->InheritsFrom(TH1::Class()))
2657 else if (obj->InheritsFrom(TGraph::Class()))
2664 if (iserror || (ishstack && isgstack)) {
2665 TGo4Log::Error(
"Superimpose of multiple objects with different types");
2666 std::cout<<
"Superimpose of multiple objects with different types"<< std::endl;
2671 THStack* hs =
dynamic_cast<THStack*
>(oldobj);
2674 hs =
new THStack(objs->First()->GetName(), objs->First()->GetTitle());
2676 resetcolors = kTRUE;
2679 hs->GetHists()->Clear();
2682 for (
int n = 0; n <= objs->GetLast(); n++) {
2683 TH1* histo = (TH1*) objs->At(n);
2687 Int_t objindx = padslot->
GetIndexOf(objslot);
2698 histo->GetXaxis()->UnZoom();
2706 hs->Add(histo, drawopt);
2709 }
else if (isgstack) {
2710 TMultiGraph* mgr =
dynamic_cast<TMultiGraph*
>(oldobj);
2712 mgr =
new TMultiGraph(objs->First()->GetName(),
2713 objs->First()->GetTitle());
2715 resetcolors = kTRUE;
2716 }
else if (mgr->GetListOfGraphs()) {
2717 mgr->GetListOfGraphs()->Clear();
2720 for (
int n = 0; n <= objs->GetLast(); n++) {
2721 TGraph* gr = (TGraph*) objs->At(n);
2727 if (drawopt.Length() == 0)
2729 if (drawopt.Length() == 0)
2735 if (n > 0) drawopt.ReplaceAll(
"a",
"");
2737 Bool_t first_draw = objslot->
GetPar(
"::FirstDraw") != 0;
2739 Int_t objindx = padslot->
GetIndexOf(objslot);
2744 gr->SetLineColor(nextcol);
2745 gr->SetMarkerColor(nextcol);
2750 if (first_draw && (n==0)) {
2751 TAxis *ax = gr->GetXaxis();
2752 if ((ax!=0) && ax->GetTimeDisplay()) {
2761 mgr->Add(gr, drawopt.Data());
2766 if ((ishstack || isgstack) && (legslot != 0)) {
2770 double miny = 0.94 - 0.03 * objs->GetLast();
2771 if (miny < 0.6) miny = 0.6;
else if (miny>0.92) miny = 0.92;
2772 legend =
new TLegend(0.6, miny, 0.95, 0.99);
2773 legend->SetBorderSize(2);
2774 legend->SetName(
"fitlegend");
2779 for(
int n=0;n<=objs->GetLast();n++) {
2780 TObject* stob = objs->At(n);
2782 const char* objname = stob->GetName();
2784 if (showitems && (objslots!=0)) {
2786 if (itemname!=0) objname = itemname;
2789 TString ldrawopt =
"l";
2795 if (drawopt.Contains(
"l")) ldrawopt+=
"l";
2796 if (drawopt.Contains(
"p")) ldrawopt+=
"p";
2799 if (ldrawopt.Length()==0) ldrawopt =
"l";
2801 legend->AddEntry(stob, objname, ldrawopt.Data());
2813 if ((pad == 0) || (padslot == 0))
return;
2818 if ((numX > 1) || (numY > 1)) {
2819 pad->Divide(numX, numY);
2834 tgtslot =
new TGo4Slot(padslot,
"::ThisPad",
"Special object");
2848 while (iter.
next()) {
2871 for (
int n = 0; n < padslot->
NumChilds(); n++)
2900 while (iter.
next()) {
2924 while (iter.
next()) {
2947 while (iter.
next()) {
2957 if ((pad == 0) || (slot == 0) || (obj == 0))
2960 for (
int n = 0; n < slot->
NumChilds(); n++) {
2970 return padslot == 0 ? 0 : padslot->
FindChild(
"::Superimpose");
2976 if ((pad == 0) || (slot == 0))
2979 for (
int n = 0; n < slot->
NumChilds(); n++) {
2999 return fxQCanvas->getCanvas();
3020 tgtslot =
new TGo4Slot(padslot,
"::PadOptions",
"Pad options slot");
3045 if ((pad == 0) || (padslot == 0))
3059 if (obj->InheritsFrom(TH1::Class()))
3062 if (obj->InheritsFrom(TGraph::Class())) {
3063 TGraph* gr =
dynamic_cast<TGraph*
>(obj);
3065 return gr->GetHistogram();
3068 if (obj->InheritsFrom(THStack::Class())) {
3069 THStack* hs =
dynamic_cast<THStack*
>(obj);
3071 return hs->GetHistogram();
3074 if (obj->InheritsFrom(TMultiGraph::Class())) {
3075 TMultiGraph* mg =
dynamic_cast<TMultiGraph*
>(obj);
3077 if (mg->GetHistogram())
3078 return mg->GetHistogram();
3081 TIter iter(mg->GetListOfGraphs());
3082 while ((gr = (TGraph*) iter()) != 0)
3083 if (gr->GetHistogram())
3084 return gr->GetHistogram();
3114 TObjArray objs, objslots;
3117 Int_t nselectitem = 0;
3121 if ((selected > objs.GetLast())
3135 QString fulllist =
"";
3136 QString selslotname =
"";
3138 for (
int n = 0; n <= objslots.GetLast(); n++) {
3144 QString subslotname = subslot->GetName();
3145 if (n == selected) {
3146 subslotname = QString(
"[") + subslotname + QString(
"]");
3147 selslotname = subslotname;
3149 if (n > 0) fulllist +=
", ";
3150 fulllist += subslotname;
3154 && (selected < objslots.GetLast())) {
3157 QString(
"Show ") + selslotname + QString(
" on top"),
3162 fulllist = QString(
"[") + fulllist + QString(
"]");
3166 if (nselectitem > 0) {
3173 if (fulllist.length() > 0) {
3178 if (capt.length() > 60) {
3184 setWindowTitle(capt);
3202 slot->
SetPar(
"::DrawOpt", drawopt);
3212 if (!slot->
GetIntPar(
"::DrawKind", kind))
3219 return (slot == 0) ? 0 : slot->
GetPar(
"::DrawOpt");
3225 slot->
SetIntPar(
"::SelectedObject", indx);
3233 if (!slot->
GetIntPar(
"::SelectedObject", indx))
3242 if ((slot == 0) || (padopt == 0))
3254 TObjArray objs, objslots;
3257 if (objs.GetLast() < 0)
3260 if ((indx > objs.GetLast()) || (indx < 0))
3271 return objs.At(indx);
3278 if ((slot == 0) || (padopt == 0))
3283 TObjArray objs, objslots;
3287 if ((objs.GetLast() <= 0) || (indx == objs.GetLast()))
3303 if ((pad == 0) || (padslot == 0))
return;
3305 TObjArray objs, objslots;
3309 if (indx < 0) indx = 0;
3311 TH1* selhisto =
dynamic_cast<TH1*
>((indx <= objs.GetLast()) ? objs.At(indx) : 0);
3315 for (
int n = 0; n < padslot->
NumChilds(); n++) {
3319 if (obj == 0)
continue;
3326 if (obj->InheritsFrom(TGo4Condition::Class()))
3328 else if (obj->InheritsFrom(TGo4Marker::Class()))
3341 if (objs.FindObject(oldhisto) == 0)
3361 setWindowTitle(mycaption);
3368 if ((pad == 0) || (padslot == 0))
3378 for (
int n = 0; n < padslot->
NumChilds(); n++) {
3388 if ((kind < 0) || (kind >= 100))
3392 if (obj->InheritsFrom(TGo4Condition::Class())) {
3397 cond->SetFillStyle(3444);
3402 if (obj->InheritsFrom(TLatex::Class())) {
3407 if (obj->InheritsFrom(TF1::Class())) {
3418 canv =
dynamic_cast<TCanvas*
>(obj);
3449 TVirtualPad* padsav = gPad;
3462 if ((pad == 0) || (pic == 0))
return;
3470 for (Int_t posy = 0; posy < pic->
GetDivY(); posy++)
3471 for (Int_t posx = 0; posx < pic->
GetDivX(); posx++) {
3475 (TPad*) pad->GetPad(posy * pic->
GetDivX() + posx + 1),
3539 while ((obj = iter()) != 0) {
3540 Option_t* drawopt = iter.GetOption();
3541 if (dynamic_cast<TArrow*>(obj) != 0)
3543 else if (dynamic_cast<TLatex*>(obj) != 0)
3545 else if (dynamic_cast<TGo4Marker*>(obj) != 0)
3547 else if (dynamic_cast<TGo4WinCond*>(obj) != 0)
3549 else if (dynamic_cast<TGo4PolyCond*>(obj) != 0)
3551 else if (dynamic_cast<TPaveLabel*>(obj) != 0)
3553 drawopt ? drawopt :
"br");
3563 const char* srcpaditemname)
3565 if ((tgtpad == 0) || (srcpad == 0))
return;
3571 if ((padopt == 0) || (padslot == 0))
return;
3573 tgtpad->SetTickx(srcpad->GetTickx());
3574 tgtpad->SetTicky(srcpad->GetTicky());
3575 tgtpad->SetGridx(srcpad->GetGridx());
3576 tgtpad->SetGridy(srcpad->GetGridy());
3577 tgtpad->SetBorderSize(srcpad->GetBorderSize());
3578 tgtpad->SetBorderMode(srcpad->GetBorderMode());
3579 srcpad->TAttLine::Copy(*tgtpad);
3580 srcpad->TAttFill::Copy(*tgtpad);
3581 srcpad->TAttPad::Copy(*tgtpad);
3583 tgtpad->SetPhi(srcpad->GetPhi());
3584 tgtpad->SetTheta(srcpad->GetTheta());
3586 int nsubpads = 0, nmain = 0, mainkind = 0;
3587 TObjLink* link = srcpad->GetListOfPrimitives()->FirstLink();
3589 TObject* obj = link->GetObject();
3590 const char* drawopt = link->GetOption();
3596 TPad* srcsubpad =
dynamic_cast<TPad*
>(obj);
3598 TString itemname = TString::Format(
"%s/%s", srcpaditemname,
3601 if (srcsubpad != 0) {
3603 QString subpadname = tgtpad->GetName();
3605 subpadname += QString::number(nsubpads);
3607 Double_t xlow, ylow, xup, yup;
3609 srcsubpad->GetPadPar(xlow, ylow, xup, yup);
3612 TPad* tgtsubpad =
new TPad(subpadname.toLatin1().constData(),
3613 srcsubpad->GetName(), xlow, ylow, xup, yup);
3614 tgtsubpad->SetNumber(nsubpads);
3622 }
else if (dynamic_cast<TGo4Condition*>(obj) != 0) {
3626 }
else if (dynamic_cast<TGo4Marker*>(obj) != 0) {
3630 }
else if (dynamic_cast<TLatex*>(obj) != 0) {
3633 }
else if (dynamic_cast<TPaveLabel*>(obj) != 0) {
3635 kTRUE, drawopt ? drawopt :
"br");
3636 }
else if (dynamic_cast<TArrow*>(obj) != 0) {
3641 if (dynamic_cast<TH1*>(obj) != 0) {
3646 if (dynamic_cast<TGraph*>(obj) != 0) {
3648 h1 = ((TGraph*) obj)->GetHistogram();
3651 if (dynamic_cast<THStack*>(obj) != 0) {
3653 h1 = ((THStack*) obj)->GetHistogram();
3656 if (dynamic_cast<TMultiGraph*>(obj) != 0) {
3658 h1 = ((TMultiGraph*) obj)->GetHistogram();
3665 if ((kind > 0) && ((mainkind == 0) || (kind == mainkind) && (kind < 3))) {
3674 if ((h1 != 0) && (nmain == 0)) {
3676 Int_t ndim = h1->GetDimension();
3683 Double_t selmin = h1->GetMinimum();
3684 Double_t selmax = h1->GetMaximum();
3686 if (selmin < selmax)
3687 padopt->
SetRange(ndim, selmin, selmax);
3690 !h1->TestBit(TH1::kIsZoomed) || (selmin >= selmax));
3697 link = link->Next();
3719 fxQCanvas->HandleInput(kButton1Up, 0, 0);
3720 fxQCanvas->HandleInput(kMouseMotion, 0, 0);
3722 gROOT->SetEscape(kFALSE);
3729 Bool_t oldmodified=gPad->IsModified();
3732 dummy.ExecuteEvent(kButton1Up, 0, 0);
3733 gPad->Modified(oldmodified);
3737 bool isanychildmodified =
false;
3738 bool ispadupdatecalled =
false;
3740 QTime starttm = QTime::currentTime();
3757 if (isanychildmodified) {
3759 ispadupdatecalled =
true;
3762 int delay = starttm.msecsTo(QTime::currentTime());
3763 intime = (delay >= 0) && (delay < 100);
3765 }
while (!force && isanychildmodified && intime);
3773 if (!ispadupdatecalled)
3780 if (!force && isanychildmodified)
3787 if (slot == 0)
return false;
3790 if (padopt == 0)
return false;
3792 bool ischilds =
false;
3793 bool ischildmodified =
false;
3800 Int_t lastdrawnpad = 0;
3802 if (!slot->
GetIntPar(
"::LastDrawnPad", lastdrawnpad))
3805 Int_t subpadindx = 0;
3808 for (
int n = 0; n < slot->
NumChilds(); n++) {
3809 subpadindx = (n + lastdrawnpad) % slot->
NumChilds();
3811 if (subpad == 0)
continue;
3814 ischildmodified =
true;
3819 if (!force && ischildmodified)
3820 slot->
SetIntPar(
"::LastDrawnPad", subpadindx);
3825 return ischildmodified;
3833 if (ischilds)
return ischildmodified;
3842 TObjArray objs, objslots;
3853 if (objs.GetLast() < 0) {
3868 TObject* drawobj = 0;
3871 Bool_t dosuperimpose = objs.GetLast() > 0;
3875 Bool_t doasiimage = (drawopt != 0) && !dosuperimpose &&
3876 objs.Last()->InheritsFrom(TH2::Class());
3878 doasiimage = TString(drawopt).Contains(
"asimage");
3880 if (dosuperimpose) {
3882 sislot =
new TGo4Slot(slot,
"::Superimpose",
"place for superimpose object");
3885 legslot =
new TGo4Slot(slot,
"::Legend",
"place for legends object");
3895 dosuperimpose = kFALSE;
3898 if (!dosuperimpose) {
3907 drawobj = objs.Last();
3911 asihisto =
dynamic_cast<TH2*
>(drawobj);
3916 asislot =
new TGo4Slot(slot,
"::ASImage",
"place for Go4 ASI image");
3922 updatecontent =
true;
3940 bool first_draw = (slot->
GetPar(
"::PadFirstDraw") == 0);
3941 if (first_draw) slot->
SetPar(
"::PadFirstDraw",
"true");
3943 if (drawobj->InheritsFrom(TH1::Class())) {
3944 TH1* h1 = (TH1*) drawobj;
3945 h1->SetBit(kCanDelete, kFALSE);
3947 }
else if (drawobj->InheritsFrom(THStack::Class())) {
3948 THStack* hs = (THStack*) drawobj;
3949 RedrawStack(pad, padopt, hs, dosuperimpose, updatecontent);
3950 }
else if (drawobj->InheritsFrom(TGraph::Class())) {
3951 TGraph* gr = (TGraph*) drawobj;
3952 RedrawGraph(pad, padopt, gr, updatecontent, first_draw);
3953 }
else if (drawobj->InheritsFrom(TMultiGraph::Class())) {
3954 TMultiGraph* mg = (TMultiGraph*) drawobj;
3956 }
else if (dynamic_cast<TGo4ASImage*>(drawobj) != 0) {
3958 RedrawImage(pad, padopt, ai, asihisto, updatecontent);
3975 if ((pad == 0) || (padopt == 0) || (his == 0))
return;
3981 if (drawopt.Length() == 0)
3982 if (his->GetDimension() == 1)
3984 else if (his->GetDimension() == 2)
3986 else if (his->GetDimension() == 3)
4001 if (nlvl > 0) his->SetContour(nlvl);
4004 his->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4005 his->Draw(drawopt.Data());
4011 bool dosuperimpose,
bool scancontent)
4013 if ((pad == 0) || (padopt == 0) || (hs == 0))
return;
4016 TIter iter(hs->GetHists());
4019 while ((h1 = (TH1*) iter()) != 0) {
4029 if (drawopt.Length() == 0)
4034 hs->Draw(drawopt.Data());
4035 TH1* framehisto = hs->GetHistogram();
4036 if (framehisto == 0)
return;
4038 framehisto->SetStats(
false);
4039 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4040 TH1* h1 =
dynamic_cast<TH1*
>(hs->GetHists() ? hs->GetHists()->First() : 0);
4042 hs->SetTitle(h1->GetTitle());
4043 framehisto->SetTitle(h1->GetTitle());
4044 framehisto->GetXaxis()->SetTitle(h1->GetXaxis()->GetTitle());
4045 framehisto->GetYaxis()->SetTitle(h1->GetYaxis()->GetTitle());
4046 framehisto->GetZaxis()->SetTitle(h1->GetZaxis()->GetTitle());
4054 if ((pad == 0) || (padopt == 0) || (gr == 0))
return;
4058 gr->SetEditable(kFALSE);
4065 TAxis *ax = gr->GetXaxis();
4066 if ((ax!=0) && ax->GetTimeDisplay()) {
4070 if (drawopt.Length() == 0) {
4089 if (drawopt.Length() == 0)
4092 TH1* framehisto = gr->GetHistogram();
4093 if (framehisto == 0) {
4094 gr->Draw(drawopt.Data());
4095 framehisto = gr->GetHistogram();
4097 if (framehisto != 0) {
4099 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4101 gr->Draw(drawopt.Data());
4107 TMultiGraph * mg,
bool dosuperimpose,
bool scancontent)
4109 if ((pad == 0) || (padopt == 0) || (mg == 0))
return;
4111 TIter iter(mg->GetListOfGraphs());
4112 TGraph *gr(0), *firstgr(0);
4114 while ((gr = (TGraph*) iter()) != 0) {
4116 gr->SetEditable(kFALSE);
4126 if (drawopt.Length() == 0)
4131 TH1* framehisto = (dosuperimpose && (firstgr != 0)) ? firstgr->GetHistogram() : mg->GetHistogram();
4133 if (framehisto == 0) {
4135 mg->Draw(drawopt.Data());
4136 framehisto = (dosuperimpose && (firstgr != 0)) ? firstgr->GetHistogram() : mg->GetHistogram();
4139 if (framehisto == 0) {
4140 TGo4Log::Error(
"Internal problem with MultiGraph drawing - cannot access frame histo");
4147 Double_t miny, maxy, selmin, selmax;
4150 if (maxy <= 0) maxy = 1.;
4151 if ((miny <= 0) || (miny >= maxy)) {
4153 if (miny > 1.) miny = 1.;
4156 maxy *= ((maxy>0) ? 1.1 : 0.9);
4157 miny *= ((miny>0) ? 0.9 : 1.1);
4159 framehisto->SetMaximum(maxy);
4160 framehisto->SetMinimum(miny);
4163 framehisto->SetStats(kFALSE);
4164 framehisto->SetBit(TH1::kNoTitle, !padopt->
IsHisTitle());
4168 mg->SetTitle(firstgr->GetTitle());
4169 framehisto->SetTitle(firstgr->GetTitle());
4170 framehisto->GetXaxis()->SetTitle(firstgr->GetXaxis()->GetTitle());
4171 framehisto->GetYaxis()->SetTitle(firstgr->GetYaxis()->GetTitle());
4174 mg->Draw(drawopt.Data());
4178 TH2* asihisto,
bool scancontent)
4180 if ((pad == 0) || (padopt == 0) || (im == 0))
return;
4189 double uminx, umaxx, uminy, umaxy;
4194 im->SetPaletteEnabled(drawopt.Contains(
"Z"));
4202 if (legslot == 0)
return;
4205 if(legend!=0) legend->Draw();
4210 if ((pad == 0) || (padslot == 0))
4216 TObject* selectedobj = 0;
4217 const char* selectdrawopt = 0;
4219 for (
int n = 0; n < padslot->
NumChilds(); n++) {
4232 if(obj->InheritsFrom(TF1::Class())){
4233 if(!pad->GetListOfPrimitives()->IsEmpty())
4234 drawopt.Append(
"LSAME");
4235 TF1* func =
dynamic_cast<TF1*
>(obj);
4236 Int_t objindx = padslot->
GetIndexOf(subslot);
4237 func->SetLineColor(
GetAutoColor(((objindx+7) % 9) + 1));
4240 if ((selname == obj->GetName()) && (selectedobj == 0)) {
4242 selectdrawopt = drawopt.Data();
4245 obj->Draw(drawopt.Data());
4251 if (selectedobj != 0){
4253 selectedobj->Draw(selectdrawopt ? selectdrawopt :
"");
4279 int value,
const char* drawopt)
4283 if (subopt == 0)
return;
4300 subpad->SetFillColor(value);
4301 if (subpad->GetFrame())
4302 subpad->GetFrame()->SetFillColor(value);
4327 gStyle->SetPalette(value);
4337 if (slot == 0)
return;
4353 if(backup) col=backup->GetFillColor();
4354 pad->SetFillColor((Color_t) col);
4357 TIter iter(pad->GetListOfPrimitives());
4359 while ((obj = iter()) != 0) {
4360 TPad* subpad =
dynamic_cast<TPad*
>(obj);
4361 TFrame* fram =
dynamic_cast<TFrame*
>(obj);
4367 backpad=
dynamic_cast<TPad*
>(backup->GetListOfPrimitives()->FindObject(subpad->GetName()));
4382 TFrame* backframe=
dynamic_cast<TFrame*
>(backup->GetListOfPrimitives()->FindObject(fram->GetName()));
4385 col=backframe->GetFillColor();
4390 fram->SetFillColor((Color_t) col);
4411 if (padslot == 0)
return;
4413 for (
int n = padslot->
NumChilds() - 1; n >= 0; n--) {
4426 if ((slot == 0) || (padopt == 0))
4437 for (
int n = slot->
NumChilds() - 1; n >= 0; n--) {
4451 pad->GetListOfPrimitives()->Remove(subpad);
4455 if (
GetCanvas()->GetSelectedPad() == subpad)
4468 if (pad == 0)
return;
4476 int fiPadcolorR, fiPadcolorG, fiPadcolorB;
4478 int padfillcolor = TColor::GetColor(fiPadcolorR, fiPadcolorG, fiPadcolorB);
4480 if (padfillcolor != 0) {
4487 gVirtualX->GetPlanes(nplanes);
4490 TColor *normal = gROOT->GetColor(padfillcolor);
4493 normal->GetHLS(h, l, s);
4494 const char* cname = normal->GetName();
4496 Float_t dr, dg, db, lr, lg, lb;
4497 TColor *dark = gROOT->GetColor(100 + padfillcolor);
4499 new TColor(100 + padfillcolor, -1, -1, -1,
4500 Form(
"%s%s", cname,
"_dark"));
4501 dark = gROOT->GetColor(100 + padfillcolor);
4503 TColor *light = gROOT->GetColor(150 + padfillcolor);
4505 new TColor(150 + padfillcolor, -1, -1, -1,
4506 Form(
"%s%s", cname,
"_bright"));
4507 light = gROOT->GetColor(150 + padfillcolor);
4511 TColor::HLStoRGB(h, 0.7 * l, s, dr, dg, db);
4514 dark->SetRGB(dr, dg, db);
4516 dark->SetRGB(0.3, 0.3, 0.3);
4520 TColor::HLStoRGB(h, 1.2 * l, s, lr, lg, lb);
4523 light->SetRGB(lr, lg, lb);
4525 light->SetRGB(0.8, 0.8, 0.8);
4528 TGo4Log::Error(
"Internal problem in view panel: Could not assign root shadow colors for number %d", padfillcolor);
4533 pad->SetFillColor(padfillcolor);
4553 QString output = pad->GetName();
4554 output.append(
": ");
4558 output.append(
" SuperImpose:");
4561 output.append(
" All Pads:");
4562 output.append(
" Ready");
4582 if ((xaction == 0) && (yaction == 0) && (zaction == 0)) {
4591 while (iter.
next()) {
4594 if (padopt == 0)
continue;
4601 if ((xaction == 0) && (yaction == 0) && (zaction == 0)) {
4602 padopt->ClearRange();
4603 padopt->SetAutoScale(
true);
4605 padopt->SetPadModified();
4615 if (action <= 0)
return;
4617 double new_umin, new_umax, fmin, fmax, tmin, tmax;
4618 double fact = expandfactor / 100.;
4620 bool sel = padopt->
GetRange(naxis, new_umin, new_umax) && (action!=6);
4627 if (!sel || (new_umin >= new_umax)) { new_umin = fmin; new_umax = fmax; }
4629 double shift = (new_umax - new_umin) * fact;
4631 if (shift <= 0)
return;
4635 if ((new_umax + shift) > fmax)
4636 shift = fmax - new_umax;
4641 if (new_umin - shift < fmin)
4642 shift = new_umin - fmin;
4661 tmax = (-fact * new_umin + (1. - fact) * new_umax)
4663 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4666 tmax = (-fact * new_umin + new_umax) / (1. - fact);
4667 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4673 tmax = (-fact * new_umin + (1. - fact) * new_umax)
4675 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4678 tmax = (-fact * new_umin + new_umax) / (1. - fact);
4679 tmin = (-fact * new_umax + (1. - fact) * new_umin)
4685 if (new_umin < fmin)
4687 if (new_umax > fmax)
4693 TH1* padhist =
dynamic_cast<TH1*
>(padobj);
4695 if (padhist==0)
break;
4697 if (naxis >= ndim)
break;
4699 TAxis* axis = padhist->GetXaxis();
4700 if (naxis==1) axis = padhist->GetYaxis();
4701 if (naxis==2) axis = padhist->GetZaxis();
4704 Int_t sel_l = sel ? axis->GetFirst() : 0;
4705 Int_t sel_r = sel ? axis->GetLast() : axis->GetNbins();
4707 Int_t firstbin(0), lastbin(0);
4710 if ((ndim==1) && (naxis==0)) {
4711 for (Int_t n1 = 1; n1<=padhist->GetNbinsX(); n1++) {
4712 Double_t v = padhist->GetBinContent(n1);
4713 if (TMath::Abs(v)<1e-10)
continue;
4714 if ((n1<sel_l) || (n1>sel_r))
continue;
4716 if (firstbin==0) firstbin = n1;
4721 if ((ndim==2) && (naxis<2))
4722 for (Int_t n1 = 1; n1<=padhist->GetNbinsX(); n1++)
4723 for (Int_t n2 = 1; n2<=padhist->GetNbinsY(); n2++) {
4724 Double_t v = padhist->GetBinContent(n1,n2);
4725 if (TMath::Abs(v)<1e-10)
continue;
4726 Int_t bin = naxis==0 ? n1 : n2;
4727 if ((bin<sel_l) || (bin>sel_r))
continue;
4728 if ((lastbin==0) || (bin>lastbin)) lastbin = bin;
4729 if ((firstbin==0) || (bin<firstbin)) firstbin = bin;
4733 if ((ndim==3) && (naxis<3))
4734 for (Int_t n1 = 1; n1<=padhist->GetNbinsX(); n1++)
4735 for (Int_t n2 = 1; n2<=padhist->GetNbinsY(); n2++)
4736 for (Int_t n3 = 1; n3<=padhist->GetNbinsZ(); n3++) {
4737 Double_t v = padhist->GetBinContent(n1,n2,n3);
4738 if (TMath::Abs(v)<1e-10)
continue;
4739 Int_t bin = naxis==0 ? n1 : ((naxis==1) ? n2 : n3);
4740 if ((bin<sel_l) || (bin>sel_r))
continue;
4741 if ((lastbin==0) || (bin>lastbin)) lastbin = bin;
4742 if ((firstbin==0) || (bin<firstbin)) firstbin = bin;
4747 if (firstbin >= lastbin) { firstbin--; lastbin++; }
4749 if (firstbin<=3) firstbin = 1;
4750 if (lastbin >=axis->GetNbins()-3) lastbin = axis->GetNbins();
4752 Double_t left = axis->GetBinLowEdge(firstbin);
4753 Double_t right = axis->GetBinUpEdge(lastbin);
4755 Double_t margin = (right - left) * fact;
4756 left -= margin; right += margin;
4758 if ((left <= new_umin) && (right >= new_umax))
return;
4760 if (left > new_umin) new_umin = left;
4761 if (right < new_umax) new_umax = right;
4763 if (action==6) axis->SetRange(firstbin,lastbin);
4776 if (padopt->
GetRange(naxis, new_umin, new_umax))
4782 if ((h1 == 0) || (padopt == 0))
return;
4784 TAxis* xax = h1->GetXaxis();
4785 TAxis* yax = h1->GetYaxis();
4786 TAxis* zax = h1->GetZaxis();
4787 int ndim = h1->GetDimension();
4792 xax->GetBinUpEdge(xax->GetNbins()));
4795 yax->GetBinUpEdge(yax->GetNbins()));
4801 zax->GetBinUpEdge(zax->GetNbins()));
4808 Int_t dimindx = (ndim == 1) ? 1 : 2;
4810 Double_t minimum = 0, maximum = 0;
4811 Bool_t first = kTRUE;
4812 if (!isfirsthisto) {
4817 for (Int_t biny = 1; biny <= yax->GetNbins(); biny++)
4818 for (Int_t binx = 1; binx <= xax->GetNbins(); binx++) {
4819 Int_t bin = h1->GetBin(binx, biny);
4820 Double_t value = h1->GetBinContent(bin);
4826 if (value < minimum)
4828 else if (value > maximum)
4837 if ((gr == 0) || (padopt == 0))
return;
4839 Double_t minx(0), maxx(0), miny(0), maxy(0), xx, yy;
4841 if (gr->GetN() > 0) {
4842 gr->GetPoint(0, minx, miny);
4851 for (Int_t n = 0; n < gr->GetN(); n++) {
4852 gr->GetPoint(n, xx, yy);
4874 if ((h1 == 0) || (padopt == 0) || (pad == 0))
return;
4880 double hmin(0.), hmax(0.), umin, umax;
4882 TAxis* ax = h1->GetXaxis();
4889 if (padopt->
GetRange(0, umin, umax)) {
4894 Int_t i1 = ax->FindFixBin(umin);
4895 Int_t i2 = ax->FindFixBin(umax);
4896 if (i1<i2) ax->SetRange(i1,i2);
4897 else { ax->UnZoom(); padopt->
ClearRange(0); }
4902 TAxis* ay = h1->GetYaxis();
4904 if (padopt->
GetRange(1, umin, umax)) {
4905 if (!autoscale && (ndim == 1)) {
4916 Int_t i1 = ay->FindFixBin(umin);
4917 Int_t i2 = ay->FindFixBin(umax);
4918 if (i1<i2) { ay->SetRange(i1,i2); ay = 0; }
4926 if ((ndim==1) && (h1->GetMinimum()==0) && (h1->GetMaximum()==1)) {
4932 TAxis* az = h1->GetZaxis();
4933 if (padopt->
GetRange(2, umin, umax) && (ndim > 1)) {
4934 if (!autoscale && (ndim == 2)) {
4944 Int_t i1 = az->FindFixBin(umin);
4945 Int_t i2 = az->FindFixBin(umax);
4946 if (i1<i2) { az->SetRange(i1,i2); az = 0; }
4959 if (hmax <= 0) hmax = 1.;
4960 if ((hmin <= 0) || (hmin >= hmax)) {
4962 if (hmin > 1.) hmin = 1;
4966 h1->SetMinimum(hmin);
4967 h1->SetMaximum(hmax);
4968 h1->SetBit(TH1::kIsZoomed);
4970 hs->SetMinimum(hmin);
4971 hs->SetMaximum(hmax);
4979 TIter next(hs->GetHists());
4981 while ((hs_h1 = (TH1*) next()) != 0) {
4982 if (padopt->
GetRange(0, umin, umax)) {
4986 TAxis* ax = hs_h1->GetXaxis();
4987 Int_t i1 = ax->FindFixBin(umin);
4988 Int_t i2 = ax->FindFixBin(umax);
4989 if (i1<i2) { ax->SetRange(i1,i2); }
4990 else { ax->UnZoom(); padopt->
ClearRange(0); }
4992 hs_h1->GetXaxis()->UnZoom();
4995 hs_h1->GetYaxis()->UnZoom();
4996 hs_h1->SetMinimum();
4997 hs_h1->SetMaximum();
5007 h1->ResetBit(TH1::kIsZoomed);
5013 Double_t selmin = h1->GetMinimum();
5014 Double_t selmax = h1->GetMaximum();
5016 if (selmin >= selmax) {
5019 bool islogscale = (ndim == 1) && (padopt->
GetLogScale(1) > 0);
5022 if ((selmin > 0) && (selmax > 0)) {
5023 selmin = TMath::Log10(selmin) + TMath::Log10(0.5);
5024 selmin = TMath::Power(10, selmin);
5025 selmax = TMath::Log10(selmax)
5026 + TMath::Log10(2 * (0.9 / 0.95));
5027 selmax = TMath::Power(10, selmax);
5031 Double_t yMARGIN = 0.05;
5032 #if ROOT_VERSION_CODE > ROOT_VERSION(5,0,9)
5033 yMARGIN = gStyle->GetHistTopMargin();
5035 Double_t dymin = yMARGIN * (selmax - selmin);
5036 if ((selmin >= 0) && (selmin - dymin < 0))
5040 selmax += yMARGIN * (selmax - selmin);
5043 padopt->
SetRange(ndim, selmin, selmax);
5050 dynamic_cast<TPaveStats*
>(h1->GetListOfFunctions()->FindObject(
"stats"));
5052 stats =
new TPaveStats(
5053 gStyle->GetStatX()-gStyle->GetStatW(),
5054 gStyle->GetStatY()-gStyle->GetStatH(),
5056 gStyle->GetStatY(),
"brNDC");
5057 stats->SetParent(h1);
5058 stats->UseCurrentStyle();
5059 stats->SetName(
"stats");
5060 h1->GetListOfFunctions()->Add(stats);
5061 stats->ConvertNDCtoPad();
5068 dynamic_cast<TPaveText*
>(pad->GetListOfPrimitives()->FindObject(
"title"));
5071 titl =
new TPaveText(gStyle->GetTitleX()-gStyle->GetTitleW(),
5072 gStyle->GetTitleY()-gStyle->GetTitleH(),
5073 gStyle->GetTitleX(),
5074 gStyle->GetTitleY(),
"blNDC");
5075 titl->UseCurrentStyle();
5076 titl->SetFillColor(gStyle->GetTitleFillColor());
5077 titl->SetFillStyle(gStyle->GetTitleStyle());
5078 titl->SetName(
"title");
5079 titl->SetBorderSize(gStyle->GetTitleBorderSize());
5080 titl->SetTextColor(gStyle->GetTitleTextColor());
5081 titl->SetTextFont(gStyle->GetTitleFont(
""));
5082 if (gStyle->GetTitleFont(
"")%10 > 2)
5083 titl->SetTextSize(gStyle->GetTitleFontSize());
5084 titl->AddText(h1->GetTitle());
5085 titl->SetBit(kCanDelete);
5086 pad->GetListOfPrimitives()->Add(titl);
5087 titl->ConvertNDCtoPad();
5093 TAxis* xax = h1->GetXaxis();
5112 if (padopt == 0)
return false;
5116 if ((naxis < 0) || (naxis > NumDim))
return false;
5118 bool res = padopt->
GetRange(naxis, min, max);
5119 if (!res || (min >= max))
5125 double selmin,
double selmax,
bool force)
5127 if ((selmin == -1.) && (selmax == -1.))
return false;
5129 double min, max, umin, umax;
5132 bool sel = padopt->
GetRange(naxis, umin, umax);
5134 if (!full || (min >= max) || (selmin >= selmax)) {
5139 double delta = (max - min) / 100000.;
5140 bool changed =
false;
5143 if (fabs(umin - selmin) > delta) {
5147 if (fabs(umax - selmax) > delta) {
5157 if ((selmin < min + delta) && (selmax > max - delta) && !force) {
5160 padopt->
SetRange(naxis, umin, umax);
5168 Double_t selmin, selmax;
5171 if (((ax->GetFirst() <= 0) && (ax->GetLast() >= ax->GetNbins() - 1))
5172 || (ax->GetFirst() >= ax->GetLast())) {
5176 selmin = ax->GetBinCenter(ax->GetFirst());
5177 selmax = ax->GetBinCenter(ax->GetLast());
5204 bool iszoomed = h1->TestBit(TH1::kIsZoomed);
5210 Double_t selmin = h1->GetMinimum();
5211 Double_t selmax = h1->GetMaximum();
5214 padopt->
SetRange(ndim, selmin, selmax);
5215 }
else if (selmin >= selmax) {
5219 bool islogscale = (ndim == 1) && (pad->GetLogy() > 0);
5222 if ((selmin > 0) && (selmax > 0)) {
5223 selmin = TMath::Log10(selmin) + TMath::Log10(0.5);
5224 selmin = TMath::Power(10, selmin);
5225 selmax = TMath::Log10(selmax)
5226 + TMath::Log10(2 * (0.9 / 0.95));
5227 selmax = TMath::Power(10, selmax);
5231 Double_t yMARGIN = 0.05;
5232 #if ROOT_VERSION_CODE > ROOT_VERSION(5,0,9)
5233 yMARGIN = gStyle->GetHistTopMargin();
5235 Double_t dymin = yMARGIN * (selmax - selmin);
5236 if ((selmin >= 0) && (selmin - dymin < 0))
5240 selmax += yMARGIN * (selmax - selmin);
5243 padopt->
SetRange(ndim, selmin, selmax);
5252 Double_t rxmin, rxmax, rymin, rymax;
5253 pad->GetRangeAxis(rxmin, rymin, rxmax, rymax);
5255 if (pad->GetLogx() > 0) {
5256 rxmin = TMath::Power(10., rxmin);
5257 rxmax = TMath::Power(10., rxmax);
5260 if (pad->GetLogy() > 0) {
5261 rymin = TMath::Power(10., rymin);
5262 rymax = TMath::Power(10., rymax);
5269 double rymin,
double rymax)
5276 if (padopt == 0)
return;
5285 double& xmax,
double& ymin,
double& ymax,
double& zmin,
double& zmax)
5289 if (padopt == 0)
return;
5303 QCheckBox* box1 = findChild<QCheckBox*>(
"ApplyToAllCheck");
5304 if (box1 != 0) box1->setChecked(on);
5311 bool modified =
false;
5312 bool applytoall =
false;
5313 bool redraw_immediately = (selpad == 0);
5332 while (iter.
next()) {
5337 if (on != padopt->IsAutoScale())
5338 padopt->SetPadModified();
5339 padopt->SetAutoScale(on);
5340 modified = modified || padopt->IsPadModified();
5344 if (modified && redraw_immediately)
5349 double ymax,
double zmin,
double zmax)
5377 while (iter.
next()) {
5382 Int_t ndim = padopt->GetFullRangeDim();
5388 if (!padopt->IsAutoScale()) {
5395 padopt->SetPadModified();
5414 if (slot == 0)
return;
5416 if (padopt == 0)
return;
5431 #ifndef __NOGO4GED__
5432 TGedEditor* ed =
dynamic_cast<TGedEditor*
>(
fxPeditor);
5442 #ifndef __NOGO4GED__
5443 TGedEditor* ed =
dynamic_cast<TGedEditor*
>(
fxPeditor);
5444 if ((ed != 0) && (obj != 0))
5445 if (!obj->InheritsFrom(THStack::Class()) && !obj->InheritsFrom(TMultiGraph::Class())) {
5454 #ifndef __NOGO4GED__
5456 TGedEditor* ed =
dynamic_cast<TGedEditor*
>(
fxPeditor);
5457 if (ed == 0)
return;
5459 fDummyHisto =
new TH1I(
"dummyhisto",
"dummyhisto", 100, -10., 10.);
5466 ed->SetModel(0,
GetCanvas(), kButton1Down);
5527 for (
int n = 0; n < slot->
NumChilds(); n++) {
5546 basename =
"Marker";
5549 basename =
"Window";
5552 basename =
"Polygon";
5561 basename =
"Something";
5568 slotname = basename + QString::number(cnt++);
5569 }
while (padslot->
FindChild(slotname.toLatin1().constData()) != 0);
5582 for (
int n = 0; n < slot->
NumChilds(); n++) {
5585 if (drawkind != kind)
5588 if (subslot != activeslot)
5591 subslot->
SetPar(
"::ActiveMarker",
"1");
5600 if ((kind == selkind) && (selobj != 0))
5607 TObject* lastobj = 0;
5609 for (
int n = 0; n < slot->
NumChilds(); n++) {
5612 if (drawkind != kind)
5616 if (subslot->
GetPar(
"::ActiveMarker") != 0)
5626 return (obj == 0) ? QString(
"null") : QString(obj->GetName());
5637 #if ROOT_VERSION_CODE < ROOT_VERSION(4,0,8)
5640 while (iter.next()) {
5668 QString mycaption = windowTitle();
5669 QString oldtitle = mycaption.remove(
fPanelName +
": ");
5670 QString text = QInputDialog::getText(
this,
GetPanelName(),
5671 "Enter Viewpanel Title:", QLineEdit::Normal, oldtitle, &ok);
5672 if (ok && !text.isEmpty())
5683 QString text = QInputDialog::getText(
this,
GetPanelName(),
5684 "Enter Axis time format:", QLineEdit::Normal, oldfmt, &ok);
5685 if (ok && !text.isEmpty()) {
5697 bool s = act ? act->isChecked() :
false;
virtual void SetMouseMode(int mode)
virtual void ShootRepaintTimer()
virtual TObject * GetDrawObject(TPad *pad, const char *name)
virtual void CheckActionAtTheEnd(TPad *pad)
virtual bool IsPadHasSubPads(TGo4Slot *padslot)
virtual void SwitchMarkerButton(int kind, bool on)
virtual void SetChanged(Bool_t 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()
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)
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)
TVirtualPadEditor * fxPeditor
virtual void ActivateInGedEditor(TObject *obj)
virtual void SetDrawKind(TGo4Slot *slot, int kind)
virtual int GetAutoColor(int indx)
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()
Int_t GetLogScale(Int_t nscale=0)
virtual void RedrawMultiGraph(TPad *pad, TGo4Picture *padopt, TMultiGraph *mg, bool dosuperimpose, bool scancontent)
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()
virtual void SetYRMSDraw(Bool_t on)
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 Option_t * GetDrawOption()
virtual TGo4Slot * GetDrawObjectSlot(TPad *pad, const char *name)
virtual void PadDoubleClickedSlot(TPad *pad)
const char * GetObjName(Int_t n)
const char * NoStackDrawOption
virtual const char * GetPanelName()
virtual bool IsAutoZoomFlag()
Bool_t IsHisStats() const
virtual Bool_t IsXMeanDraw()
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)
void SetValuesDirect(TCutG *newcut)
virtual void SaveCanvas()
TGo4Slot * getslot() const
virtual void ProcessMarkersClear(TPad *pad, bool withsubpads)
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 InfoConditionBtn_clicked()
virtual void AutoScaleToggled(bool)
void SetEditable(bool on=true)
Graphic Qt Widget based Canvas.
virtual void ProducePicture()
virtual const char * GetDrawItemName(int itemcnt=0)
Bool_t GetRangeY(Double_t &min, Double_t &max)
virtual void SetAutoZoomFlag(bool on)
bool fbLeaveFocusAfterCondEnd
virtual TGo4Slot * GetPadMainObjectSlot(TPad *pad)
virtual void CompleteInitialization()
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 Bool_t IsXRMSDraw()
virtual void PadClickedSlot(TPad *pad)
virtual void StartRootEditor()
void ChangeDrawOption(Int_t kind, Int_t value)
virtual void SetYMaxDraw(Bool_t on)
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
virtual void TakeFullRangeFromGraph(TGraph *gr, TGo4Picture *padopt, bool isfirst)
virtual void UpdatePanelCaption()
TCutG * GetCut(Bool_t changeowner)
virtual void ShowEventStatus()
QRootWindow * fxRooteditor
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 Bool_t IsXMaxDraw()
virtual void ProcessCanvasAdopt(TPad *tgtpad, TPad *srcpad, const char *srcitemname)
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 QRootCanvas * GetQCanvas()
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)
bool fbEditorFrameVisible
virtual void MarkPadModified(TPad *pad)
void SetResizeOnPaint(bool on=true)
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 void SelectedMarkerCmb_activated(int indx)
virtual void ClearPad(TPad *pad, bool removeitems, bool removesubpads)
Bool_t GetFrameAttr(TPad *pad)
virtual void SetYMeanDraw(Bool_t on)
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)
static bool IsRootCanvasMenuEnabled()
virtual void SetRegionMode(bool on)
virtual void SetSpecialDrawOption(TGo4Slot *slot, const char *drawopt)
Bool_t GetRange(Int_t naxis, Double_t &min, Double_t &max)
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 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
TGo4Picture * FindPic(Int_t posy, Int_t posx)
virtual int GetSelectedMarkerIndex(TPad *pad)
void SetHisStats(Bool_t on)
QSignalMapper * fSelectMap
virtual void AddMarkerObj(TPad *pad, int kind, TObject *obj)
bool getFetchDataWhenDraw()
virtual int GetDrawKind(TGo4Slot *slot)
virtual void panelSlot(TGo4ViewPanel *panel, TPad *pad, int signalid)
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)
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)
TGo4ViewPanel(QWidget *parent=0, const char *name=0)
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
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)
void SetWorkHistogram(TH1 *histo)
Bool_t IsTitleDate() const
void SetDrawAttributes(TObject *obj, Int_t index=UndefIndex)
static Int_t GetInstances()
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()
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)
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 CanvasStatusEventSlot(const char *message)
virtual void SetDrawOption(Option_t *option="")
virtual void checkResizeSlot()
virtual TCanvas * GetCanvas()
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 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)
void SetHistogramContent(TH2 *histo)
void SetTitleAttr(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t textsize=0.)
virtual int GetMouseMode()
virtual void MenuCommandExecutedSlot(TObject *obj, const char *cmdname)
Bool_t next(Bool_t goesinto=kTRUE)
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