2 #include "TApplication.h"
6 #include "TGSplitter.h"
9 #include "TGeoManager.h"
12 #include "TGStatusBar.h"
13 #include "TGFileDialog.h"
15 #include "TGLPhysicalShape.h"
16 #include "TGLLogicalShape.h"
19 #include "Riostream.h"
21 #include "TGListTree.h"
22 #include "TOrdCollection.h"
27 #include "TEveManager.h"
28 #include "TEveViewer.h"
29 #include "TEveBrowser.h"
30 #include "TEveProjectionManager.h"
31 #include "TEveGeoNode.h"
32 #include "TEveEventManager.h"
33 #include "TEveTrack.h"
34 #include "TEveSelection.h"
36 #include "TRootEmbeddedCanvas.h"
37 #include "TGSplitFrame.h"
38 #include "TGLOverlayButton.h"
39 #include "TGLEmbeddedViewer.h"
40 #include "TGShapedFrame.h"
51 #include <TWin32SplashThread.h>
54 const char *filetypes[] = {
55 "ROOT files", "*.root",
60 const char *rcfiletypes[] = {
65 ////////////////////////////////////////////////////////////////////////////////
66 class TGShapedToolTip : public TGShapedFrame {
69 TGShapedToolTip(const TGShapedToolTip&); // Not implemented
70 TGShapedToolTip& operator=(const TGShapedToolTip&); // Not implemented
73 Int_t fTextX, fTextY, fTextH;
76 TRootEmbeddedCanvas *fEc; // embedded canvas for histogram
77 TH1 *fHist; // user histogram
78 TString fText; // info (as tool tip) text
80 virtual void DoRedraw() {}
83 TGShapedToolTip(const char *picname, Int_t cx=0, Int_t cy=0, Int_t cw=0,
84 Int_t ch=0, Int_t tx=0, Int_t ty=0, Int_t th=0,
85 const char *col="#ffffff");
86 virtual ~TGShapedToolTip();
88 virtual void CloseWindow();
89 void CreateCanvas(Int_t cx, Int_t cy, Int_t cw, Int_t ch);
90 void CreateCanvas(Int_t cw, Int_t ch, TGLayoutHints *hints);
91 TH1 *GetHisto() const { return fHist; }
92 const char *GetText() const { return fText.Data(); }
94 void SetHisto(TH1 *hist);
95 void SetText(const char *text);
96 void SetTextColor(const char *col);
97 void SetTextAttributes(Int_t tx, Int_t ty, Int_t th, const char *col=0);
98 void Show(Int_t x, Int_t y, const char *text = 0, TH1 *hist = 0);
100 ClassDef(TGShapedToolTip, 0) // Shaped composite frame
103 ////////////////////////////////////////////////////////////////////////////////
104 class HtmlObjTable : public TObject {
105 public: // make them public for shorter code
108 Int_t fNValues; // number of values
109 Int_t fNFields; // number of fields
114 TString fHtml; // HTML output code
122 HtmlObjTable(const char *name, Int_t nfields, Int_t nvals, Bool_t exp=kTRUE);
123 virtual ~HtmlObjTable();
125 void SetLabel(Int_t col, const char *label) { fLabels[col] = label; }
126 void SetValue(Int_t col, Int_t row, Float_t val) { fValues[col].SetAt(val, row); }
127 TString Html() const { return fHtml; }
129 ClassDef(HtmlObjTable, 0);
132 ////////////////////////////////////////////////////////////////////////////////
134 public: // make them public for shorter code
136 TOrdCollection *fObjTables; // ->array of object tables
137 TString fHtml; // output HTML string
138 TString fTitle; // page title
139 TString fHeader; // HTML header
140 TString fFooter; // HTML footer
146 HtmlSummary(const char *title);
147 virtual ~HtmlSummary();
149 HtmlObjTable *AddTable(const char *name, Int_t nfields, Int_t nvals,
150 Bool_t exp=kTRUE, Option_t *opt="");
151 HtmlObjTable *GetTable(Int_t at) const { return (HtmlObjTable *)fObjTables->At(at); }
153 void Clear(Option_t *option="");
154 void Reset(Option_t *option="");
155 TString Html() const { return fHtml; }
157 ClassDef(HtmlSummary, 0);
160 ////////////////////////////////////////////////////////////////////////////////
161 class SplitGLView : public TGMainFrame {
165 kFileOpen, kFileExit, kFileLoadConfig, kFileSaveConfig,
166 kHelpAbout, kGLPerspYOZ, kGLPerspXOZ, kGLPerspXOY, kGLXOY,
167 kGLXOZ, kGLZOY, kGLOrthoRotate, kGLOrthoDolly, kSceneUpdate,
168 kSceneUpdateAll, kSummaryUpdate
172 TEvePad *fPad; // pad used as geometry container
173 TGSplitFrame *fSplitFrame; // main (first) split frame
174 TGLEmbeddedViewer *fViewer0; // main GL viewer
175 TGLEmbeddedViewer *fViewer1; // first GL viewer
176 TGLEmbeddedViewer *fViewer2; // second GL viewer
177 TGLEmbeddedViewer *fActViewer; // actual (active) GL viewer
178 static HtmlSummary *fgHtmlSummary; // summary HTML table
179 static TGHtml *fgHtml;
180 TGMenuBar *fMenuBar; // main menu bar
181 TGPopupMenu *fMenuFile; // 'File' popup menu
182 TGPopupMenu *fMenuHelp; // 'Help' popup menu
183 TGPopupMenu *fMenuCamera; // 'Camera' popup menu
184 TGPopupMenu *fMenuScene; // 'Scene' popup menu
185 TGStatusBar *fStatusBar; // status bar
186 TGShapedToolTip *fShapedToolTip; // shaped tooltip
189 TEveViewer *fViewer[3];
190 TEveProjectionManager *fRPhiMgr;
191 TEveProjectionManager *fRhoZMgr;
194 SplitGLView(const TGWindow *p=0, UInt_t w=800, UInt_t h=600, Bool_t embed=kFALSE);
195 virtual ~SplitGLView();
197 void ItemClicked(TGListTreeItem *item, Int_t btn, Int_t x, Int_t y);
198 void HandleMenu(Int_t id);
199 void OnClicked(TObject *obj);
200 void OnMouseIdle(TGLPhysicalShape *shape, UInt_t posx, UInt_t posy);
201 void OnMouseOver(TGLPhysicalShape *shape);
202 void OnViewerActivated();
203 void OpenFile(const char *fname);
204 void SwapToMainView(TGLViewerBase *viewer);
205 void ToggleOrthoRotate();
206 void ToggleOrthoDolly();
207 void UnDock(TGLViewerBase *viewer);
208 void LoadConfig(const char *fname);
209 void SaveConfig(const char *fname);
210 static void UpdateSummary();
212 TEveProjectionManager *GetRPhiMgr() const { return fRPhiMgr; }
213 TEveProjectionManager *GetRhoZMgr() const { return fRhoZMgr; }
215 ClassDef(SplitGLView, 0)
218 TEveProjectionManager *gRPhiMgr = 0;
219 TEveProjectionManager *gRhoZMgr = 0;
221 ClassImp(TGShapedToolTip)
222 ClassImp(HtmlObjTable)
223 ClassImp(HtmlSummary)
224 ClassImp(SplitGLView)
226 HtmlSummary *SplitGLView::fgHtmlSummary = 0;
227 TGHtml *SplitGLView::fgHtml = 0;
229 //______________________________________________________________________________
230 TGShapedToolTip::TGShapedToolTip(const char *pname, Int_t cx, Int_t cy, Int_t cw,
231 Int_t ch, Int_t tx, Int_t ty, Int_t th,
233 TGShapedFrame(pname, gClient->GetDefaultRoot(), 400, 300, kTempFrame |
234 kHorizontalFrame), fEc(0), fHist(0)
236 // Shaped window constructor
238 fTextX = tx; fTextY = ty; fTextH = th;
242 fTextCol = "0x000000";
244 // create the embedded canvas
245 if ((cx > 0) && (cy > 0) && (cw > 0) && (ch > 0)) {
246 Int_t lhRight = fWidth-cx-cw;
247 Int_t lhBottom = fHeight-cy-ch;
248 fEc = new TRootEmbeddedCanvas("ec", this, cw, ch, 0);
249 AddFrame(fEc, new TGLayoutHints(kLHintsTop | kLHintsLeft, cx,
250 lhRight, cy, lhBottom));
254 Resize(fBgnd->GetWidth(), fBgnd->GetHeight());
257 //______________________________________________________________________________
258 TGShapedToolTip::~TGShapedToolTip()
268 //______________________________________________________________________________
269 void TGShapedToolTip::CloseWindow()
271 // Close shaped window.
276 //______________________________________________________________________________
277 void TGShapedToolTip::Refresh()
279 // Redraw the window with current attributes.
281 const char *str = fText.Data();
282 char *string = strdup(str);
283 Int_t nlines = 0, size = fTextH;
284 TString fp = gEnv->GetValue("Root.TTFontPath", "");
285 TString ar = fp + "/arial.ttf";
286 char *s = strtok((char *)string, "\n");
287 TImage *img = (TImage*)fImage->Clone("img");
288 img->DrawText(fTextX, fTextY+(nlines*size), s, size, fTextCol, ar);
289 while ((s = strtok(0, "\n"))) {
291 img->DrawText(fTextX, fTextY+(nlines*size), s, size, fTextCol, ar);
293 img->PaintImage(fId, 0, 0, 0, 0, 0, 0, "opaque");
299 //______________________________________________________________________________
300 void TGShapedToolTip::CreateCanvas(Int_t cx, Int_t cy, Int_t cw, Int_t ch)
303 // create the embedded canvas
304 Int_t lhRight = fWidth-cx-cw;
305 Int_t lhBottom = fHeight-cy-ch;
306 fEc = new TRootEmbeddedCanvas("ec", this, cw, ch, 0);
307 AddFrame(fEc, new TGLayoutHints(kLHintsTop | kLHintsLeft, cx,
308 lhRight, cy, lhBottom));
311 Resize(fBgnd->GetWidth(), fBgnd->GetHeight());
317 //______________________________________________________________________________
318 void TGShapedToolTip::CreateCanvas(Int_t cw, Int_t ch, TGLayoutHints *hints)
320 // Create the embedded canvas.
322 fEc = new TRootEmbeddedCanvas("ec", this, cw, ch, 0);
323 AddFrame(fEc, hints);
326 Resize(fBgnd->GetWidth(), fBgnd->GetHeight());
332 //______________________________________________________________________________
333 void TGShapedToolTip::SetHisto(TH1 *hist)
335 // Set which histogram has to be displayed in the embedded canvas.
341 fEc->GetCanvas()->Clear();
343 fHist = (TH1 *)hist->Clone();
345 fEc->GetCanvas()->SetBorderMode(0);
346 fEc->GetCanvas()->SetFillColor(10);
347 fEc->GetCanvas()->cd();
349 fEc->GetCanvas()->Update();
354 //______________________________________________________________________________
355 void TGShapedToolTip::SetText(const char *text)
357 // Set which text has to be displayed.
366 //______________________________________________________________________________
367 void TGShapedToolTip::SetTextColor(const char *col)
376 //______________________________________________________________________________
377 void TGShapedToolTip::SetTextAttributes(Int_t tx, Int_t ty, Int_t th,
380 // Set text attributes (position, size and color).
382 fTextX = tx; fTextY = ty; fTextH = th;
389 //______________________________________________________________________________
390 void TGShapedToolTip::Show(Int_t x, Int_t y, const char *text, TH1 *hist)
392 // Show (popup) the shaped window at location x,y and possibly
393 // set the text and histogram to be displayed.
402 // end of demo code -------------------------------------------
404 fEc->GetCanvas()->SetBorderMode(0);
405 fEc->GetCanvas()->SetFillColor(10);
406 fEc->GetCanvas()->cd();
408 fEc->GetCanvas()->Update();
413 //______________________________________________________________________________
414 HtmlObjTable::HtmlObjTable(const char *name, Int_t nfields, Int_t nvals, Bool_t exp) :
415 fName(name), fNValues(nvals), fNFields(nfields), fExpand(exp)
419 fValues = new TArrayF[fNFields];
420 for (int i=0;i<fNFields;i++)
421 fValues[i].Set(nvals);
422 fLabels = new TString[fNFields];
425 //______________________________________________________________________________
426 HtmlObjTable::~HtmlObjTable()
434 //______________________________________________________________________________
435 void HtmlObjTable::Build()
439 fHtml = "<table width=100% border=1 cellspacing=0 cellpadding=0 bgcolor=f0f0f0> ",
442 if (fExpand && (fNFields > 0) && (fNValues > 0)) {
450 //______________________________________________________________________________
451 void HtmlObjTable::BuildTitle()
453 // Build table title.
455 fHtml += "<tr><td colspan=";
456 fHtml += Form("%d>", fNFields+1);
457 fHtml += "<table width=100% border=0 cellspacing=2 cellpadding=0 bgcolor=6e6ea0>";
458 fHtml += "<tr><td align=left>";
459 fHtml += "<font face=Verdana size=3 color=ffffff><b><i>";
461 fHtml += "</i></b></font></td>";
463 fHtml += "<td align=right> ";
464 fHtml += "<font face=Verdana size=3 color=ffffff><b><i>";
465 fHtml += Form("Size = %d", fNValues);
466 fHtml += "</i></b></font></td></tr>";
468 fHtml += "</td></tr>";
471 //______________________________________________________________________________
472 void HtmlObjTable::BuildLabels()
474 // Build table labels.
477 fHtml += "<tr bgcolor=c0c0ff>";
478 fHtml += "<th> </th>"; // for the check boxes
479 for (i=0;i<fNFields;i++) {
482 fHtml += " </th>"; // for the check boxes
487 //______________________________________________________________________________
488 void HtmlObjTable::BuildTable()
490 // Build part of table with values.
492 for (int i = 0; i < fNValues; i++) {
494 fHtml += "<tr bgcolor=e0e0ff>";
496 fHtml += "<tr bgcolor=ffffff>";
498 TString name = fName;
499 name.ReplaceAll(" ", "_");
501 fHtml += "<td bgcolor=d0d0ff align=\"center\">";
502 fHtml += "<input type=\"checkbox\" name=\"";
504 fHtml += Form("[%d]\">",i);
507 for (int j = 0; j < fNFields; j++) {
508 fHtml += "<td width=";
509 fHtml += Form("%d%%", 100/fNFields);
510 fHtml += " align=\"center\"";
512 fHtml += Form("%1.4f", fValues[j][i]);
519 //______________________________________________________________________________
520 HtmlSummary::HtmlSummary(const char *title) : fNTables(0), fTitle(title)
524 fObjTables = new TOrdCollection();
527 //______________________________________________________________________________
528 HtmlSummary::~HtmlSummary()
535 //______________________________________________________________________________
536 HtmlObjTable *HtmlSummary::AddTable(const char *name, Int_t nfields, Int_t nvals,
537 Bool_t exp, Option_t *option)
539 // Add a new table in our list of tables.
541 TString opt = option;
543 HtmlObjTable *table = new HtmlObjTable(name, nfields, nvals, exp);
545 if (opt.Contains("first"))
546 fObjTables->AddFirst(table);
548 fObjTables->Add(table);
552 //______________________________________________________________________________
553 void HtmlSummary::Clear(Option_t *option)
555 // Clear the table list.
557 if (option && option[0] == 'D')
558 fObjTables->Delete(option);
560 fObjTables->Clear(option);
564 //______________________________________________________________________________
565 void HtmlSummary::Reset(Option_t *)
567 // Reset (delete) the table list;
569 delete fObjTables; fObjTables = 0;
573 //______________________________________________________________________________
574 void HtmlSummary::Build()
576 // Build the summary.
579 for (int i=0;i<fNTables;i++) {
580 GetTable(i)->Build();
581 fHtml += GetTable(i)->Html();
586 //______________________________________________________________________________
587 void HtmlSummary::MakeHeader()
591 fHeader = "<html><head><title>";
593 fHeader += "</title></head><body>";
594 fHeader += "<center><h2><font color=#2222ee><i>";
596 fHeader += "</i></font></h2></center>";
600 //______________________________________________________________________________
601 void HtmlSummary::MakeFooter()
605 fFooter = "<br><p><br><center><strong><font size=2 color=#2222ee>";
606 fFooter += "Example of using Html widget to display tabular data";
608 fFooter += "© 2007-2008 Bertrand Bellenot";
609 fFooter += "</font></strong></center></body></html>";
613 //______________________________________________________________________________
614 SplitGLView::SplitGLView(const TGWindow *p, UInt_t w, UInt_t h, Bool_t embed) :
615 TGMainFrame(p, w, h), fActViewer(0), fShapedToolTip(0), fIsEmbedded(embed)
617 // Main frame constructor.
619 TGSplitFrame *frm = 0;
622 // create the "file" popup menu
623 fMenuFile = new TGPopupMenu(gClient->GetRoot());
624 fMenuFile->AddEntry("&Open...", kFileOpen);
625 fMenuFile->AddSeparator();
626 fMenuFile->AddEntry( "&Update Summary", kSummaryUpdate);
627 fMenuFile->AddSeparator();
628 fMenuFile->AddEntry("&Load Config...", kFileLoadConfig);
629 fMenuFile->AddEntry("&Save Config...", kFileSaveConfig);
630 fMenuFile->AddSeparator();
631 fMenuFile->AddEntry("E&xit", kFileExit);
633 // create the "camera" popup menu
634 fMenuCamera = new TGPopupMenu(gClient->GetRoot());
635 fMenuCamera->AddEntry("Perspective (Floor XOZ)", kGLPerspXOZ);
636 fMenuCamera->AddEntry("Perspective (Floor YOZ)", kGLPerspYOZ);
637 fMenuCamera->AddEntry("Perspective (Floor XOY)", kGLPerspXOY);
638 fMenuCamera->AddEntry("Orthographic (XOY)", kGLXOY);
639 fMenuCamera->AddEntry("Orthographic (XOZ)", kGLXOZ);
640 fMenuCamera->AddEntry("Orthographic (ZOY)", kGLZOY);
641 fMenuCamera->AddSeparator();
642 fMenuCamera->AddEntry("Ortho allow rotate", kGLOrthoRotate);
643 fMenuCamera->AddEntry("Ortho allow dolly", kGLOrthoDolly);
645 fMenuScene = new TGPopupMenu(gClient->GetRoot());
646 fMenuScene->AddEntry("&Update Current", kSceneUpdate);
647 fMenuScene->AddEntry("Update &All", kSceneUpdateAll);
649 // create the "help" popup menu
650 fMenuHelp = new TGPopupMenu(gClient->GetRoot());
651 fMenuHelp->AddEntry("&About", kHelpAbout);
653 // create the main menu bar
654 fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
655 fMenuBar->AddPopup("&File", fMenuFile, new TGLayoutHints(kLHintsTop |
656 kLHintsLeft, 0, 4, 0, 0));
657 fMenuBar->AddPopup("&Camera", fMenuCamera, new TGLayoutHints(kLHintsTop |
658 kLHintsLeft, 0, 4, 0, 0));
659 fMenuBar->AddPopup("&Scene", fMenuScene, new TGLayoutHints(kLHintsTop |
660 kLHintsLeft, 0, 4, 0, 0));
661 fMenuBar->AddPopup("&Help", fMenuHelp, new TGLayoutHints(kLHintsTop |
664 AddFrame(fMenuBar, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
666 // connect menu signals to our menu handler slot
667 fMenuFile->Connect("Activated(Int_t)", "SplitGLView", this,
668 "HandleMenu(Int_t)");
669 fMenuCamera->Connect("Activated(Int_t)", "SplitGLView", this,
670 "HandleMenu(Int_t)");
671 fMenuScene->Connect("Activated(Int_t)", "SplitGLView", this,
672 "HandleMenu(Int_t)");
673 fMenuHelp->Connect("Activated(Int_t)", "SplitGLView", this,
674 "HandleMenu(Int_t)");
676 if (fIsEmbedded && gEve) {
677 // use status bar from the browser
678 fStatusBar = gEve->GetBrowser()->GetStatusBar();
681 // create the status bar
682 Int_t parts[] = {45, 15, 10, 30};
683 fStatusBar = new TGStatusBar(this, 50, 10);
684 fStatusBar->SetParts(parts, 4);
685 AddFrame(fStatusBar, new TGLayoutHints(kLHintsBottom | kLHintsExpandX,
689 // create eve pad (our geometry container)
690 fPad = new TEvePad();
692 // create the split frames
693 fSplitFrame = new TGSplitFrame(this, 800, 600);
694 AddFrame(fSplitFrame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
696 fSplitFrame->HSplit(350);
697 // split bottom part vartically
698 fSplitFrame->GetSecond()->VSplit(400);
700 TGLOverlayButton *but1, *but2, *but3, *but4, *but5, *but6;
701 // get top (main) split frame
702 frm = fSplitFrame->GetFirst();
703 // create (embed) a GL viewer inside
704 fViewer0 = new TGLEmbeddedViewer(frm, fPad);
705 but1 = new TGLOverlayButton(fViewer0, "Swap", 10.0, -10.0, 55.0, 16.0);
706 but1->Connect("Clicked(TGLViewerBase*)", "SplitGLView", this, "SwapToMainView(TGLViewerBase*)");
707 but2 = new TGLOverlayButton(fViewer0, "Undock", 70.0, -10.0, 55.0, 16.0);
708 but2->Connect("Clicked(TGLViewerBase*)", "SplitGLView", this, "UnDock(TGLViewerBase*)");
709 frm->AddFrame(fViewer0->GetFrame(), new TGLayoutHints(kLHintsExpandX |
711 // set the camera to perspective (XOZ) for this viewer
712 fViewer0->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
713 // connect signal we are interested to
714 fViewer0->Connect("MouseOver(TGLPhysicalShape*)", "SplitGLView", this,
715 "OnMouseOver(TGLPhysicalShape*)");
716 fViewer0->Connect("Activated()", "SplitGLView", this,
717 "OnViewerActivated()");
718 fViewer0->Connect("MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)",
720 "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)");
721 fViewer0->Connect("Clicked(TObject*)", "SplitGLView", this,
722 "OnClicked(TObject*)");
723 fViewer[0] = new TEveViewer("SplitGLViewer[0]");
724 fViewer[0]->SetGLViewer(fViewer0, fViewer0->GetFrame());
725 fViewer[0]->IncDenyDestroy();
726 if (fIsEmbedded && gEve) {
727 fViewer[0]->AddScene(gEve->GetGlobalScene());
728 fViewer[0]->AddScene(gEve->GetEventScene());
729 gEve->AddElement(fViewer[0], gEve->GetViewers());
730 s = gEve->SpawnNewScene("Rho-Z Projection");
732 fRhoZMgr = new TEveProjectionManager();
733 gEve->AddElement(fRhoZMgr, (TEveElement *)s);
734 gEve->AddToListTree(fRhoZMgr, kFALSE);
737 // get bottom left split frame
738 frm = fSplitFrame->GetSecond()->GetFirst();
740 // create (embed) a GL viewer inside
741 fViewer1 = new TGLEmbeddedViewer(frm, fPad);
742 but3 = new TGLOverlayButton(fViewer1, "Swap", 10.0, -10.0, 55.0, 16.0);
743 but3->Connect("Clicked(TGLViewerBase*)", "SplitGLView", this, "SwapToMainView(TGLViewerBase*)");
744 but4 = new TGLOverlayButton(fViewer1, "Undock", 70.0, -10.0, 55.0, 16.0);
745 but4->Connect("Clicked(TGLViewerBase*)", "SplitGLView", this, "UnDock(TGLViewerBase*)");
746 frm->AddFrame(fViewer1->GetFrame(), new TGLayoutHints(kLHintsExpandX |
749 // set the camera to orthographic (XOY) for this viewer
750 fViewer1->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
751 // connect signal we are interested to
752 fViewer1->Connect("MouseOver(TGLPhysicalShape*)", "SplitGLView", this,
753 "OnMouseOver(TGLPhysicalShape*)");
754 fViewer1->Connect("Activated()", "SplitGLView", this,
755 "OnViewerActivated()");
756 fViewer1->Connect("MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)",
758 "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)");
759 fViewer1->Connect("Clicked(TObject*)", "SplitGLView", this,
760 "OnClicked(TObject*)");
761 fViewer[1] = new TEveViewer("SplitGLViewer[1]");
762 fViewer[1]->SetGLViewer(fViewer1, fViewer1->GetFrame());
763 fViewer[1]->IncDenyDestroy();
764 if (fIsEmbedded && gEve) {
765 fRhoZMgr->ImportElements((TEveElement *)gEve->GetGlobalScene());
766 fRhoZMgr->ImportElements((TEveElement *)gEve->GetEventScene());
767 fRhoZMgr->SetProjection(TEveProjection::kPT_RhoZ);
768 fViewer[1]->AddScene(s);
769 gEve->AddElement(fViewer[1], gEve->GetViewers());
772 s = gEve->SpawnNewScene("R-Phi Projection");
774 fRPhiMgr = new TEveProjectionManager();
775 gEve->AddElement(fRPhiMgr, (TEveElement *)s);
776 gEve->AddToListTree(fRPhiMgr, kFALSE);
779 // get bottom right frame
780 frm = fSplitFrame->GetSecond()->GetSecond();
781 // create (embed) a GL viewer inside
782 fViewer2 = new TGLEmbeddedViewer(frm, fPad);
783 but5 = new TGLOverlayButton(fViewer2, "Swap", 10.0, -10.0, 55.0, 16.0);
784 but5->Connect("Clicked(TGLViewerBase*)", "SplitGLView", this, "SwapToMainView(TGLViewerBase*)");
785 but6 = new TGLOverlayButton(fViewer2, "Undock", 70.0, -10.0, 55.0, 16.0);
786 but6->Connect("Clicked(TGLViewerBase*)", "SplitGLView", this, "UnDock(TGLViewerBase*)");
787 frm->AddFrame(fViewer2->GetFrame(), new TGLayoutHints(kLHintsExpandX |
790 // set the camera to orthographic (XOY) for this viewer
791 fViewer2->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
792 // connect signal we are interested to
793 fViewer2->Connect("MouseOver(TGLPhysicalShape*)", "SplitGLView", this,
794 "OnMouseOver(TGLPhysicalShape*)");
795 fViewer2->Connect("Activated()", "SplitGLView", this,
796 "OnViewerActivated()");
797 fViewer2->Connect("MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)",
799 "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)");
800 fViewer2->Connect("Clicked(TObject*)", "SplitGLView", this,
801 "OnClicked(TObject*)");
802 fViewer[2] = new TEveViewer("SplitGLViewer[2]");
803 fViewer[2]->SetGLViewer(fViewer2, fViewer2->GetFrame());
804 fViewer[2]->IncDenyDestroy();
805 if (fIsEmbedded && gEve) {
806 fRPhiMgr->ImportElements((TEveElement *)gEve->GetGlobalScene());
807 fRPhiMgr->ImportElements((TEveElement *)gEve->GetEventScene());
808 fRPhiMgr->SetProjection(TEveProjection::kPT_RPhi);
809 fViewer[2]->AddScene(s);
810 gEve->AddElement(fViewer[2], gEve->GetViewers());
815 // Summary view ... incomplete
816 frm = fSplitFrame->GetSecond();
818 hfrm = new TGHorizontalFrame(frm);
819 button= new TGPictureButton(hfrm, gClient->GetPicture("$ALICE_ROOT/EVE/alice-data/swap.png"));
820 button->SetToolTipText("Swap to big view");
821 hfrm->AddFrame(button);
822 button->Connect("Clicked()","SplitGLView",this,"SwapToMainView()");
823 fgHtmlSummary = new HtmlSummary("Alice Event Display Summary Table");
824 fgHtml = new TGHtml(hfrm, 100, 100, -1);
825 hfrm->AddFrame(fgHtml, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
826 frm->AddFrame(hfrm, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
829 if (fIsEmbedded && gEve) {
830 gEve->GetListTree()->Connect("Clicked(TGListTreeItem*, Int_t, Int_t, Int_t)",
831 "SplitGLView", this, "ItemClicked(TGListTreeItem*, Int_t, Int_t, Int_t)");
834 fShapedToolTip = new TGShapedToolTip("$ALICE_ROOT/EVE/alice-data/Default.png", 120, 22, 160, 110,
835 23, 115, 12, "#ffff80");
836 Resize(GetDefaultSize());
840 fSplitFrame->Layout();
841 // !!!! LoadConfig(".everc");
844 //______________________________________________________________________________
845 SplitGLView::~SplitGLView()
847 // Clean up main frame...
850 fMenuFile->Disconnect("Activated(Int_t)", this, "HandleMenu(Int_t)");
851 fMenuCamera->Disconnect("Activated(Int_t)", this, "HandleMenu(Int_t)");
852 fMenuScene->Disconnect("Activated(Int_t)", this, "HandleMenu(Int_t)");
853 fMenuHelp->Disconnect("Activated(Int_t)", this, "HandleMenu(Int_t)");
854 fViewer0->Disconnect("MouseOver(TGLPhysicalShape*)", this,
855 "OnMouseOver(TGLPhysicalShape*)");
856 fViewer0->Disconnect("Activated()", this, "OnViewerActivated()");
857 fViewer0->Disconnect("MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)",
858 this, "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)");
859 fViewer1->Disconnect("MouseOver(TGLPhysicalShape*)", this,
860 "OnMouseOver(TGLPhysicalShape*)");
861 fViewer1->Disconnect("Activated()", this, "OnViewerActivated()");
862 fViewer1->Disconnect("MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)",
863 this, "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)");
864 fViewer2->Disconnect("MouseOver(TGLPhysicalShape*)", this,
865 "OnMouseOver(TGLPhysicalShape*)");
866 fViewer2->Disconnect("Activated()", this, "OnViewerActivated()");
867 fViewer2->Disconnect("MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)",
868 this, "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)");
874 delete fShapedToolTip;
888 gApplication->Terminate(0);
892 //______________________________________________________________________________
893 void SplitGLView::HandleMenu(Int_t id)
895 // Handle menu items.
897 static TString rcdir(".");
898 static TString rcfile(".everc");
904 static TString dir(".");
906 fi.fFileTypes = filetypes;
907 fi.fIniDir = StrDup(dir);
908 new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
910 OpenFile(fi.fFilename);
915 case kFileLoadConfig:
918 fi.fFileTypes = rcfiletypes;
919 fi.fIniDir = StrDup(rcdir);
920 fi.fFilename = StrDup(rcfile);
921 new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
923 rcfile = fi.fFilename;
924 LoadConfig(fi.fFilename);
930 case kFileSaveConfig:
933 fi.fFileTypes = rcfiletypes;
934 fi.fIniDir = StrDup(rcdir);
935 fi.fFilename = StrDup(rcfile);
936 new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
938 rcfile = fi.fFilename;
939 SaveConfig(fi.fFilename);
951 fActViewer->SetCurrentCamera(TGLViewer::kCameraPerspYOZ);
955 fActViewer->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
959 fActViewer->SetCurrentCamera(TGLViewer::kCameraPerspXOY);
963 fActViewer->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
967 fActViewer->SetCurrentCamera(TGLViewer::kCameraOrthoXOZ);
971 fActViewer->SetCurrentCamera(TGLViewer::kCameraOrthoZOY);
982 fActViewer->UpdateScene();
986 case kSceneUpdateAll:
987 fViewer0->UpdateScene();
988 fViewer1->UpdateScene();
989 fViewer2->UpdateScene();
1004 rootx = gSystem->Getenv("ROOTSYS");
1005 if (!rootx.IsNull()) rootx += "/bin";
1007 rootx += "/root -a &";
1008 gSystem->Exec(rootx);
1011 new TWin32SplashThread(kTRUE);
1014 sprintf(str, "About ROOT %s...", gROOT->GetVersion());
1015 hd = new TRootHelpDialog(this, str, 600, 400);
1016 hd->SetText(gHelpAbout);
1028 //______________________________________________________________________________
1029 void SplitGLView::OnClicked(TObject *obj)
1031 // Handle click events in GL viewer
1034 fStatusBar->SetText(Form("User clicked on: \"%s\"", obj->GetName()), 1);
1036 fStatusBar->SetText("", 1);
1039 //______________________________________________________________________________
1040 void SplitGLView::OnMouseIdle(TGLPhysicalShape *shape, UInt_t posx, UInt_t posy)
1042 // Slot used to handle "OnMouseIdle" signal coming from any GL viewer.
1043 // We receive a pointer on the physical shape in which the mouse cursor is
1044 // and the actual cursor position (x,y)
1049 static TH1F *h1f = 0;
1050 TFormula *form1 = new TFormula("form1","abs(sin(x)/x)");
1051 form1->Update(); // silent warning about unused variable...
1052 TF1 *sqroot = new TF1("sqroot","x*gaus(0) + [3]*form1",0,10);
1053 sqroot->SetParameters(10,4,1,20);
1055 h1f = new TH1F("h1f","",50,0,10);
1057 h1f->SetFillColor(45);
1059 h1f->FillRandom("sqroot",200);
1061 if (fShapedToolTip) {
1062 fShapedToolTip->UnmapWindow();
1064 if (shape && shape->GetLogical() && shape->GetLogical()->GetExternal()) {
1065 // get the actual viewer who actually emitted the signal
1066 TGLEmbeddedViewer *actViewer = dynamic_cast<TGLEmbeddedViewer*>((TQObject*)gTQSender);
1067 // then translate coordinates from the root (screen) coordinates
1068 // to the actual frame (viewer) ones
1069 gVirtualX->TranslateCoordinates(actViewer->GetFrame()->GetId(),
1070 gClient->GetDefaultRoot()->GetId(), posx, posy, x, y,
1072 // Then display our tooltip at this x,y location
1073 if (fShapedToolTip) {
1074 fShapedToolTip->Show(x+5, y+5, Form("%s\n \n%s",
1075 shape->GetLogical()->GetExternal()->IsA()->GetName(),
1076 shape->GetLogical()->GetExternal()->GetName()), h1f);
1081 //______________________________________________________________________________
1082 void SplitGLView::OnMouseOver(TGLPhysicalShape *shape)
1084 // Slot used to handle "OnMouseOver" signal coming from any GL viewer.
1085 // We receive a pointer on the physical shape in which the mouse cursor is.
1087 // display informations on the physical shape in the status bar
1088 if (shape && shape->GetLogical() && shape->GetLogical()->GetExternal())
1089 fStatusBar->SetText(Form("Mouse Over: \"%s\"",
1090 shape->GetLogical()->GetExternal()->GetName()), 0);
1092 fStatusBar->SetText("", 0);
1095 //______________________________________________________________________________
1096 void SplitGLView::OnViewerActivated()
1098 // Slot used to handle "Activated" signal coming from any GL viewer.
1099 // Used to know which GL viewer is active.
1101 static Pixel_t green = 0;
1102 // set the actual GL viewer frame to default color
1103 if (fActViewer && fActViewer->GetFrame())
1104 fActViewer->GetFrame()->ChangeBackground(GetDefaultFrameBackground());
1106 // change the actual GL viewer to the one who emitted the signal
1107 // fActViewer = (TGLEmbeddedViewer *)gTQSender;
1108 fActViewer = dynamic_cast<TGLEmbeddedViewer*>((TQObject*)gTQSender);
1110 if (fActViewer == 0) {
1111 printf ("dyncast failed ...\n");
1115 // get the highlight color (only once)
1117 gClient->GetColorByName("green", green);
1119 // set the new actual GL viewer frame to highlight color
1120 if (fActViewer->GetFrame())
1121 fActViewer->GetFrame()->ChangeBackground(green);
1123 // update menu entries to match actual viewer's options
1124 if (fActViewer->GetOrthoXOYCamera()->GetDollyToZoom() &&
1125 fActViewer->GetOrthoXOZCamera()->GetDollyToZoom() &&
1126 fActViewer->GetOrthoZOYCamera()->GetDollyToZoom())
1127 fMenuCamera->UnCheckEntry(kGLOrthoDolly);
1129 fMenuCamera->CheckEntry(kGLOrthoDolly);
1131 if (fActViewer->GetOrthoXOYCamera()->GetEnableRotate() &&
1132 fActViewer->GetOrthoXOYCamera()->GetEnableRotate() &&
1133 fActViewer->GetOrthoXOYCamera()->GetEnableRotate())
1134 fMenuCamera->CheckEntry(kGLOrthoRotate);
1136 fMenuCamera->UnCheckEntry(kGLOrthoRotate);
1139 //______________________________________________________________________________
1140 void SplitGLView::OpenFile(const char *fname)
1142 // Open a Root file to display a geometry in the GL viewers.
1144 TString filename = fname;
1145 // check if the file type is correct
1146 if (!filename.EndsWith(".root")) {
1147 new TGMsgBox(gClient->GetRoot(), this, "OpenFile",
1148 Form("The file \"%s\" is not a root file!", fname),
1149 kMBIconExclamation, kMBOk);
1152 // check if the root file contains a geometry
1153 if (TGeoManager::Import(fname) == 0) {
1154 new TGMsgBox(gClient->GetRoot(), this, "OpenFile",
1155 Form("The file \"%s\" does't contain a geometry", fname),
1156 kMBIconExclamation, kMBOk);
1159 gGeoManager->DefaultColors();
1160 // delete previous primitives (if any)
1161 fPad->GetListOfPrimitives()->Delete();
1162 // and add the geometry to eve pad (container)
1163 fPad->GetListOfPrimitives()->Add(gGeoManager->GetTopVolume());
1164 // paint the geometry in each GL viewer
1165 fViewer0->PadPaint(fPad);
1166 fViewer1->PadPaint(fPad);
1167 fViewer2->PadPaint(fPad);
1170 //______________________________________________________________________________
1171 void SplitGLView::ToggleOrthoRotate()
1173 // Toggle state of the 'Ortho allow rotate' menu entry.
1175 if (fMenuCamera->IsEntryChecked(kGLOrthoRotate))
1176 fMenuCamera->UnCheckEntry(kGLOrthoRotate);
1178 fMenuCamera->CheckEntry(kGLOrthoRotate);
1179 Bool_t state = fMenuCamera->IsEntryChecked(kGLOrthoRotate);
1181 fActViewer->GetOrthoXOYCamera()->SetEnableRotate(state);
1182 fActViewer->GetOrthoXOYCamera()->SetEnableRotate(state);
1183 fActViewer->GetOrthoXOYCamera()->SetEnableRotate(state);
1187 //______________________________________________________________________________
1188 void SplitGLView::ToggleOrthoDolly()
1190 // Toggle state of the 'Ortho allow dolly' menu entry.
1192 if (fMenuCamera->IsEntryChecked(kGLOrthoDolly))
1193 fMenuCamera->UnCheckEntry(kGLOrthoDolly);
1195 fMenuCamera->CheckEntry(kGLOrthoDolly);
1196 Bool_t state = ! fMenuCamera->IsEntryChecked(kGLOrthoDolly);
1198 fActViewer->GetOrthoXOYCamera()->SetDollyToZoom(state);
1199 fActViewer->GetOrthoXOZCamera()->SetDollyToZoom(state);
1200 fActViewer->GetOrthoZOYCamera()->SetDollyToZoom(state);
1204 //______________________________________________________________________________
1205 void SplitGLView::ItemClicked(TGListTreeItem *item, Int_t, Int_t, Int_t)
1207 // Item has been clicked, based on mouse button do:
1209 static const TEveException eh("SplitGLView::ItemClicked ");
1210 TEveElement* re = (TEveElement*)item->GetUserData();
1212 TObject* obj = re->GetObject(eh);
1213 if (obj->InheritsFrom("TEveViewer")) {
1214 TGLViewer *v = ((TEveViewer *)obj)->GetGLViewer();
1216 if (v->InheritsFrom("TGLEmbeddedViewer")) {
1217 TGLEmbeddedViewer *ev = (TGLEmbeddedViewer *)v;
1218 gVirtualX->SetInputFocus(ev->GetGLWidget()->GetId());
1223 //______________________________________________________________________________
1224 void SplitGLView::LoadConfig(const char *fname)
1227 Int_t height, width;
1228 TEnv *env = new TEnv(fname);
1230 Int_t mainheight = env->GetValue("MainView.Height", 434);
1231 Int_t blwidth = env->GetValue("Bottom.Left.Width", 266);
1232 Int_t bcwidth = env->GetValue("Bottom.Center.Width", 266);
1233 Int_t brwidth = env->GetValue("Bottom.Right.Width", 266);
1234 Int_t top_height = env->GetValue("Right.Tab.Height", 0);
1235 Int_t bottom_height = env->GetValue("Bottom.Tab.Height", 0);
1237 if (fIsEmbedded && gEve) {
1238 Int_t sel = env->GetValue("Eve.Selection", gEve->GetSelection()->GetPickToSelect());
1239 Int_t hi = env->GetValue("Eve.Highlight", gEve->GetHighlight()->GetPickToSelect());
1240 gEve->GetBrowser()->EveMenu(9+sel);
1241 gEve->GetBrowser()->EveMenu(13+hi);
1243 width = env->GetValue("Eve.Width", (Int_t)gEve->GetBrowser()->GetWidth());
1244 height = env->GetValue("Eve.Height", (Int_t)gEve->GetBrowser()->GetHeight());
1245 gEve->GetBrowser()->Resize(width, height);
1248 // top (main) split frame
1249 width = fSplitFrame->GetFirst()->GetWidth();
1250 fSplitFrame->GetFirst()->Resize(width, mainheight);
1251 // bottom left split frame
1252 height = fSplitFrame->GetSecond()->GetFirst()->GetHeight();
1253 fSplitFrame->GetSecond()->GetFirst()->Resize(blwidth, height);
1254 // bottom center split frame
1255 height = fSplitFrame->GetSecond()->GetSecond()->GetFirst()->GetHeight();
1256 fSplitFrame->GetSecond()->GetSecond()->GetFirst()->Resize(bcwidth, height);
1257 // bottom right split frame
1258 height = fSplitFrame->GetSecond()->GetSecond()->GetSecond()->GetHeight();
1259 fSplitFrame->GetSecond()->GetSecond()->GetSecond()->Resize(brwidth, height);
1261 fSplitFrame->Layout();
1263 if (fIsEmbedded && gEve) {
1264 width = ((TGCompositeFrame *)gEve->GetBrowser()->GetTabBottom()->GetParent())->GetWidth();
1265 ((TGCompositeFrame *)gEve->GetBrowser()->GetTabBottom()->GetParent())->Resize(width, bottom_height);
1266 width = ((TGCompositeFrame *)gEve->GetBrowser()->GetTabRight()->GetParent())->GetWidth();
1267 ((TGCompositeFrame *)gEve->GetBrowser()->GetTabRight()->GetParent())->Resize(width, top_height);
1271 //______________________________________________________________________________
1272 void SplitGLView::SaveConfig(const char *fname)
1275 Int_t bottom_height = 0;
1276 Int_t top_height = 0;
1278 TEnv *env = new TEnv(fname);
1280 if (fIsEmbedded && gEve) {
1281 env->SetValue("Eve.Width", (Int_t)gEve->GetBrowser()->GetWidth());
1282 env->SetValue("Eve.Height", (Int_t)gEve->GetBrowser()->GetHeight());
1284 // get top (main) split frame
1285 frm = fSplitFrame->GetFirst();
1286 env->SetValue("MainView.Height", (Int_t)frm->GetHeight());
1287 // get bottom left split frame
1288 frm = fSplitFrame->GetSecond()->GetFirst();
1289 env->SetValue("Bottom.Left.Width", (Int_t)frm->GetWidth());
1290 // get bottom center split frame
1291 frm = fSplitFrame->GetSecond()->GetSecond()->GetFirst();
1292 env->SetValue("Bottom.Center.Width", (Int_t)frm->GetWidth());
1293 // get bottom right split frame
1294 frm = fSplitFrame->GetSecond()->GetSecond()->GetSecond();
1295 env->SetValue("Bottom.Right.Width", (Int_t)frm->GetWidth());
1296 if (fIsEmbedded && gEve) {
1297 top_height = (Int_t)((TGCompositeFrame *)gEve->GetBrowser()->GetTabRight()->GetParent())->GetHeight();
1298 env->SetValue("Right.Tab.Height", top_height);
1299 bottom_height = (Int_t)((TGCompositeFrame *)gEve->GetBrowser()->GetTabBottom()->GetParent())->GetHeight();
1300 env->SetValue("Bottom.Tab.Height", bottom_height);
1302 env->SetValue("Eve.Selection", gEve->GetSelection()->GetPickToSelect());
1303 env->SetValue("Eve.Highlight", gEve->GetHighlight()->GetPickToSelect());
1306 env->SaveLevel(kEnvLocal);
1308 if (!gSystem->AccessPathName(Form("%s.new", fname))) {
1309 gSystem->Exec(Form("del %s", fname));
1310 gSystem->Rename(Form("%s.new", fname), fname);
1315 //______________________________________________________________________________
1316 void SplitGLView::SwapToMainView(TGLViewerBase *viewer)
1318 // Swap frame embedded in a splitframe to the main view (slot method).
1320 TGCompositeFrame *parent = 0;
1321 if (!fSplitFrame->GetFirst()->GetFrame())
1324 TGPictureButton *src = (TGPictureButton*)gTQSender;
1325 parent = (TGCompositeFrame *)src->GetParent();
1326 while (parent && !parent->InheritsFrom("TGSplitFrame")) {
1327 parent = (TGCompositeFrame *)parent->GetParent();
1331 TGCompositeFrame *src = ((TGLEmbeddedViewer *)viewer)->GetFrame();
1333 TGLOverlayButton *but = (TGLOverlayButton *)((TQObject *)gTQSender);
1335 parent = (TGCompositeFrame *)src->GetParent();
1337 if (parent && parent->InheritsFrom("TGSplitFrame"))
1338 ((TGSplitFrame *)parent)->SwitchToMain();
1341 //______________________________________________________________________________
1342 void SplitGLView::UnDock(TGLViewerBase *viewer)
1344 // Undock frame embedded in a splitframe (slot method).
1346 TGCompositeFrame *src = ((TGLEmbeddedViewer *)viewer)->GetFrame();
1348 TGLOverlayButton *but = (TGLOverlayButton *)((TQObject *)gTQSender);
1350 TGCompositeFrame *parent = (TGCompositeFrame *)src->GetParent();
1351 if (parent && parent->InheritsFrom("TGSplitFrame"))
1352 ((TGSplitFrame *)parent)->ExtractFrame();
1355 //______________________________________________________________________________
1356 void SplitGLView::UpdateSummary()
1358 // Update summary of current event.
1359 // Currently unused.
1362 TEveElement::List_i i;
1363 TEveElement::List_i j;
1366 HtmlObjTable *table;
1367 TEveEventManager *mgr = gEve ? gEve->GetCurrentEvent() : 0;
1369 fgHtmlSummary->Clear("D");
1370 for (i=mgr->BeginChildren(); i!=mgr->EndChildren(); ++i)
1372 el = ((TEveElement*)(*i));
1373 if (el->IsA() == TEvePointSet::Class()) {
1374 TEvePointSet *ps = (TEvePointSet *)el;
1375 TString ename = ps->GetElementName();
1376 TString etitle = ps->GetElementTitle();
1377 //ename.Remove(ename.First('\''));
1378 //etitle.Remove(0, 2);
1379 Int_t nel = atoi(etitle.Data());
1380 table = fgHtmlSummary->AddTable(ename, 0, nel);
1382 else if (el->IsA() == TEveTrackList::Class()) {
1383 TEveTrackList *tracks = (TEveTrackList *)el;
1384 TString ename = tracks->GetElementName();
1385 // ename.Remove(ename.First('\''));
1386 table = fgHtmlSummary->AddTable(ename.Data(), 5,
1387 tracks->NumChildren(), kTRUE, "first");
1388 table->SetLabel(0, "Momentum");
1389 table->SetLabel(1, "P_t");
1390 table->SetLabel(2, "Phi");
1391 table->SetLabel(3, "Theta");
1392 table->SetLabel(4, "Eta");
1394 for (j=tracks->BeginChildren(); j!=tracks->EndChildren(); ++j) {
1395 Float_t p = ((TEveTrack*)(*j))->GetMomentum().Mag();
1396 table->SetValue(0, k, p);
1397 Float_t pt = ((TEveTrack*)(*j))->GetMomentum().Perp();
1398 table->SetValue(1, k, pt);
1399 Float_t phi = ((TEveTrack*)(*j))->GetMomentum().Phi();
1400 table->SetValue(2, k, phi);
1401 Float_t theta = ((TEveTrack*)(*j))->GetMomentum().Theta();
1402 table->SetValue(3, k, theta);
1403 Float_t eta = ((TEveTrack*)(*j))->GetMomentum().Eta();
1404 table->SetValue(4, k, eta);
1409 fgHtmlSummary->Build();
1411 fgHtml->ParseText((char*)fgHtmlSummary->Html().Data());
1419 #pragma link C++ class SplitGLView;