Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "TClass.h"
26#include "TROOT.h"
27#include "TSystem.h"
28#include "TVirtualX.h"
29
30#include "TClassMenuItem.h"
31
32#include "TColor.h"
33
34#include "TGCanvas.h"
35#include "TGMenu.h"
36#include "TGSplitter.h"
37#include "TGTab.h"
38#include <KeySymbols.h>
39#include "TGLSAViewer.h"
40
41#include "TGeoVolume.h"
42#include "TGeoNode.h"
43
44/** \class TEveListTreeItem
45\ingroup TEve
46Special list-tree-item for Eve.
47
48Most state is picked directly from TEveElement, no need to store it
49locally nor to manage its consistency.
50
51Handles also selected/highlighted colors and, in the future, drag-n-drop.
52*/
53
55
56////////////////////////////////////////////////////////////////////////////////
57/// Warn about access to function members that should never be called.
58/// TGListTree calls them in cases that are not used by Eve.
59
60void TEveListTreeItem::NotSupported(const char* func) const
61{
62 Warning(Form("TEveListTreeItem::%s()", func), "not supported.");
63}
64
65////////////////////////////////////////////////////////////////////////////////
66/// Return highlight color corresponding to current state of TEveElement.
67
69{
70 switch (fElement->GetSelectedLevel())
71 {
72 case 1: return TColor::Number2Pixel(kBlue - 2);
73 case 2: return TColor::Number2Pixel(kBlue - 6);
74 case 3: return TColor::Number2Pixel(kCyan - 2);
75 case 4: return TColor::Number2Pixel(kCyan - 6);
76 }
78}
79
80////////////////////////////////////////////////////////////////////////////////
81/// Item's check-box state has been toggled ... forward to element's
82/// render-state.
83
85{
88}
89
90/** \class TEveGListTreeEditorFrame
91\ingroup TEve
92Composite GUI frame for parallel display of a TGListTree and TEveGedEditor.
93*/
94
96
98
99////////////////////////////////////////////////////////////////////////////////
100/// Constructor.
101
103 TGMainFrame (p ? p : gClient->GetRoot(), width, height),
104 fFrame (0),
105 fLTFrame (0),
106 fListTree (0),
107 fSplitter (0),
108 fEditor (0),
109 fCtxMenu (0),
110 fSignalsConnected (kFALSE)
111{
113
115
116 // List-tree
130
131 // Splitter
134
135 // Editor
138 fEditor = (TEveGedEditor*) gROOT->GetClass(fgEditorClass)->New();
143 {
144 TGFrameElement *el = 0;
145 TIter next(fFrame->GetList());
146 while ((el = (TGFrameElement *) next())) {
147 if (el->fFrame == fEditor)
148 if (el->fLayout) {
150 el->fLayout->SetPadLeft(0); el->fLayout->SetPadRight(1);
151 el->fLayout->SetPadTop(2); el->fLayout->SetPadBottom(1);
152 break;
153 }
154 }
155 }
157
159
160 fCtxMenu = new TContextMenu("", "");
161
162 Layout();
164 MapWindow();
165}
166
167////////////////////////////////////////////////////////////////////////////////
168/// Destructor.
169
171{
173
174 delete fCtxMenu;
175
176 // Should un-register editor, all items and list-tree from gEve ... eventually.
177
178 delete fEditor;
179 delete fSplitter;
180 delete fListTree;
181 delete fLTCanvas;
182 delete fLTFrame;
183 delete fFrame;
184}
185
186////////////////////////////////////////////////////////////////////////////////
187/// Set GED editor class.
188
190{
191 fgEditorClass = edclass;
192}
193
194////////////////////////////////////////////////////////////////////////////////
195/// Connect list-tree signals.
196
198{
199 fListTree->Connect("MouseOver(TGListTreeItem*, UInt_t)", "TEveGListTreeEditorFrame",
200 this, "ItemBelowMouse(TGListTreeItem*, UInt_t)");
201 fListTree->Connect("Clicked(TGListTreeItem*, Int_t, UInt_t, Int_t, Int_t)", "TEveGListTreeEditorFrame",
202 this, "ItemClicked(TGListTreeItem*, Int_t, UInt_t, Int_t, Int_t)");
203 fListTree->Connect("DoubleClicked(TGListTreeItem*, Int_t)", "TEveGListTreeEditorFrame",
204 this, "ItemDblClicked(TGListTreeItem*, Int_t)");
205 fListTree->Connect("KeyPressed(TGListTreeItem*, ULong_t, ULong_t)", "TEveGListTreeEditorFrame",
206 this, "ItemKeyPress(TGListTreeItem*, UInt_t, UInt_t)");
207
209}
210
211////////////////////////////////////////////////////////////////////////////////
212/// Disconnect list-tree signals.
213
215{
216 if (!fSignalsConnected) return;
217
218 fListTree->Disconnect("MouseOver(TGListTreeItem*, UInt_t)",
219 this, "ItemBelowMouse(TGListTreeItem*, UInt_t)");
220 fListTree->Disconnect("Clicked(TGListTreeItem*, Int_t, UInt_t, Int_t, Int_t)",
221 this, "ItemClicked(TGListTreeItem*, Int_t, UInt_t, Int_t, Int_t)");
222 fListTree->Disconnect("DoubleClicked(TGListTreeItem*, Int_t)",
223 this, "ItemDblClicked(TGListTreeItem*, Int_t)");
224 fListTree->Disconnect("KeyPressed(TGListTreeItem*, ULong_t, ULong_t)",
225 this, "ItemKeyPress(TGListTreeItem*, UInt_t, UInt_t)");
226
228}
229
230////////////////////////////////////////////////////////////////////////////////
231/// Reconfigure to horizontal layout, list-tree and editor side by side.
232
234{
235 UnmapWindow();
236
240
241 TGFrameElement *el = 0;
242 TIter next(fFrame->GetList());
243 while ((el = (TGFrameElement *) next()))
244 {
245 if (el->fFrame == fSplitter)
246 {
247 // This is needed so that splitter window gets destroyed on server.
249 delete fSplitter;
250 el->fFrame = fSplitter = new TGVSplitter(fFrame);
252 el->fLayout->SetPadLeft(2); el->fLayout->SetPadRight (2);
253 el->fLayout->SetPadTop (1); el->fLayout->SetPadBottom(1);
254 }
255 else if (el->fFrame == fEditor)
256 {
260 }
261 }
262
265
266 Layout();
268 MapWindow();
269}
270
271////////////////////////////////////////////////////////////////////////////////
272/// Reconfigure to vertical layout, list-tree above the editor.
273
275{
276 UnmapWindow();
277
281
282 TGFrameElement *el = 0;
283 TIter next(fFrame->GetList());
284 while ((el = (TGFrameElement *) next()))
285 {
286 if (el->fFrame == fSplitter)
287 {
288 // This is needed so that splitter window gets destroyed on server.
290 delete fSplitter;
291 el->fFrame = fSplitter = new TGHSplitter(fFrame);
293 el->fLayout->SetPadLeft(2); el->fLayout->SetPadRight (2);
294 el->fLayout->SetPadTop (1); el->fLayout->SetPadBottom(1);
295 }
296 else if (el->fFrame == fEditor)
297 {
301 }
302 }
303
306
307 Layout();
309 MapWindow();
310}
311
312////////////////////////////////////////////////////////////////////////////////
313/// Different item is below mouse.
314
316{
317 TEveElement* el = entry ? (TEveElement*) entry->GetUserData() : 0;
319}
320
321////////////////////////////////////////////////////////////////////////////////
322/// Item has been clicked, based on mouse button do:
323/// - M1 - select, show in editor;
324/// - M2 - paste (call gEve->ElementPaste();
325/// - M3 - popup context menu.
326
328{
329 //printf("ItemClicked item %s List %d btn=%d, x=%d, y=%d\n",
330 // item->GetText(),fDisplayFrame->GetList()->GetEntries(), btn, x, y);
331
332 static const TEveException eh("TEveGListTreeEditorFrame::ItemClicked ");
333
334 TEveElement* el = (TEveElement*) item->GetUserData();
335 if (el == 0) return;
336 TObject* obj = el->GetObject(eh);
337
338 switch (btn)
339 {
340 case 1:
342 break;
343
344 case 2:
345 if (gEve->ElementPaste(el))
346 gEve->Redraw3D();
347 break;
348
349 case 3:
350 // If control pressed, show menu for render-element itself.
351 // event->fState & kKeyControlMask
352 // ??? how do i get current event?
353 // !!!!! Have this now ... fix.
354 if (obj) fCtxMenu->Popup(x, y, obj);
355 break;
356
357 default:
358 break;
359 }
360}
361
362////////////////////////////////////////////////////////////////////////////////
363/// Item has been double-clicked, potentially expand the children.
364
366{
367 static const TEveException eh("TEveGListTreeEditorFrame::ItemDblClicked ");
368
369 if (btn != 1) return;
370
371 TEveElement* el = (TEveElement*) item->GetUserData();
372 if (el == 0) return;
373
374 el->ExpandIntoListTree(fListTree, item);
375
376 TObject* obj = el->GetObject(eh);
377 if (obj)
378 {
379 // Browse geonodes.
380 if (obj->IsA()->InheritsFrom(TGeoNode::Class()))
381 {
382 TGeoNode* n = dynamic_cast<TGeoNode*>(obj);
383 if (item->GetFirstChild() == 0 && n->GetNdaughters())
384 {
386 for (Int_t i=0; i< n->GetNdaughters(); i++)
387 {
388 TString title;
389 title.Form("%d : %s[%d]", i,
390 n->GetDaughter(i)->GetVolume()->GetName(),
391 n->GetDaughter(i)->GetNdaughters());
392
393 TGListTreeItem* child = fListTree->AddItem(item, title.Data());
394 child->SetUserData(n->GetDaughter(i));
395 }
396 }
397 }
398 }
399}
400
401////////////////////////////////////////////////////////////////////////////////
402/// A key has been pressed for an item.
403///
404/// Only `<Delete>`, `<Enter>` and `<Return>` keys are handled here,
405/// otherwise the control is passed back to TGListTree.
406
408{
409 static const TEveException eh("TEveGListTreeEditorFrame::ItemKeyPress ");
410
411 entry = fListTree->GetCurrent();
412 if (entry == 0) return;
413
414 TEveElement* el = (TEveElement*) entry->GetUserData();
415
416 fListTree->SetEventHandled(); // Reset back to false in default case.
417
418 switch (keysym)
419 {
420 case kKey_Delete:
421 {
422 if (entry->GetParent())
423 {
424 if (el->GetDenyDestroy() > 0 && el->GetNItems() == 1)
425 throw(eh + "DestroyDenied set for this item.");
426
427 TEveElement* parent = (TEveElement*) entry->GetParent()->GetUserData();
428
429 if (parent)
430 {
431 gEve->RemoveElement(el, parent);
432 gEve->Redraw3D();
433 }
434 }
435 else
436 {
437 if (el->GetDenyDestroy() > 0)
438 throw(eh + "DestroyDenied set for this top-level item.");
439 gEve->RemoveFromListTree(el, fListTree, entry);
440 gEve->Redraw3D();
441 }
442 break;
443 }
444
445 case kKey_Enter:
446 case kKey_Return:
447 {
449 break;
450 }
451
452 default:
453 {
455 break;
456 }
457 }
458}
459
460
461/** \class TEveBrowser
462\ingroup TEve
463Specialization of TRootBrowser for Eve.
464*/
465
467
468////////////////////////////////////////////////////////////////////////////////
469/// Add "Export to CINT" into context-menu for class cl.
470
472{
473 TList* l = cl->GetMenuList();
475 "Export to CINT", "ExportToCINT", this, "const char*,TObject*", 1);
476
477 l->AddFirst(n);
478}
479
480////////////////////////////////////////////////////////////////////////////////
481/// Calculate position of a widget for reparenting into parent.
482
484{
485 UInt_t w, h;
486 Window_t childdum;
487 gVirtualX->GetWindowSize(parent->GetId(), x, y, w, h);
488 gVirtualX->TranslateCoordinates(parent->GetId(),
489 gClient->GetDefaultRoot()->GetId(),
490 0, 0, x, y, childdum);
491}
492
493namespace
494{
495enum EEveMenu_e {
496 kNewMainFrameSlot, kNewTabSlot,
497 kNewViewer, kNewScene,
498 kNewBrowser, kNewCanvas, kNewCanvasExt, kNewTextEditor, kNewHtmlBrowser,
499 kSel_PS_Ignore, kSel_PS_Element, kSel_PS_Projectable, kSel_PS_Compound,
500 kSel_PS_PableCompound, kSel_PS_Master, kSel_PS_END,
501 kHil_PS_Ignore, kHil_PS_Element, kHil_PS_Projectable, kHil_PS_Compound,
502 kHil_PS_PableCompound, kHil_PS_Master, kHil_PS_END,
503 kVerticalBrowser,
504 kWinDecorNormal, kWinDecorHide, kWinDecorTitleBar, kWinDecorMiniBar
505};
506
507}
508
509////////////////////////////////////////////////////////////////////////////////
510/// Constructor.
511
513 TRootBrowser(0, "Eve Main Window", w, h, "", kFALSE),
514 fFileBrowser(0),
515 fEvePopup (0),
516 fSelPopup (0),
517 fHilPopup (0)
518{
519 // Construct Eve menu.
520
521 fEvePopup = new TGPopupMenu(gClient->GetRoot());
522 fEvePopup->AddEntry("New &MainFrame Slot", kNewMainFrameSlot);
523 fEvePopup->AddEntry("New &Tab Slot", kNewTabSlot);
525 fEvePopup->AddEntry("New &Viewer", kNewViewer);
526 fEvePopup->AddEntry("New &Scene", kNewScene);
528 fEvePopup->AddEntry("New &Browser", kNewBrowser);
529 fEvePopup->AddEntry("New &Canvas", kNewCanvas);
530 fEvePopup->AddEntry("New Canvas Ext", kNewCanvasExt);
531 fEvePopup->AddEntry("New Text &Editor", kNewTextEditor);
532 // fEvePopup->AddEntry("New HTML Browser", kNewHtmlBrowser);
534
535 {
536 fSelPopup = new TGPopupMenu(gClient->GetRoot());
537 fSelPopup->AddEntry("Ignore", kSel_PS_Ignore);
538 fSelPopup->AddEntry("Element", kSel_PS_Element);
539 fSelPopup->AddEntry("Projectable", kSel_PS_Projectable);
540 fSelPopup->AddEntry("Compound", kSel_PS_Compound);
541 fSelPopup->AddEntry("Projectable and Compound",
542 kSel_PS_PableCompound);
543 fSelPopup->AddEntry("Master", kSel_PS_Master);
544 fSelPopup->RCheckEntry(kSel_PS_Ignore + gEve->GetSelection()->GetPickToSelect(),
545 kSel_PS_Ignore, kSel_PS_END - 1);
546 fEvePopup->AddPopup("Selection", fSelPopup);
547 }
548 {
549 fHilPopup = new TGPopupMenu(gClient->GetRoot());
550 fHilPopup->AddEntry("Ignore", kHil_PS_Ignore);
551 fHilPopup->AddEntry("Element", kHil_PS_Element);
552 fHilPopup->AddEntry("Projectable", kHil_PS_Projectable);
553 fHilPopup->AddEntry("Compound", kHil_PS_Compound);
554 fHilPopup->AddEntry("Projectable and Compound",
555 kHil_PS_PableCompound);
556 fHilPopup->AddEntry("Master", kHil_PS_Master);
557 fHilPopup->RCheckEntry(kHil_PS_Ignore + gEve->GetHighlight()->GetPickToSelect(),
558 kHil_PS_Ignore, kHil_PS_END - 1);
559 fEvePopup->AddPopup("Highlight", fHilPopup);
560 }
561
563 fEvePopup->AddEntry("Vertical browser", kVerticalBrowser);
564 fEvePopup->CheckEntry(kVerticalBrowser);
565 {
566 TGPopupMenu *wd = new TGPopupMenu(gClient->GetRoot());
567 wd->AddEntry("Normal", kWinDecorNormal);
568 wd->AddEntry("Hide", kWinDecorHide);
569 wd->AddEntry("Title bars", kWinDecorTitleBar);
570 wd->AddEntry("Mini bars", kWinDecorMiniBar);
571 fEvePopup->AddPopup("Window decorations", wd);
572 }
573
574 fEvePopup->Connect("Activated(Int_t)", "TEveBrowser",
575 this, "EveMenu(Int_t)");
576
577 fMenuBar->AddPopup("&Eve", fEvePopup, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
578
582
583 // Rename "Close Window" to "Close Eve"
585}
586
587////////////////////////////////////////////////////////////////////////////////
588/// Handle events from Eve menu.
589
591{
592 switch (id)
593 {
594 case kNewMainFrameSlot: {
597 break;
598 }
599 case kNewTabSlot: {
602 break;
603 }
604 case kNewViewer: {
605 gEve->SpawnNewViewer("Viewer Pepe");
606 break;
607 }
608 case kNewScene: {
609 gEve->SpawnNewScene("Scena Mica");
610 break;
611 }
612 case kNewBrowser: {
613 gROOT->ProcessLineFast("new TBrowser");
614 break;
615 }
616 case kNewCanvas: {
618 gROOT->ProcessLineFast("new TCanvas");
620 SetTabTitle("Canvas", 1);
621 break;
622 }
623 case kNewCanvasExt: {
624 gROOT->ProcessLineFast("new TCanvas");
625 break;
626 }
627 case kNewTextEditor: {
629 gROOT->ProcessLineFast(Form("new TGTextEditor((const char *)0, (const TGWindow *)0x%zx)", (size_t)gClient->GetRoot()));
631 SetTabTitle("Editor", 1);
632 break;
633 }
634 case kNewHtmlBrowser: {
635 gSystem->Load("libGuiHtml");
636 if (gSystem->Load("libRHtml") >= 0)
637 {
639 gROOT->ProcessLine(Form("new TGHtmlBrowser(\"http://root.cern.ch/root/html/ClassIndex.html\", \
640 (const TGWindow *)0x%zx)", (size_t)gClient->GetRoot()));
642 SetTabTitle("HTML", 1);
643 }
644 break;
645 }
646 case kSel_PS_Ignore:
647 case kSel_PS_Element:
648 case kSel_PS_Projectable:
649 case kSel_PS_Compound:
650 case kSel_PS_PableCompound:
651 case kSel_PS_Master: {
652 gEve->GetSelection()->SetPickToSelect(id - kSel_PS_Ignore);
653 fSelPopup->RCheckEntry(kSel_PS_Ignore + gEve->GetSelection()->GetPickToSelect(),
654 kSel_PS_Ignore, kSel_PS_END - 1);
655 break;
656 }
657 case kHil_PS_Ignore:
658 case kHil_PS_Element:
659 case kHil_PS_Projectable:
660 case kHil_PS_Compound:
661 case kHil_PS_PableCompound:
662 case kHil_PS_Master: {
663 gEve->GetHighlight()->SetPickToSelect(id - kHil_PS_Ignore);
664 fHilPopup->RCheckEntry(kHil_PS_Ignore + gEve->GetHighlight()->GetPickToSelect(),
665 kHil_PS_Ignore, kHil_PS_END - 1);
666 break;
667 }
668 case kVerticalBrowser: {
669 if (fEvePopup->IsEntryChecked(kVerticalBrowser)) {
671 fEvePopup->UnCheckEntry(kVerticalBrowser);
672 } else {
674 fEvePopup->CheckEntry(kVerticalBrowser);
675 }
676 break;
677 }
678 case kWinDecorNormal: {
680 break;
681 }
682 case kWinDecorHide: {
684 break;
685 }
686 case kWinDecorTitleBar: {
688 break;
689 }
690 case kWinDecorMiniBar: {
692 break;
693 }
694
695 default: {
696 break;
697 }
698 }
699}
700
701////////////////////////////////////////////////////////////////////////////////
702/// Initialize standard plugins.
703
705{
706 TString o(opt);
707
708 // File Browser plugin ... we have to process it here.
709 if (o.Contains('F'))
710 {
713 fb->BrowseObj(gROOT);
714 fb->Show();
715 fFileBrowser = fb;
716 StopEmbedding("Files");
717 o.ReplaceAll("F", ".");
718 }
719
721}
722
723////////////////////////////////////////////////////////////////////////////////
724/// Create a file-browser. Caller should provide Start/StopEmbedding() calls
725/// and populate the new browser.
726///
727/// If flag make_default is kTRUE, the default file-browser is set to the
728/// newly created browser.
729
731{
732 TBrowserImp imp;
733 TBrowser *tb = new TBrowser("Pipi", "Strel", &imp);
734 TGFileBrowser *fb = new TGFileBrowser(gClient->GetRoot(), tb, 200, 500);
735 tb->SetBrowserImp((TBrowserImp *)this);
736 fb->SetBrowser(tb);
737 fb->SetNewBrowser(this);
738 gROOT->GetListOfBrowsers()->Remove(tb);
739 // This guy is never used and stays in list-of-cleanups after destruction.
740 // So let's just delete it now.
741 delete tb->GetContextMenu();
742
743 if (make_default)
744 fFileBrowser = fb;
745
746 return fb;
747}
748
749////////////////////////////////////////////////////////////////////////////////
750/// Returns the default file-browser.
751
753{
754 return fFileBrowser;
755}
756
757////////////////////////////////////////////////////////////////////////////////
758/// Set the default file browser.
759
761{
762 fFileBrowser = b;
763}
764
765////////////////////////////////////////////////////////////////////////////////
766/// Override from TRootBrowser. We need to be more brutal as fBrowser is
767/// not set in Eve case.
768
770{
771 delete this;
772}
773
774////////////////////////////////////////////////////////////////////////////////
775/// Virtual from TRootBrowser. Need to intercept closing of Eve tabs.
776
778{
779 // Check if this is an Eve window and destroy accordingly.
781 if (pcf)
782 {
783 TGFrameElement *fe = (TGFrameElement *) pcf->GetList()->First();
784 if (fe)
785 {
786 TEveCompositeFrame *ecf = dynamic_cast<TEveCompositeFrame*>(fe->fFrame);
787 if (ecf)
788 {
790 return;
791 }
792 }
793 }
794
795 // Fallback to standard tab destruction
797}
798
799////////////////////////////////////////////////////////////////////////////////
800/// Virtual from TGMainFrame. Calls TEveManager::Terminate().
801
803{
805}
806
807////////////////////////////////////////////////////////////////////////////////
808/// Hide the bottom tab (usually holding command-line widget).
809
811{
813 fV2->HideFrame(fH2);
814}
815
816////////////////////////////////////////////////////////////////////////////////
817/// TRootBrowser keeps (somewhat unnecessarily) counters for number ob tabs
818/// on each position. Eve bastardizes the right tab so we have to fix the counters
819/// when a new window is added ... it doesn't seem to be needed when it is removed.
820
822{
825}
Handle_t Window_t
Window handle.
Definition GuiTypes.h: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:197
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
@ 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
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
@ kCyan
Definition Rtypes.h:66
@ kBlue
Definition Rtypes.h:66
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition TError.cxx:241
R__EXTERN TEveManager * gEve
#define gClient
Definition TGClient.h:157
@ kNoCleanup
Definition TGFrame.h:40
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsNormal
Definition TGLayout.h:32
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t child
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
#define gROOT
Definition TROOT.h:405
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2467
R__EXTERN TSystem * gSystem
Definition TSystem.h:560
#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:67
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
TContextMenu * GetContextMenu() const
Definition TBrowser.h:96
void SetBrowserImp(TBrowserImp *i)
Definition TBrowser.h:95
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:81
TList * GetMenuList() const
Return the list of menu items associated with the class.
Definition TClass.cxx:4341
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
Definition TClass.cxx:4874
static ULong_t Number2Pixel(Int_t ci)
Static method that given a color index number, returns the corresponding pixel value.
Definition TColor.cxx:2082
This class provides an interface to context sensitive popup menus.
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.
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
TGPopupMenu * fHilPopup
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
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
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:36
virtual UChar_t GetSelectedLevel() const
Get selection level, needed for rendering selection and highlight feedback.
virtual Int_t GetNItems() const
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
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.
void ReconfToHorizontal()
Reconfigure to horizontal layout, list-tree and editor side by side.
void ConnectSignals()
Connect list-tree signals.
Specialization of TGedEditor for proper update propagation to TEveManager.
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.
void NotSupported(const char *func) const
Warn about access to function members that should never be called.
virtual Pixel_t GetActiveColor() const
Return highlight color corresponding to current state of TEveElement.
TEveGListTreeEditorFrame * GetLTEFrame() const
static void Terminate()
Properly terminate global TEveManager.
TEveSelection * GetSelection() const
Bool_t ElementPaste(TEveElement *element)
Paste has been called.
void RemoveElement(TEveElement *element, TEveElement *parent)
Remove element from parent.
TEveWindowManager * GetWindowManager() const
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)
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
void SetPickToSelect(Int_t ps)
virtual void UserPickedElement(TEveElement *el, Bool_t multi=kFALSE)
Called when user picks/clicks on an element.
Int_t GetPickToSelect() const
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.
static TEveWindowSlot * CreateWindowMainFrame(TEveWindow *eve_parent=nullptr)
Create a new main-frame and populate it with a default window-slot.
static TEveWindowSlot * CreateWindowInTab(TGTab *tab, TEveWindow *eve_parent=nullptr)
Create a new tab in a given tab-widget and populate it with a default window-slot.
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition TGCanvas.h:192
virtual void SetContainer(TGFrame *f)
Definition TGCanvas.h:222
TGViewPort * GetViewPort() const
Definition TGCanvas.h:217
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition TGClient.cxx:234
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual TList * GetList() const
Definition TGFrame.h:310
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1164
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1257
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1072
void SetEditable(Bool_t on=kTRUE) override
Switch ON/OFF edit mode.
Definition TGFrame.cxx:948
void SetEditDisabled(UInt_t on=1) override
Set edit disable flag for this frame and subframes.
Definition TGFrame.cxx:1022
void ChangeOptions(UInt_t options) override
Change composite frame options. Options is an OR of the EFrameTypes.
Definition TGFrame.cxx:1043
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1190
virtual void Associate(const TGWindow *w)
Definition TGCanvas.h:89
System file browser, used as TRootBrowser plug-in.
void BrowseObj(TObject *obj) override
Browse object.
void SetNewBrowser(TRootBrowser *b)
void Show() override
TGLayoutHints * fLayout
Definition TGLayout.h:114
TGFrame * fFrame
Definition TGLayout.h:112
static Pixel_t GetDefaultSelectedBackground()
Get default selected frame background.
Definition TGFrame.cxx:696
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:605
void ReparentWindow(const TGWindow *p, Int_t x=0, Int_t y=0) override
Reparent window, make p the new parent and position the window at position (x,y) in new parent.
Definition TGFrame.h:202
void MapWindow() override
map window
Definition TGFrame.h:204
virtual UInt_t GetOptions() const
Definition TGFrame.h:197
void UnmapWindow() override
unmap window
Definition TGFrame.h:206
UInt_t GetHeight() const
Definition TGFrame.h:225
UInt_t GetWidth() const
Definition TGFrame.h:224
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
virtual void SetPadRight(Int_t v)
Definition TGLayout.h:92
virtual void SetPadLeft(Int_t v)
Definition TGLayout.h:91
virtual void SetPadTop(Int_t v)
Definition TGLayout.h:89
virtual void SetPadBottom(Int_t v)
Definition TGLayout.h:90
virtual void SetLayoutHints(ULong_t lh)
Definition TGLayout.h:88
TGListTreeItem * GetFirstChild() const
Definition TGListTree.h:59
TGListTreeItem * GetParent() const
Definition TGListTree.h:58
virtual void * GetUserData() const =0
A list tree is a widget that can contain a number of items arranged in a tree structure.
Definition TGListTree.h:195
void SetColorMode(EColorMarkupMode colorMode)
Definition TGListTree.h:434
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:352
void SetEventHandled(Bool_t eh=kTRUE)
Definition TGListTree.h:422
virtual void SetCanvas(TGCanvas *canvas)
Definition TGListTree.h:319
TGListTreeItem * GetCurrent() const
Definition TGListTree.h:383
void SetUserControl(Bool_t ctrl=kTRUE)
Definition TGListTree.h:420
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:397
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=nullptr)
Add popup menu to menu bar.
Definition TGMenu.cxx:418
TGHotString * GetLabel() const
Definition TGMenu.h:89
This class is the baseclass for all ROOT GUI widgets.
Definition TGObject.h:21
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t GetId() const
Definition TGObject.h:41
This class creates a popup menu object.
Definition TGMenu.h:110
virtual TGMenuEntry * GetEntry(Int_t id)
Find entry with specified id.
Definition TGMenu.cxx:1897
virtual Bool_t IsEntryChecked(Int_t id)
Return true if menu item is checked.
Definition TGMenu.cxx:1845
virtual void AddPopup(TGHotString *s, TGPopupMenu *popup, TGMenuEntry *before=nullptr, const TGPicture *p=nullptr)
Add a (cascading) popup menu to a popup menu.
Definition TGMenu.cxx:1152
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition TGMenu.cxx:1782
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition TGMenu.cxx:1807
virtual void AddSeparator(TGMenuEntry *before=nullptr)
Add a menu separator to the menu.
Definition TGMenu.cxx:1060
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:1860
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=nullptr, const TGPicture *p=nullptr, TGMenuEntry *before=nullptr)
Add a menu entry.
Definition TGMenu.cxx:990
virtual void SetFrame(TGFrame *frame, Bool_t prev)=0
virtual void SetString(const char *s)
Definition TGString.h:31
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition TGTab.cxx:709
TGCompositeFrame * GetTabContainer(Int_t tabIndex) const
Return container of tab with index tabIndex.
Definition TGTab.cxx:614
ROOT GUI Window base class.
Definition TGWindow.h:23
@ kEditEnable
allow edit of this window
Definition TGWindow.h:56
@ kEditDisable
disable edit of this window
Definition TGWindow.h:57
void SetGlobal(Bool_t global) override
Set editor global.
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition TGeoNode.h:41
static TClass * Class()
A doubly linked list.
Definition TList.h:38
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:659
Mother of all ROOT objects.
Definition TObject.h:41
virtual TClass * IsA() const
Definition TObject.h:245
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:869
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
This class creates a ROOT object browser, constituted by three main tabs.
void StartEmbedding(Int_t pos=kRight, Int_t subpos=-1) override
Start embedding external frame in the tab "pos" and tab element "subpos".
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]
Actual (active) tab elements (for each Tab)
TGHorizontalFrame * fH2
Horizontal frame.
Int_t fNbTab[3]
Number of tab elements (for each Tab)
TGHSplitter * fHSplitter
Horizontal splitter.
virtual void CloseTab(Int_t id)
Remove tab element id from right tab.
void StopEmbedding(const char *name=nullptr) override
TGHorizontalFrame * fPreMenuFrame
First (owned) menu frame.
TGTab * fTabRight
Right Tab.
TGPopupMenu * fMenuFile
"File" popup menu
TGTab * GetTabRight() const
TGHorizontalFrame * fTopMenuFrame
Top menu frame.
TGMenuBar * fMenuBar
Main (owned) menu bar.
void InitPlugins(Option_t *opt="")
Initialize default plugins.
TGVerticalFrame * fV2
Vertical frame.
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:380
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition TString.h:704
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2334
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:636
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
Definition TSystem.cxx:1858
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
TLine l
Definition textangle.C:4