Logo ROOT  
Reference Guide
TEveBrowser.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TEveBrowser.h"
13
14#include "TEveUtil.h"
15#include "TEveElement.h"
16#include "TEveManager.h"
17#include "TEveSelection.h"
18#include "TEveGedEditor.h"
19#include "TEveWindow.h"
20#include "TEveWindowManager.h"
21
22#include "TGFileBrowser.h"
23#include "TBrowser.h"
24
25#include <Riostream.h>
26
27#include "TClass.h"
28#include "TROOT.h"
29#include "TStyle.h"
30#include "TSystem.h"
31#include "TRint.h"
32#include "TVirtualX.h"
33
34#include "TApplication.h"
35#include "TFile.h"
36#include "TClassMenuItem.h"
37
38#include "TColor.h"
39
40#include "TGCanvas.h"
41#include "TGSplitter.h"
42#include "TGStatusBar.h"
43#include "TGMenu.h"
44#include "TGPicture.h"
45#include "TGToolBar.h"
46#include "TGLabel.h"
47#include "TGXYLayout.h"
48#include "TGNumberEntry.h"
49#include <KeySymbols.h>
50
51#include "TGLSAViewer.h"
52#include "TGLSAFrame.h"
53#include "TGTab.h"
54
55#include "TGeoVolume.h"
56#include "TGeoNode.h"
57
58/** \class TEveListTreeItem
59\ingroup TEve
60Special list-tree-item for Eve.
61
62Most state is picked directly from TEveElement, no need to store it
63locally nor to manage its consistency.
64
65Handles also selected/highlighted colors and, in the future, drag-n-drop.
66*/
67
69
70////////////////////////////////////////////////////////////////////////////////
71/// Warn about access to function members that should never be called.
72/// TGListTree calls them in cases that are not used by Eve.
73
74void TEveListTreeItem::NotSupported(const char* func) const
75{
76 Warning(Form("TEveListTreeItem::%s()", func), "not supported.");
77}
78
79////////////////////////////////////////////////////////////////////////////////
80/// Return highlight color corresponding to current state of TEveElement.
81
83{
84 switch (fElement->GetSelectedLevel())
85 {
86 case 1: return TColor::Number2Pixel(kBlue - 2);
87 case 2: return TColor::Number2Pixel(kBlue - 6);
88 case 3: return TColor::Number2Pixel(kCyan - 2);
89 case 4: return TColor::Number2Pixel(kCyan - 6);
90 }
92}
93
94////////////////////////////////////////////////////////////////////////////////
95/// Item's check-box state has been toggled ... forward to element's
96/// render-state.
97
99{
102}
103
104/** \class TEveGListTreeEditorFrame
105\ingroup TEve
106Composite GUI frame for parallel display of a TGListTree and TEveGedEditor.
107*/
108
110
112
113////////////////////////////////////////////////////////////////////////////////
114/// Constructor.
115
117 TGMainFrame (p ? p : gClient->GetRoot(), width, height),
118 fFrame (0),
119 fLTFrame (0),
120 fListTree (0),
121 fSplitter (0),
122 fEditor (0),
123 fCtxMenu (0),
124 fSignalsConnected (kFALSE)
125{
127
128 fFrame = new TGCompositeFrame(this, width, height, kVerticalFrame);
129
130 // List-tree
144
145 // Splitter
148
149 // Editor
152 fEditor = (TEveGedEditor*) gROOT->GetClass(fgEditorClass)->New();
157 {
158 TGFrameElement *el = 0;
159 TIter next(fFrame->GetList());
160 while ((el = (TGFrameElement *) next())) {
161 if (el->fFrame == fEditor)
162 if (el->fLayout) {
164 el->fLayout->SetPadLeft(0); el->fLayout->SetPadRight(1);
165 el->fLayout->SetPadTop(2); el->fLayout->SetPadBottom(1);
166 break;
167 }
168 }
169 }
171
173
174 fCtxMenu = new TContextMenu("", "");
175
176 Layout();
178 MapWindow();
179}
180
181////////////////////////////////////////////////////////////////////////////////
182/// Destructor.
183
185{
187
188 delete fCtxMenu;
189
190 // Should un-register editor, all items and list-tree from gEve ... eventually.
191
192 delete fEditor;
193 delete fSplitter;
194 delete fListTree;
195 delete fLTCanvas;
196 delete fLTFrame;
197 delete fFrame;
198}
199
200////////////////////////////////////////////////////////////////////////////////
201/// Set GED editor class.
202
204{
205 fgEditorClass = edclass;
206}
207
208////////////////////////////////////////////////////////////////////////////////
209/// Connect list-tree signals.
210
212{
213 fListTree->Connect("MouseOver(TGListTreeItem*, UInt_t)", "TEveGListTreeEditorFrame",
214 this, "ItemBelowMouse(TGListTreeItem*, UInt_t)");
215 fListTree->Connect("Clicked(TGListTreeItem*, Int_t, UInt_t, Int_t, Int_t)", "TEveGListTreeEditorFrame",
216 this, "ItemClicked(TGListTreeItem*, Int_t, UInt_t, Int_t, Int_t)");
217 fListTree->Connect("DoubleClicked(TGListTreeItem*, Int_t)", "TEveGListTreeEditorFrame",
218 this, "ItemDblClicked(TGListTreeItem*, Int_t)");
219 fListTree->Connect("KeyPressed(TGListTreeItem*, ULong_t, ULong_t)", "TEveGListTreeEditorFrame",
220 this, "ItemKeyPress(TGListTreeItem*, UInt_t, UInt_t)");
221
223}
224
225////////////////////////////////////////////////////////////////////////////////
226/// Disconnect list-tree signals.
227
229{
230 if (!fSignalsConnected) return;
231
232 fListTree->Disconnect("MouseOver(TGListTreeItem*, UInt_t)",
233 this, "ItemBelowMouse(TGListTreeItem*, UInt_t)");
234 fListTree->Disconnect("Clicked(TGListTreeItem*, Int_t, UInt_t, Int_t, Int_t)",
235 this, "ItemClicked(TGListTreeItem*, Int_t, UInt_t, Int_t, Int_t)");
236 fListTree->Disconnect("DoubleClicked(TGListTreeItem*, Int_t)",
237 this, "ItemDblClicked(TGListTreeItem*, Int_t)");
238 fListTree->Disconnect("KeyPressed(TGListTreeItem*, ULong_t, ULong_t)",
239 this, "ItemKeyPress(TGListTreeItem*, UInt_t, UInt_t)");
240
242}
243
244////////////////////////////////////////////////////////////////////////////////
245/// Reconfigure to horizontal layout, list-tree and editor side by side.
246
248{
249 UnmapWindow();
250
254
255 TGFrameElement *el = 0;
256 TIter next(fFrame->GetList());
257 while ((el = (TGFrameElement *) next()))
258 {
259 if (el->fFrame == fSplitter)
260 {
261 // This is needed so that splitter window gets destroyed on server.
263 delete fSplitter;
264 el->fFrame = fSplitter = new TGVSplitter(fFrame);
266 el->fLayout->SetPadLeft(2); el->fLayout->SetPadRight (2);
267 el->fLayout->SetPadTop (1); el->fLayout->SetPadBottom(1);
268 }
269 else if (el->fFrame == fEditor)
270 {
274 }
275 }
276
279
280 Layout();
282 MapWindow();
283}
284
285////////////////////////////////////////////////////////////////////////////////
286/// Reconfigure to vertical layout, list-tree above the editor.
287
289{
290 UnmapWindow();
291
295
296 TGFrameElement *el = 0;
297 TIter next(fFrame->GetList());
298 while ((el = (TGFrameElement *) next()))
299 {
300 if (el->fFrame == fSplitter)
301 {
302 // This is needed so that splitter window gets destroyed on server.
304 delete fSplitter;
305 el->fFrame = fSplitter = new TGHSplitter(fFrame);
307 el->fLayout->SetPadLeft(2); el->fLayout->SetPadRight (2);
308 el->fLayout->SetPadTop (1); el->fLayout->SetPadBottom(1);
309 }
310 else if (el->fFrame == fEditor)
311 {
315 }
316 }
317
320
321 Layout();
323 MapWindow();
324}
325
326////////////////////////////////////////////////////////////////////////////////
327/// Different item is below mouse.
328
330{
331 TEveElement* el = entry ? (TEveElement*) entry->GetUserData() : 0;
333}
334
335////////////////////////////////////////////////////////////////////////////////
336/// Item has been clicked, based on mouse button do:
337/// - M1 - select, show in editor;
338/// - M2 - paste (call gEve->ElementPaste();
339/// - M3 - popup context menu.
340
342{
343 //printf("ItemClicked item %s List %d btn=%d, x=%d, y=%d\n",
344 // item->GetText(),fDisplayFrame->GetList()->GetEntries(), btn, x, y);
345
346 static const TEveException eh("TEveGListTreeEditorFrame::ItemClicked ");
347
348 TEveElement* el = (TEveElement*) item->GetUserData();
349 if (el == 0) return;
350 TObject* obj = el->GetObject(eh);
351
352 switch (btn)
353 {
354 case 1:
356 break;
357
358 case 2:
359 if (gEve->ElementPaste(el))
360 gEve->Redraw3D();
361 break;
362
363 case 3:
364 // If control pressed, show menu for render-element itself.
365 // event->fState & kKeyControlMask
366 // ??? how do i get current event?
367 // !!!!! Have this now ... fix.
368 if (obj) fCtxMenu->Popup(x, y, obj);
369 break;
370
371 default:
372 break;
373 }
374}
375
376////////////////////////////////////////////////////////////////////////////////
377/// Item has been double-clicked, potentially expand the children.
378
380{
381 static const TEveException eh("TEveGListTreeEditorFrame::ItemDblClicked ");
382
383 if (btn != 1) return;
384
385 TEveElement* el = (TEveElement*) item->GetUserData();
386 if (el == 0) return;
387
388 el->ExpandIntoListTree(fListTree, item);
389
390 TObject* obj = el->GetObject(eh);
391 if (obj)
392 {
393 // Browse geonodes.
394 if (obj->IsA()->InheritsFrom(TGeoNode::Class()))
395 {
396 TGeoNode* n = dynamic_cast<TGeoNode*>(obj);
397 if (item->GetFirstChild() == 0 && n->GetNdaughters())
398 {
400 for (Int_t i=0; i< n->GetNdaughters(); i++)
401 {
402 TString title;
403 title.Form("%d : %s[%d]", i,
404 n->GetDaughter(i)->GetVolume()->GetName(),
405 n->GetDaughter(i)->GetNdaughters());
406
407 TGListTreeItem* child = fListTree->AddItem(item, title.Data());
408 child->SetUserData(n->GetDaughter(i));
409 }
410 }
411 }
412 }
413}
414
415////////////////////////////////////////////////////////////////////////////////
416/// A key has been pressed for an item.
417///
418/// Only <Delete>, <Enter> and <Return> keys are handled here,
419/// otherwise the control is passed back to TGListTree.
420
422{
423 static const TEveException eh("TEveGListTreeEditorFrame::ItemKeyPress ");
424
425 entry = fListTree->GetCurrent();
426 if (entry == 0) return;
427
428 TEveElement* el = (TEveElement*) entry->GetUserData();
429
430 fListTree->SetEventHandled(); // Reset back to false in default case.
431
432 switch (keysym)
433 {
434 case kKey_Delete:
435 {
436 if (entry->GetParent())
437 {
438 if (el->GetDenyDestroy() > 0 && el->GetNItems() == 1)
439 throw(eh + "DestroyDenied set for this item.");
440
441 TEveElement* parent = (TEveElement*) entry->GetParent()->GetUserData();
442
443 if (parent)
444 {
445 gEve->RemoveElement(el, parent);
446 gEve->Redraw3D();
447 }
448 }
449 else
450 {
451 if (el->GetDenyDestroy() > 0)
452 throw(eh + "DestroyDenied set for this top-level item.");
453 gEve->RemoveFromListTree(el, fListTree, entry);
454 gEve->Redraw3D();
455 }
456 break;
457 }
458
459 case kKey_Enter:
460 case kKey_Return:
461 {
463 break;
464 }
465
466 default:
467 {
469 break;
470 }
471 }
472}
473
474
475/** \class TEveBrowser
476\ingroup TEve
477Specialization of TRootBrowser for Eve.
478*/
479
481
482////////////////////////////////////////////////////////////////////////////////
483/// Add "Export to CINT" into context-menu for class cl.
484
486{
487 TList* l = cl->GetMenuList();
489 "Export to CINT", "ExportToCINT", this, "const char*,TObject*", 1);
490
491 l->AddFirst(n);
492}
493
494////////////////////////////////////////////////////////////////////////////////
495/// Calculate position of a widget for reparenting into parent.
496
498{
499 UInt_t w, h;
500 Window_t childdum;
501 gVirtualX->GetWindowSize(parent->GetId(), x, y, w, h);
502 gVirtualX->TranslateCoordinates(parent->GetId(),
503 gClient->GetDefaultRoot()->GetId(),
504 0, 0, x, y, childdum);
505}
506
507namespace
508{
509enum EEveMenu_e {
510 kNewMainFrameSlot, kNewTabSlot,
511 kNewViewer, kNewScene,
512 kNewBrowser, kNewCanvas, kNewCanvasExt, kNewTextEditor, kNewHtmlBrowser,
513 kSel_PS_Ignore, kSel_PS_Element, kSel_PS_Projectable, kSel_PS_Compound,
514 kSel_PS_PableCompound, kSel_PS_Master, kSel_PS_END,
515 kHil_PS_Ignore, kHil_PS_Element, kHil_PS_Projectable, kHil_PS_Compound,
516 kHil_PS_PableCompound, kHil_PS_Master, kHil_PS_END,
517 kVerticalBrowser,
518 kWinDecorNormal, kWinDecorHide, kWinDecorTitleBar, kWinDecorMiniBar
519};
520
521}
522
523////////////////////////////////////////////////////////////////////////////////
524/// Constructor.
525
527 TRootBrowser(0, "Eve Main Window", w, h, "", kFALSE),
528 fFileBrowser(0),
529 fEvePopup (0),
530 fSelPopup (0),
531 fHilPopup (0)
532{
533 // Construct Eve menu.
534
535 fEvePopup = new TGPopupMenu(gClient->GetRoot());
536 fEvePopup->AddEntry("New &MainFrame Slot", kNewMainFrameSlot);
537 fEvePopup->AddEntry("New &Tab Slot", kNewTabSlot);
539 fEvePopup->AddEntry("New &Viewer", kNewViewer);
540 fEvePopup->AddEntry("New &Scene", kNewScene);
542 fEvePopup->AddEntry("New &Browser", kNewBrowser);
543 fEvePopup->AddEntry("New &Canvas", kNewCanvas);
544 fEvePopup->AddEntry("New Canvas Ext", kNewCanvasExt);
545 fEvePopup->AddEntry("New Text &Editor", kNewTextEditor);
546 // fEvePopup->AddEntry("New HTML Browser", kNewHtmlBrowser);
548
549 {
550 fSelPopup = new TGPopupMenu(gClient->GetRoot());
551 fSelPopup->AddEntry("Ignore", kSel_PS_Ignore);
552 fSelPopup->AddEntry("Element", kSel_PS_Element);
553 fSelPopup->AddEntry("Projectable", kSel_PS_Projectable);
554 fSelPopup->AddEntry("Compound", kSel_PS_Compound);
555 fSelPopup->AddEntry("Projectable and Compound",
556 kSel_PS_PableCompound);
557 fSelPopup->AddEntry("Master", kSel_PS_Master);
558 fSelPopup->RCheckEntry(kSel_PS_Ignore + gEve->GetSelection()->GetPickToSelect(),
559 kSel_PS_Ignore, kSel_PS_END - 1);
560 fEvePopup->AddPopup("Selection", fSelPopup);
561 }
562 {
563 fHilPopup = new TGPopupMenu(gClient->GetRoot());
564 fHilPopup->AddEntry("Ignore", kHil_PS_Ignore);
565 fHilPopup->AddEntry("Element", kHil_PS_Element);
566 fHilPopup->AddEntry("Projectable", kHil_PS_Projectable);
567 fHilPopup->AddEntry("Compound", kHil_PS_Compound);
568 fHilPopup->AddEntry("Projectable and Compound",
569 kHil_PS_PableCompound);
570 fHilPopup->AddEntry("Master", kHil_PS_Master);
571 fHilPopup->RCheckEntry(kHil_PS_Ignore + gEve->GetHighlight()->GetPickToSelect(),
572 kHil_PS_Ignore, kHil_PS_END - 1);
573 fEvePopup->AddPopup("Highlight", fHilPopup);
574 }
575
577 fEvePopup->AddEntry("Vertical browser", kVerticalBrowser);
578 fEvePopup->CheckEntry(kVerticalBrowser);
579 {
580 TGPopupMenu *wd = new TGPopupMenu(gClient->GetRoot());
581 wd->AddEntry("Normal", kWinDecorNormal);
582 wd->AddEntry("Hide", kWinDecorHide);
583 wd->AddEntry("Title bars", kWinDecorTitleBar);
584 wd->AddEntry("Mini bars", kWinDecorMiniBar);
585 fEvePopup->AddPopup("Window decorations", wd);
586 }
587
588 fEvePopup->Connect("Activated(Int_t)", "TEveBrowser",
589 this, "EveMenu(Int_t)");
590
591 fMenuBar->AddPopup("&Eve", fEvePopup, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
592
596
597 // Rename "Close Window" to "Close Eve"
599}
600
601////////////////////////////////////////////////////////////////////////////////
602/// Handle events from Eve menu.
603
605{
606 switch (id)
607 {
608 case kNewMainFrameSlot: {
611 break;
612 }
613 case kNewTabSlot: {
616 break;
617 }
618 case kNewViewer: {
619 gEve->SpawnNewViewer("Viewer Pepe");
620 break;
621 }
622 case kNewScene: {
623 gEve->SpawnNewScene("Scena Mica");
624 break;
625 }
626 case kNewBrowser: {
627 gROOT->ProcessLineFast("new TBrowser");
628 break;
629 }
630 case kNewCanvas: {
632 gROOT->ProcessLineFast("new TCanvas");
634 SetTabTitle("Canvas", 1);
635 break;
636 }
637 case kNewCanvasExt: {
638 gROOT->ProcessLineFast("new TCanvas");
639 break;
640 }
641 case kNewTextEditor: {
643 gROOT->ProcessLineFast(Form("new TGTextEditor((const char *)0, (const TGWindow *)0x%lx)", (ULong_t)gClient->GetRoot()));
645 SetTabTitle("Editor", 1);
646 break;
647 }
648 case kNewHtmlBrowser: {
649 gSystem->Load("libGuiHtml");
650 if (gSystem->Load("libRHtml") >= 0)
651 {
653 gROOT->ProcessLine(Form("new TGHtmlBrowser(\"http://root.cern.ch/root/html/ClassIndex.html\", \
654 (const TGWindow *)0x%lx)", (ULong_t)gClient->GetRoot()));
656 SetTabTitle("HTML", 1);
657 }
658 break;
659 }
660 case kSel_PS_Ignore:
661 case kSel_PS_Element:
662 case kSel_PS_Projectable:
663 case kSel_PS_Compound:
664 case kSel_PS_PableCompound:
665 case kSel_PS_Master: {
666 gEve->GetSelection()->SetPickToSelect(id - kSel_PS_Ignore);
667 fSelPopup->RCheckEntry(kSel_PS_Ignore + gEve->GetSelection()->GetPickToSelect(),
668 kSel_PS_Ignore, kSel_PS_END - 1);
669 break;
670 }
671 case kHil_PS_Ignore:
672 case kHil_PS_Element:
673 case kHil_PS_Projectable:
674 case kHil_PS_Compound:
675 case kHil_PS_PableCompound:
676 case kHil_PS_Master: {
677 gEve->GetHighlight()->SetPickToSelect(id - kHil_PS_Ignore);
678 fHilPopup->RCheckEntry(kHil_PS_Ignore + gEve->GetHighlight()->GetPickToSelect(),
679 kHil_PS_Ignore, kHil_PS_END - 1);
680 break;
681 }
682 case kVerticalBrowser: {
683 if (fEvePopup->IsEntryChecked(kVerticalBrowser)) {
685 fEvePopup->UnCheckEntry(kVerticalBrowser);
686 } else {
688 fEvePopup->CheckEntry(kVerticalBrowser);
689 }
690 break;
691 }
692 case kWinDecorNormal: {
694 break;
695 }
696 case kWinDecorHide: {
698 break;
699 }
700 case kWinDecorTitleBar: {
702 break;
703 }
704 case kWinDecorMiniBar: {
706 break;
707 }
708
709 default: {
710 break;
711 }
712 }
713}
714
715////////////////////////////////////////////////////////////////////////////////
716/// Initialize standard plugins.
717
719{
720 TString o(opt);
721
722 // File Browser plugin ... we have to process it here.
723 if (o.Contains('F'))
724 {
727 fb->BrowseObj(gROOT);
728 fb->Show();
729 fFileBrowser = fb;
730 StopEmbedding("Files");
731 o.ReplaceAll("F", ".");
732 }
733
735}
736
737////////////////////////////////////////////////////////////////////////////////
738/// Create a file-browser. Caller should provide Start/StopEmbedding() calls
739/// and populate the new browser.
740///
741/// If flag make_default is kTRUE, the default file-browser is set to the
742/// newly created browser.
743
745{
746 TBrowserImp imp;
747 TBrowser *tb = new TBrowser("Pipi", "Strel", &imp);
748 TGFileBrowser *fb = new TGFileBrowser(gClient->GetRoot(), tb, 200, 500);
749 tb->SetBrowserImp((TBrowserImp *)this);
750 fb->SetBrowser(tb);
751 fb->SetNewBrowser(this);
752 gROOT->GetListOfBrowsers()->Remove(tb);
753 // This guy is never used and stays in list-of-cleanups after destruction.
754 // So let's just delete it now.
755 delete tb->GetContextMenu();
756
757 if (make_default)
758 fFileBrowser = fb;
759
760 return fb;
761}
762
763////////////////////////////////////////////////////////////////////////////////
764/// Returns the default file-browser.
765
767{
768 return fFileBrowser;
769}
770
771////////////////////////////////////////////////////////////////////////////////
772/// Set the default file browser.
773
775{
776 fFileBrowser = b;
777}
778
779////////////////////////////////////////////////////////////////////////////////
780/// Override from TRootBrowser. We need to be more brutal as fBrowser is
781/// not set in Eve case.
782
784{
785 delete this;
786}
787
788////////////////////////////////////////////////////////////////////////////////
789/// Virtual from TRootBrowser. Need to intercept closing of Eve tabs.
790
792{
793 // Check if this is an Eve window and destroy accordingly.
795 if (pcf)
796 {
797 TGFrameElement *fe = (TGFrameElement *) pcf->GetList()->First();
798 if (fe)
799 {
800 TEveCompositeFrame *ecf = dynamic_cast<TEveCompositeFrame*>(fe->fFrame);
801 if (ecf)
802 {
804 return;
805 }
806 }
807 }
808
809 // Fallback to standard tab destruction
811}
812
813////////////////////////////////////////////////////////////////////////////////
814/// Virtual from TGMainFrame. Calls TEveManager::Terminate().
815
817{
819}
820
821////////////////////////////////////////////////////////////////////////////////
822/// Hide the bottom tab (usually holding command-line widget).
823
825{
827 fV2->HideFrame(fH2);
828}
829
830////////////////////////////////////////////////////////////////////////////////
831/// TRootBrowser keeps (somewhat unnecessarily) counters for number ob tabs
832/// on each position. Eve bastardizes the right tab so we have to fix the counters
833/// when a new window is added ... it doesn't seem to be needed when it is removed.
834
836{
839}
void Class()
Definition: Class.C:29
@ kRaisedFrame
Definition: GuiTypes.h:384
@ kSunkenFrame
Definition: GuiTypes.h:383
@ kVerticalFrame
Definition: GuiTypes.h:381
@ kDoubleBorder
Definition: GuiTypes.h:385
@ kFixedWidth
Definition: GuiTypes.h:387
@ kHorizontalFrame
Definition: GuiTypes.h:382
@ kFixedHeight
Definition: GuiTypes.h:389
const Mask_t kKeyControlMask
Definition: GuiTypes.h:196
ULong_t Pixel_t
Definition: GuiTypes.h:39
Handle_t Window_t
Definition: GuiTypes.h:28
@ kKey_Return
Definition: KeySymbols.h:30
@ kKey_Delete
Definition: KeySymbols.h:33
@ kKey_Enter
Definition: KeySymbols.h:31
#define b(i)
Definition: RSha256.hxx:100
#define h(i)
Definition: RSha256.hxx:106
const Bool_t kFALSE
Definition: RtypesCore.h:90
unsigned long ULong_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassImp(name)
Definition: Rtypes.h:361
@ kCyan
Definition: Rtypes.h:64
@ kBlue
Definition: Rtypes.h:64
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
void Warning(const char *location, const char *msgfmt,...)
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
#define gClient
Definition: TGClient.h:166
@ kNoCleanup
Definition: TGFrame.h:49
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsNormal
Definition: TGLayout.h:39
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
#define gROOT
Definition: TROOT.h:406
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
Definition: TSystem.h:556
#define gVirtualX
Definition: TVirtualX.h:338
ABC describing GUI independent browser implementation protocol.
Definition: TBrowserImp.h:29
virtual void SetBrowser(TBrowser *b)
Definition: TBrowserImp.h:70
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
TContextMenu * GetContextMenu() const
Definition: TBrowser.h:94
void SetBrowserImp(TBrowserImp *i)
Definition: TBrowser.h:93
Describes one element of the context menu associated to a class The menu item may describe.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TList * GetMenuList() const
Return the list of menu items associated with the class.
Definition: TClass.cxx:4304
static ULong_t Number2Pixel(Int_t ci)
Static method that given a color index number, returns the corresponding pixel value.
Definition: TColor.cxx:2016
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:40
virtual void Popup(Int_t x, Int_t y, TObject *obj, TVirtualPad *c=nullptr, TVirtualPad *p=nullptr)
Popup context menu at given location in canvas c and pad p for selected object.
Specialization of TRootBrowser for Eve.
Definition: TEveBrowser.h:130
TEveBrowser(const TEveBrowser &)
void CalculateReparentXY(TGObject *parent, Int_t &x, Int_t &y)
Calculate position of a widget for reparenting into parent.
TGFileBrowser * GetFileBrowser() const
Returns the default file-browser.
void SanitizeTabCounts()
TRootBrowser keeps (somewhat unnecessarily) counters for number ob tabs on each position.
void EveMenu(Int_t id)
Handle events from Eve menu.
void SetupCintExport(TClass *cl)
Add "Export to CINT" into context-menu for class cl.
virtual void CloseTab(Int_t id)
Virtual from TRootBrowser. Need to intercept closing of Eve tabs.
TGPopupMenu * fSelPopup
Definition: TEveBrowser.h:140
TGPopupMenu * fHilPopup
Definition: TEveBrowser.h:141
TGFileBrowser * MakeFileBrowser(Bool_t make_default=kFALSE)
Create a file-browser.
void SetFileBrowser(TGFileBrowser *b)
Set the default file browser.
void InitPlugins(Option_t *opt="FI")
Initialize standard plugins.
TGPopupMenu * fEvePopup
Definition: TEveBrowser.h:139
virtual void CloseWindow()
Virtual from TGMainFrame. Calls TEveManager::Terminate().
void HideBottomTab()
Hide the bottom tab (usually holding command-line widget).
virtual void ReallyDelete()
Override from TRootBrowser.
TGFileBrowser * fFileBrowser
Definition: TEveBrowser.h:138
Abstract base-class for frame-slots that encompass EVE-windows (sub-classes of TEveWindow).
Definition: TEveWindow.h:40
TEveWindow * GetEveWindow() const
Definition: TEveWindow.h:86
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:34
virtual UChar_t GetSelectedLevel() const
Get selection level, needed for rendering selection and highlight feedback.
virtual Int_t GetNItems() const
Definition: TEveElement.h:222
virtual void ExpandIntoListTree(TGListTree *ltree, TGListTreeItem *parent)
Populates parent with elements.
Int_t GetDenyDestroy() const
Returns the number of times deny-destroy has been requested on the element.
virtual Bool_t SetRnrState(Bool_t rnr)
Set render state of this element and of its children to the same value.
virtual void ElementChanged(Bool_t update_scenes=kTRUE, Bool_t redraw=kFALSE)
Call this after an element has been changed so that the state can be propagated around the framework.
virtual TObject * GetObject(const TEveException &eh) const
Get a TObject associated with this render-element.
Exception class thrown by TEve classes and macros.
Definition: TEveUtil.h:102
Composite GUI frame for parallel display of a TGListTree and TEveGedEditor.
Definition: TEveBrowser.h:83
static TString fgEditorClass
Definition: TEveBrowser.h:102
static void SetEditorClass(const char *edclass)
Set GED editor class.
virtual ~TEveGListTreeEditorFrame()
Destructor.
void ItemClicked(TGListTreeItem *entry, Int_t btn, UInt_t mask, Int_t x, Int_t y)
Item has been clicked, based on mouse button do:
void DisconnectSignals()
Disconnect list-tree signals.
TEveGListTreeEditorFrame(const TEveGListTreeEditorFrame &)
void ReconfToVertical()
Reconfigure to vertical layout, list-tree above the editor.
void ItemBelowMouse(TGListTreeItem *entry, UInt_t mask)
Different item is below mouse.
TEveGedEditor * fEditor
Definition: TEveBrowser.h:96
TGCompositeFrame * fLTFrame
Definition: TEveBrowser.h:91
void ItemDblClicked(TGListTreeItem *item, Int_t btn)
Item has been double-clicked, potentially expand the children.
TContextMenu * fCtxMenu
Definition: TEveBrowser.h:98
TGCompositeFrame * fFrame
Definition: TEveBrowser.h:90
void ItemKeyPress(TGListTreeItem *entry, UInt_t keysym, UInt_t mask)
A key has been pressed for an item.
TGListTree * fListTree
Definition: TEveBrowser.h:94
void ReconfToHorizontal()
Reconfigure to horizontal layout, list-tree and editor side by side.
void ConnectSignals()
Connect list-tree signals.
TGSplitter * fSplitter
Definition: TEveBrowser.h:95
Specialization of TGedEditor for proper update propagation to TEveManager.
Definition: TEveGedEditor.h:27
Special list-tree-item for Eve.
Definition: TEveBrowser.h:30
TEveElement * fElement
Definition: TEveBrowser.h:36
virtual Bool_t IsChecked() const
Definition: TEveBrowser.h:68
virtual void Toggle()
Item's check-box state has been toggled ... forward to element's render-state.
Definition: TEveBrowser.cxx:98
void NotSupported(const char *func) const
Warn about access to function members that should never be called.
Definition: TEveBrowser.cxx:74
virtual Pixel_t GetActiveColor() const
Return highlight color corresponding to current state of TEveElement.
Definition: TEveBrowser.cxx:82
TEveGListTreeEditorFrame * GetLTEFrame() const
Definition: TEveManager.h:138
static void Terminate()
Properly terminate global TEveManager.
TEveSelection * GetSelection() const
Definition: TEveManager.h:129
Bool_t ElementPaste(TEveElement *element)
Paste has been called.
void RemoveElement(TEveElement *element, TEveElement *parent)
Remove element from parent.
TEveWindowManager * GetWindowManager() const
Definition: TEveManager.h:142
TEveViewer * SpawnNewViewer(const char *name, const char *title="", Bool_t embed=kTRUE)
Create a new GL viewer.
void Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
Definition: TEveManager.h:168
void RemoveFromListTree(TEveElement *element, TGListTree *lt, TGListTreeItem *lti)
Remove top-level element from list-tree with specified tree-item.
TEveScene * SpawnNewScene(const char *name, const char *title="")
Create a new scene.
TEveSelection * GetHighlight() const
Definition: TEveManager.h:130
void SetPickToSelect(Int_t ps)
Definition: TEveSelection.h:65
virtual void UserPickedElement(TEveElement *el, Bool_t multi=kFALSE)
Called when user picks/clicks on an element.
Int_t GetPickToSelect() const
Definition: TEveSelection.h:64
void ShowNormalEveDecorations()
Show eve decorations (title-bar or mini-bar) as specified for the contained window on all frames.
void SetShowTitleBars(Bool_t state)
Set show title-bar state on all frames.
void HideAllEveDecorations()
Hide all eve decorations (title-bar and mini-bar) on all frames.
void SelectWindow(TEveWindow *w)
Entry-point for communicating the fact that a window was acted upon in such a way that it should beco...
Description of TEveWindowSlot.
Definition: TEveWindow.h:302
virtual void DestroyWindowAndSlot()
Destroy eve-window and its frame-slot.
Definition: TEveWindow.cxx:868
static TEveWindowSlot * CreateWindowMainFrame(TEveWindow *eve_parent=0)
Create a new main-frame and populate it with a default window-slot.
Definition: TEveWindow.cxx:978
static TEveWindowSlot * CreateWindowInTab(TGTab *tab, TEveWindow *eve_parent=0)
Create a new tab in a given tab-widget and populate it with a default window-slot.
virtual void SetContainer(TGFrame *f)
Definition: TGCanvas.h:232
TGViewPort * GetViewPort() const
Definition: TGCanvas.h:227
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:234
virtual TList * GetList() const
Definition: TGFrame.h:347
TGCompositeFrame(const TGCompositeFrame &)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
Definition: TGFrame.cxx:932
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1241
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:1027
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1056
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Definition: TGFrame.cxx:1006
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1174
virtual void Associate(const TGWindow *w)
Definition: TGCanvas.h:99
void SetNewBrowser(TRootBrowser *b)
Definition: TGFileBrowser.h:89
virtual void Show()
Definition: TGFileBrowser.h:85
virtual void BrowseObj(TObject *obj)
Browse object.
TGLayoutHints * fLayout
Definition: TGLayout.h:121
TGFrame * fFrame
Definition: TGLayout.h:119
static Pixel_t GetDefaultSelectedBackground()
Get default selected frame background.
Definition: TGFrame.cxx:680
virtual void ReparentWindow(const TGWindow *p, Int_t x=0, Int_t y=0)
Reparent window, make p the new parent and position the window at position (x,y) in new parent.
Definition: TGFrame.h:227
virtual UInt_t GetOptions() const
Definition: TGFrame.h:222
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
UInt_t GetHeight() const
Definition: TGFrame.h:250
virtual void MapWindow()
map window
Definition: TGFrame.h:229
UInt_t GetWidth() const
Definition: TGFrame.h:249
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
virtual void SetPadRight(Int_t v)
Definition: TGLayout.h:99
virtual void SetPadLeft(Int_t v)
Definition: TGLayout.h:98
virtual void SetPadTop(Int_t v)
Definition: TGLayout.h:96
virtual void SetPadBottom(Int_t v)
Definition: TGLayout.h:97
virtual void SetLayoutHints(ULong_t lh)
Definition: TGLayout.h:95
TGListTreeItem * GetFirstChild() const
Definition: TGListTree.h:74
TGListTreeItem * GetParent() const
Definition: TGListTree.h:73
virtual void * GetUserData() const =0
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition: TGListTree.h:94
void SetColorMode(EColorMarkupMode colorMode)
Definition: TGListTree.h:451
void AddItem(TGListTreeItem *parent, TGListTreeItem *item)
Add given item to list tree.
Int_t DeleteChildren(TGListTreeItem *item)
Delete children of item from list.
void SetAutoCheckBoxPic(Bool_t on)
Definition: TGListTree.h:367
void SetEventHandled(Bool_t eh=kTRUE)
Definition: TGListTree.h:437
virtual void SetCanvas(TGCanvas *canvas)
Definition: TGListTree.h:334
TGListTreeItem * GetCurrent() const
Definition: TGListTree.h:398
void SetUserControl(Bool_t ctrl=kTRUE)
Definition: TGListTree.h:435
@ kColorUnderline
Definition: TGListTree.h:216
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
Add popup menu to menu bar.
Definition: TGMenu.cxx:416
TGHotString * GetLabel() const
Definition: TGMenu.h:101
TGClient * fClient
Definition: TGObject.h:37
Handle_t GetId() const
Definition: TGObject.h:47
virtual void AddPopup(TGHotString *s, TGPopupMenu *popup, TGMenuEntry *before=0, const TGPicture *p=0)
Add a (cascading) popup menu to a popup menu.
Definition: TGMenu.cxx:1150
virtual TGMenuEntry * GetEntry(Int_t id)
Find entry with specified id.
Definition: TGMenu.cxx:1895
virtual Bool_t IsEntryChecked(Int_t id)
Return true if menu item is checked.
Definition: TGMenu.cxx:1843
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=0, const TGPicture *p=0, TGMenuEntry *before=0)
Add a menu entry.
Definition: TGMenu.cxx:988
virtual void AddSeparator(TGMenuEntry *before=0)
Add a menu separator to the menu.
Definition: TGMenu.cxx:1058
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition: TGMenu.cxx:1780
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition: TGMenu.cxx:1805
virtual void RCheckEntry(Int_t id, Int_t IDfirst, Int_t IDlast)
Radio-select entry (note that they cannot be unselected, the selection must be moved to another entry...
Definition: TGMenu.cxx:1858
virtual void SetFrame(TGFrame *frame, Bool_t prev)=0
virtual void SetString(const char *s)
Definition: TGString.h:41
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition: TGTab.cxx:659
TGCompositeFrame * GetTabContainer(Int_t tabIndex) const
Return container of tab with index tabIndex.
Definition: TGTab.cxx:564
@ kEditEnable
Definition: TGWindow.h:57
@ kEditDisable
Definition: TGWindow.h:58
virtual void SetGlobal(Bool_t global)
Set editor global.
Definition: TGedEditor.cxx:273
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition: TGeoNode.h:41
A doubly linked list.
Definition: TList.h:44
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:658
Mother of all ROOT objects.
Definition: TObject.h:37
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:443
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:866
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1024
void SetTabTitle(const char *title, Int_t pos=kRight, Int_t subpos=-1)
Set text "title" of Tab "subpos" in TGTab "pos".
Int_t fCrTab[3]
Definition: TRootBrowser.h:92
TGHorizontalFrame * fH2
Definition: TRootBrowser.h:71
Int_t fNbTab[3]
Definition: TRootBrowser.h:91
TGHSplitter * fHSplitter
Definition: TRootBrowser.h:75
virtual void CloseTab(Int_t id)
Remove tab element id from right tab.
TGHorizontalFrame * fPreMenuFrame
Definition: TRootBrowser.h:78
TGTab * fTabRight
Definition: TRootBrowser.h:63
virtual void StopEmbedding(const char *name=0)
Definition: TRootBrowser.h:152
virtual void StartEmbedding(Int_t pos=kRight, Int_t subpos=-1)
Start embedding external frame in the tab "pos" and tab element "subpos".
TGPopupMenu * fMenuFile
Definition: TRootBrowser.h:82
TGTab * GetTabRight() const
Definition: TRootBrowser.h:141
TGHorizontalFrame * fTopMenuFrame
Definition: TRootBrowser.h:77
TGMenuBar * fMenuBar
Definition: TRootBrowser.h:81
void InitPlugins(Option_t *opt="")
Initialize default plugins.
TGVerticalFrame * fV2
Definition: TRootBrowser.h:73
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:687
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:619
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
Definition: TSystem.cxx:1850
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
auto * l
Definition: textangle.C:4