Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveManager.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 "TEveManager.h"
13
14#include "TEveSelection.h"
15#include "TEveViewer.h"
16#include "TEveScene.h"
17#include "TEveEventManager.h"
18#include "TEveWindowManager.h"
19
20#include "TEveBrowser.h"
21#include "TEveGedEditor.h"
22
23#include "TGStatusBar.h"
24
25#include "TGLSAViewer.h"
26
27#include "TGeoManager.h"
28#include "TGeoMatrix.h"
29#include "TObjString.h"
30#include "TROOT.h"
31#include "TFile.h"
32#include "TMap.h"
33#include "TExMap.h"
34#include "TMacro.h"
35#include "TFolder.h"
36#include "TCanvas.h"
37#include "TSystem.h"
38#include "TApplication.h"
39#include "TColor.h"
40#include "TPluginManager.h"
41#include "TPRegexp.h"
42#include "TClass.h"
43
44#include <iostream>
45#include <fstream>
46
47TEveManager *gEve = nullptr;
48
49/** \class TEveManager
50\ingroup TEve
51Central application manager for Eve.
52Manages elements, GUI, GL scenes and GL viewers.
53*/
54
56
57////////////////////////////////////////////////////////////////////////////////
58
60 fExcHandler (nullptr),
61 fVizDB (nullptr), fVizDBReplace(kTRUE), fVizDBUpdate(kTRUE),
62 fGeometries (nullptr),
63 fGeometryAliases (nullptr),
64 fBrowser (nullptr),
65
66 fMacroFolder (nullptr),
67
68 fWindowManager (nullptr),
69 fViewers (nullptr),
70 fScenes (nullptr),
71 fGlobalScene (nullptr),
72 fEventScene (nullptr),
73 fCurrentEvent (nullptr),
74
75 fRedrawDisabled (0),
76 fResetCameras (kFALSE),
77 fDropLogicals (kFALSE),
78 fKeepEmptyCont (kFALSE),
79 fTimerActive (kFALSE),
80 fRedrawTimer (),
81
82 fStampedElements(nullptr),
83 fSelection (nullptr),
84 fHighlight (nullptr),
85
86 fOrphanage (nullptr),
87 fUseOrphanage (kFALSE)
88{
89 // Constructor.
90 // If map_window is true, the TEveBrowser window is mapped.
91 //
92 // Option string is first parsed for the following characters:
93 // V - spawn a default GL viewer.
94 //
95 // The consumed characters are removed from the options and they
96 // are passed to TEveBrowser for creation of additional plugins.
97 //
98 // Default options: "FIV" - file-browser, command-line, GL-viewer.
99
100
101 static const TEveException eh("TEveManager::TEveManager ");
102
103 if (gEve != nullptr)
104 throw(eh + "There can be only one!");
105
106 gEve = this;
107
109
113
115
116 fSelection = new TEveSelection("Global Selection");
118 fHighlight = new TEveSelection("Global Highlight");
121
122 fOrphanage = new TEveElementList("Global Orphanage");
124
125 fRedrawTimer.Connect("Timeout()", "TEveManager", this, "DoRedraw3D()");
126 fMacroFolder = new TFolder("EVE", "Visualization macros");
127 gROOT->GetListOfBrowsables()->Add(fMacroFolder);
128
129
130 fWindowManager = new TEveWindowManager("WindowManager", "Manager of EVE windows");
131
132 // Build GUI
133 fBrowser = new TEveBrowser(w, h);
134
135 // ListTreeEditor
138 fBrowser->StopEmbedding("Eve");
140
141 // See how many GL viewers are requested, remove from options.
142 TString str_opt(opt);
143 TPMERegexp viewer_re("V", "g");
144 Int_t viewer_count = viewer_re.Substitute(str_opt, "", kFALSE);
145
146 // Create the main window / browse.
147 fBrowser->InitPlugins(str_opt);
148 if (map_window)
150
151 // --------------------------------
152
155
156 fViewers = new TEveViewerList("Viewers");
159
160 fScenes = new TEveSceneList ("Scenes");
163
164 fGlobalScene = new TEveScene("Geometry scene");
167
168 fEventScene = new TEveScene("Event scene");
171
172 for (Int_t vc = 0; vc < viewer_count; ++vc)
173 {
174 TEveViewer* v = SpawnNewViewer(Form("Viewer %d", vc+1));
175 v->AddScene(fGlobalScene);
176 v->AddScene(fEventScene);
177 }
178
179 if (GetDefaultViewer())
180 {
182 }
183
185}
186
187////////////////////////////////////////////////////////////////////////////////
188/// Destructor.
189
191{
192 // Stop timer and deny further redraw requests.
195
196 delete fCurrentEvent;
197 fCurrentEvent = nullptr;
198
203 fScenes->Destroy();
204 fScenes = nullptr;
205
208 fViewers->Destroy();
209 fViewers = nullptr;
210
214 fWindowManager = nullptr;
215
219
220 gROOT->GetListOfBrowsables()->Remove(fMacroFolder);
221 delete fMacroFolder;
222
223 delete fGeometryAliases;
224 delete fGeometries;
225 delete fVizDB;
226 delete fExcHandler;
227 delete fStampedElements;
228
230
232 fBrowser->TRootBrowser::CloseWindow();
233}
234
235////////////////////////////////////////////////////////////////////////////////
236/// Clear the orphanage.
237
239{
240 Bool_t old_state = fUseOrphanage;
243 fUseOrphanage = old_state;
244}
245
246////////////////////////////////////////////////////////////////////////////////
247/// Get the main window, i.e. EVE-browser.
248
250{
251 return fBrowser;
252}
253
254////////////////////////////////////////////////////////////////////////////////
255/// Returns the default viewer - the first one in the fViewers list.
256
258{
259 return dynamic_cast<TEveViewer*>(fViewers->FirstChild());
260}
261
262////////////////////////////////////////////////////////////////////////////////
263/// Get TGLViewer of the default TEveViewer.
264
266{
268 return ev ? ev->GetGLViewer() : nullptr;
269}
270
271////////////////////////////////////////////////////////////////////////////////
272/// Returns main object editor.
273
275{
276 return fLTEFrame->GetEditor();
277}
278
279////////////////////////////////////////////////////////////////////////////////
280/// Returns main window status bar.
281
283{
284 return fBrowser->GetStatusBar();
285}
286
287////////////////////////////////////////////////////////////////////////////////
288/// Add a new canvas tab.
289
291{
292 fBrowser->StartEmbedding(1, -1);
293 TCanvas* c = new TCanvas;
295
296 return c;
297}
298
299////////////////////////////////////////////////////////////////////////////////
300/// Create a new GL viewer.
301
302TEveViewer* TEveManager::SpawnNewViewer(const char* name, const char* title,
303 Bool_t embed)
304{
305 TEveWindowSlot* slot = nullptr;
306 if (embed)
307 {
309 if (slot == nullptr)
310 {
311 // In principle should have some default/current container
312 // in TEveWindowManager.
313 // Also to store closed windows.
316 }
317 }
318 else
319 {
321 }
322
323 TEveViewer* v = new TEveViewer(name, title);
324 v->SpawnGLViewer(embed ? GetEditor() : nullptr);
325
326 slot->ReplaceWindow(v);
327
329
330 return v;
331}
332
333////////////////////////////////////////////////////////////////////////////////
334/// Create a new scene.
335
336TEveScene* TEveManager::SpawnNewScene(const char* name, const char* title)
337{
338 TEveScene* s = new TEveScene(name, title);
340 return s;
341}
342
343////////////////////////////////////////////////////////////////////////////////
344/// Find macro in fMacroFolder by name.
345
347{
348 return dynamic_cast<TMacro*>(fMacroFolder->FindObject(name));
349}
350
351////////////////////////////////////////////////////////////////////////////////
352/// Show element in default editor.
353
355{
356 static const TEveException eh("TEveManager::EditElement ");
357
358 GetEditor()->DisplayElement(element);
359}
360
361////////////////////////////////////////////////////////////////////////////////
362/// Register a request for 3D redraw.
363
365{
368}
369
370////////////////////////////////////////////////////////////////////////////////
371/// Perform 3D redraw of scenes and viewers whose contents has
372/// changed.
373
375{
376 static const TEveException eh("TEveManager::DoRedraw3D ");
377
378 // printf("TEveManager::DoRedraw3D redraw triggered\n");
379
380 // Process element visibility changes, mark relevant scenes as changed.
381 {
382 TEveElement::List_t scenes;
383 Long64_t key, value;
384 TExMapIter stamped_elements(fStampedElements);
385 while (stamped_elements.Next(key, value))
386 {
387 TEveElement *el = reinterpret_cast<TEveElement*>(key);
389 {
390 el->CollectSceneParents(scenes);
391 }
392 }
393 ScenesChanged(scenes);
394 }
395
396 // Process changes in scenes.
399
400 // Process changed elements again, update GUI (just editor so far,
401 // but more can come).
402 {
403 Long64_t key, value;
404 TExMapIter stamped_elements(fStampedElements);
405 while (stamped_elements.Next(key, value))
406 {
407 TEveElement *el = reinterpret_cast<TEveElement*>(key);
408 if (GetEditor()->GetModel() == el->GetEditorObject(eh))
409 EditElement(el);
411
412 el->ClearStamps();
413 }
414 }
416 GetListTree()->ClearViewPort(); // Fix this when several list-trees can be added.
417
420
422}
423
424////////////////////////////////////////////////////////////////////////////////
425/// Perform 3D redraw of all scenes and viewers.
426
427void TEveManager::FullRedraw3D(Bool_t resetCameras, Bool_t dropLogicals)
428{
429 fScenes ->RepaintAllScenes (dropLogicals);
430 fViewers->RepaintAllViewers(resetCameras, dropLogicals);
431}
432
433////////////////////////////////////////////////////////////////////////////////
434/// Element was changed, perform framework side action.
435/// Called from TEveElement::ElementChanged().
436
437void TEveManager::ElementChanged(TEveElement* element, Bool_t update_scenes, Bool_t redraw)
438{
439 static const TEveException eh("TEveElement::ElementChanged ");
440
441 if (GetEditor()->GetModel() == element->GetEditorObject(eh))
442 EditElement(element);
444
445 if (update_scenes) {
446 TEveElement::List_t scenes;
447 element->CollectSceneParents(scenes);
448 ScenesChanged(scenes);
449 }
450
451 if (redraw)
452 Redraw3D();
453}
454
455////////////////////////////////////////////////////////////////////////////////
456/// Mark all scenes from the given list as changed.
457
459{
460 for (TEveElement::List_i s=scenes.begin(); s!=scenes.end(); ++s)
461 ((TEveScene*)*s)->Changed();
462}
463
464////////////////////////////////////////////////////////////////////////////////
465/// Mark element as changed -- it will be processed on next redraw.
466
468{
469 UInt_t slot;
470 if (fStampedElements->GetValue((ULong64_t) element, (Long64_t) element, slot) == 0)
471 {
472 fStampedElements->AddAt(slot, (ULong64_t) element, (Long64_t) element, 1);
473 }
474}
475
476////////////////////////////////////////////////////////////////////////////////
477/// Get default list-tree widget.
478
480{
481 return fLTEFrame->fListTree;
482}
483
486{
487 // Add element as a top-level to a list-tree.
488 // Only add a single copy of a render-element as a top level.
489
490 if (lt == nullptr) lt = GetListTree();
491 TGListTreeItem* lti = re->AddIntoListTree(lt, (TGListTreeItem*)nullptr);
492 if (open) lt->OpenItem(lti);
493 return lti;
494}
495
496////////////////////////////////////////////////////////////////////////////////
497/// Remove top-level element from list-tree with specified tree-item.
498
500 TGListTree* lt, TGListTreeItem* lti)
501{
502 static const TEveException eh("TEveManager::RemoveFromListTree ");
503
504 if (lti->GetParent())
505 throw(eh + "not a top-level item.");
506
507 element->RemoveFromListTree(lt, nullptr);
508}
509
510////////////////////////////////////////////////////////////////////////////////
511/// Add a new event and make it the current event.
512/// It is added into the event-scene and as a top-level list-tree
513/// item.
514
516{
517 fCurrentEvent = event;
520 return AddToListTree(event, kTRUE);
521}
522
523////////////////////////////////////////////////////////////////////////////////
524/// Add an element. If parent is not specified it is added into
525/// current event (which is created if does not exist).
526
528{
529 if (parent == nullptr) {
530 if (fCurrentEvent == nullptr)
531 AddEvent(new TEveEventManager("Event", "Auto-created event directory"));
532 parent = fCurrentEvent;
533 }
534
535 parent->AddElement(element);
536}
537
538////////////////////////////////////////////////////////////////////////////////
539/// Add a global element, i.e. one that does not change on each
540/// event, like geometry or projection manager.
541/// If parent is not specified it is added to a global scene.
542
544{
545 if (parent == nullptr)
546 parent = fGlobalScene;
547
548 parent->AddElement(element);
549}
550
551////////////////////////////////////////////////////////////////////////////////
552/// Remove element from parent.
553
555 TEveElement* parent)
556{
557 parent->RemoveElement(element);
558}
559
560////////////////////////////////////////////////////////////////////////////////
561/// Called from TEveElement prior to its destruction so the
562/// framework components (like object editor) can unreference it.
563
565{
566 if (GetEditor()->GetEveElement() == element)
567 EditElement(nullptr);
569
570 if (fScenes)
572
573 if (fStampedElements->GetValue((ULong64_t) element, (Long64_t) element) != 0)
574 fStampedElements->Remove((ULong64_t) element, (Long64_t) element);
575
576 if (element->fImpliedSelected > 0)
578 if (element->fImpliedHighlighted > 0)
580}
581
582////////////////////////////////////////////////////////////////////////////////
583/// Select an element.
584/// Now it only calls EditElement() - should also update selection state.
585
587{
588 if (element != nullptr)
589 EditElement(element);
590}
591
592////////////////////////////////////////////////////////////////////////////////
593/// Paste has been called.
594
596{
597 // The object to paste is taken from the editor (this is not
598 // exactly right) and handed to 'element' for pasting.
599
601 if (src)
602 return element->HandleElementPaste(src);
603 return kFALSE;
604}
605
606////////////////////////////////////////////////////////////////////////////////
607/// Insert a new visualization-parameter database entry. Returns
608/// true if the element is inserted successfully.
609/// If entry with the same key already exists the behaviour depends on the
610/// 'replace' flag:
611/// - true - The old model is deleted and new one is inserted (default).
612/// Clients of the old model are transferred to the new one and
613/// if 'update' flag is true (default), the new model's parameters
614/// are assigned to all clients.
615/// - false - The old model is kept, false is returned.
616///
617/// If insert is successful, the ownership of the model-element is
618/// transferred to the manager.
619
621 Bool_t replace, Bool_t update)
622{
623 TPair* pair = (TPair*) fVizDB->FindObject(tag);
624 if (pair)
625 {
626 if (replace)
627 {
628 model->IncDenyDestroy();
629 model->SetRnrChildren(kFALSE);
630
631 TEveElement* old_model = dynamic_cast<TEveElement*>(pair->Value());
632 if (old_model)
633 {
634 while (old_model->HasChildren())
635 {
636 TEveElement *el = old_model->FirstChild();
637 el->SetVizModel(model);
638 if (update)
639 {
640 el->CopyVizParams(model);
642 }
643 }
644 old_model->DecDenyDestroy();
645 }
646 pair->SetValue(dynamic_cast<TObject*>(model));
647 return kTRUE;
648 }
649 else
650 {
651 return kFALSE;
652 }
653 }
654 else
655 {
656 model->IncDenyDestroy();
657 model->SetRnrChildren(kFALSE);
658 fVizDB->Add(new TObjString(tag), dynamic_cast<TObject*>(model));
659 return kTRUE;
660 }
661}
662
663////////////////////////////////////////////////////////////////////////////////
664/// Insert a new visualization-parameter database entry with the default
665/// parameters for replace and update, as specified by members
666/// fVizDBReplace(default=kTRUE) and fVizDBUpdate(default=kTRUE).
667/// See docs of the above function.
668
670{
671 return InsertVizDBEntry(tag, model, fVizDBReplace, fVizDBUpdate);
672}
673
674////////////////////////////////////////////////////////////////////////////////
675/// Find a visualization-parameter database entry corresponding to tag.
676/// If the entry is not found 0 is returned.
677
679{
680 return dynamic_cast<TEveElement*>(fVizDB->GetValue(tag));
681}
682
683////////////////////////////////////////////////////////////////////////////////
684/// Load visualization-parameter database from file filename. The
685/// replace, update arguments replace the values of fVizDBReplace
686/// and fVizDBUpdate members for the duration of the macro
687/// execution.
688
690{
691 Bool_t ex_replace = fVizDBReplace;
692 Bool_t ex_update = fVizDBUpdate;
693 fVizDBReplace = replace;
695
697
698 fVizDBReplace = ex_replace;
699 fVizDBUpdate = ex_update;
700}
701
702////////////////////////////////////////////////////////////////////////////////
703/// Load visualization-parameter database from file filename.
704/// State of data-members fVizDBReplace and fVizDBUpdate determine
705/// how the registered entries are handled.
706
708{
710 Redraw3D();
711}
712
713////////////////////////////////////////////////////////////////////////////////
714/// Save visualization-parameter database to file filename.
715
717{
718 TPMERegexp re("(.+)\\.\\w+");
719 if (re.Match(filename) != 2) {
720 Error("SaveVizDB", "filename does not match required format '(.+)\\.\\w+'.");
721 return;
722 }
723
724 TString exp_filename(filename);
725 gSystem->ExpandPathName(exp_filename);
726
727 std::ofstream out(exp_filename, std::ios::out | std::ios::trunc);
728 out << "void " << re[1] << "()\n";
729 out << "{\n";
730 out << " TEveManager::Create();\n";
731
733
734 Int_t var_id = 0;
735 TString var_name;
736 TIter next(fVizDB);
737 TObjString *key;
738 while ((key = (TObjString*)next()))
739 {
740 TEveElement* mdl = dynamic_cast<TEveElement*>(fVizDB->GetValue(key));
741 if (mdl)
742 {
743 var_name.Form("x%03d", var_id++);
744 mdl->SaveVizParams(out, key->String(), var_name);
745 }
746 else
747 {
748 Warning("SaveVizDB", "Saving failed for key '%s'.", key->String().Data());
749 }
750 }
751
752 out << "}\n";
753 out.close();
754}
755
756////////////////////////////////////////////////////////////////////////////////
757/// Get geometry with given filename.
758/// This is cached internally so the second time this function is
759/// called with the same argument the same geo-manager is returned.
760/// gGeoManager is set to the return value.
761
763{
764 static const TEveException eh("TEveManager::GetGeometry ");
765
766 TString exp_filename = filename;
767 gSystem->ExpandPathName(exp_filename);
768 printf("%s loading: '%s' -> '%s'.\n", eh.Data(),
769 filename.Data(), exp_filename.Data());
770
772 if (gGeoManager)
773 {
775 }
776 else
777 {
778 Bool_t locked = TGeoManager::IsLocked();
779 if (locked) {
780 Warning(eh, "TGeoManager is locked ... unlocking it.");
782 }
783 if (TGeoManager::Import(filename) == nullptr) {
784 throw(eh + "TGeoManager::Import() failed for '" + exp_filename + "'.");
785 }
786 if (locked) {
788 }
789
791
792 // Import colors exported by Gled, if they exist.
793 {
794 TFile f(exp_filename, "READ");
795 TObjArray* collist = (TObjArray*) f.Get("ColorList");
796 f.Close();
797 if (collist != nullptr) {
799 TGeoVolume* vol;
800 while ((vol = (TGeoVolume*) next()) != nullptr)
801 {
802 Int_t oldID = vol->GetLineColor();
803 TColor* col = (TColor*)collist->At(oldID);
804 Float_t r, g, b;
805 col->GetRGB(r, g, b);
806 Int_t newID = TColor::GetColor(r,g,b);
807 vol->SetLineColor(newID);
808 }
809 }
810 }
811
813 }
814 return gGeoManager;
815}
816
817////////////////////////////////////////////////////////////////////////////////
818/// Get geometry with given alias.
819/// The alias must be registered via RegisterGeometryAlias().
820
822{
823 static const TEveException eh("TEveManager::GetGeometry ");
824
825 TObjString* full_name = (TObjString*) fGeometryAliases->GetValue(alias);
826 if (!full_name)
827 throw(eh + "geometry alias '" + alias + "' not registered.");
828 return GetGeometry(full_name->String());
829}
830
831////////////////////////////////////////////////////////////////////////////////
832/// Get the default geometry.
833/// It should be registered via RegisterGeometryName("Default", `<URL>`).
834
836{
837 return GetGeometryByAlias("Default");
838}
839
840////////////////////////////////////////////////////////////////////////////////
841/// Register 'name' as an alias for geometry file 'filename'.
842/// The old aliases are silently overwritten.
843/// After that the geometry can be retrieved also by calling:
844/// gEve->GetGeometryByName(name);
845
847{
849}
850
851////////////////////////////////////////////////////////////////////////////////
852/// Set the text in the right side of browser's status bar.
853
855{
857}
858
859////////////////////////////////////////////////////////////////////////////////
860/// Work-around uber ugly hack used in SavePrimitive and co.
861
863{
864 gROOT->ResetClassSaved();
865}
866
867////////////////////////////////////////////////////////////////////////////////
868/// Close button has been clicked on EVE main window (browser).
869/// Cleanup and terminate application.
870
872{
874 TEveBrowser *eb = dynamic_cast<TEveBrowser*>(mf);
875 if (eb == fBrowser)
876 {
877 mf->DontCallClose();
878 Terminate();
880 }
881}
882
883////////////////////////////////////////////////////////////////////////////////
884/// If global TEveManager* gEve is not set initialize it.
885/// Returns gEve.
886
888{
889 static const TEveException eh("TEveManager::Create ");
890
891 if (gEve == nullptr)
892 {
893 // Make sure that the GUI system is initialized.
894 if (gROOT->IsBatch())
895 {
896 throw eh + "ROOT is running in batch mode.";
897 }
900 if (gROOT->IsBatch() || gClient == nullptr || gClient->IsZombie())
901 {
902 throw eh + "window system not initialized.";
903 }
904
905 Int_t w = 1024;
906 Int_t h = 768;
907
910 gEve = new TEveManager(w, h, map_window, opt);
911 }
912 return gEve;
913}
914
915////////////////////////////////////////////////////////////////////////////////
916/// Properly terminate global TEveManager.
917
919{
920 if (!gEve) return;
921
923
924 delete gEve;
925 gEve = nullptr;
926}
927
928/** \class TEveManager::TExceptionHandler
929\ingroup TEve
930Exception handler for Eve exceptions.
931*/
932
934
935////////////////////////////////////////////////////////////////////////////////
936/// Handle exceptions deriving from TEveException.
937
940{
941 TEveException* ex = dynamic_cast<TEveException*>(&exc);
942 if (ex) {
943 Info("Handle", "%s", ex->Data());
944 gEve->SetStatusLine(ex->Data());
945 gSystem->Beep();
946 return kSEHandled;
947 } else {
948 return kSEProceed;
949 }
950}
#define b(i)
Definition RSha256.hxx:100
#define f(i)
Definition RSha256.hxx:104
#define c(i)
Definition RSha256.hxx:101
#define g(i)
Definition RSha256.hxx:105
#define h(i)
Definition RSha256.hxx:106
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
long long Long64_t
Definition RtypesCore.h:80
unsigned long long ULong64_t
Definition RtypesCore.h:81
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
R__EXTERN TApplication * gApplication
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:185
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition TError.cxx:229
TEveManager * gEve
R__EXTERN TEveManager * gEve
#define gClient
Definition TGClient.h:156
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 TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
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 r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char text
char name[80]
Definition TGX11.cxx:110
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TGeoIdentity * gGeoIdentity
Definition TGeoMatrix.h:537
R__EXTERN void * gTQSender
Definition TQObject.h:46
#define gROOT
Definition TROOT.h:406
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2489
R__EXTERN TSystem * gSystem
Definition TSystem.h:555
void InitializeGraphics(Bool_t only_web=kFALSE)
Initialize the graphics environment.
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
static void NeedGraphicsLibs()
Static method.
virtual Color_t GetLineColor() const
Return the line color.
Definition TAttLine.h:33
The Canvas class.
Definition TCanvas.h:23
The color creation and management class.
Definition TColor.h:21
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
Definition TColor.h:54
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition TColor.cxx:1839
Specialization of TRootBrowser for Eve.
void SanitizeTabCounts()
TRootBrowser keeps (somewhat unnecessarily) counters for number ob tabs on each position.
void InitPlugins(Option_t *opt="FI")
Initialize standard plugins.
A list of TEveElements.
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
void SaveVizParams(std::ostream &out, const TString &tag, const TString &var)
Save visualization parameters for this element with given tag.
virtual void AddElement(TEveElement *el)
Add el to the list of children.
virtual TObject * GetEditorObject(const TEveException &eh) const
TEveElement * FirstChild() const
Returns the first child element or 0 if the list is empty.
void DecDenyDestroy()
Decreases the deny-destroy count of the element.
Bool_t HasChildren() const
Short_t fImpliedHighlighted
virtual void PropagateVizParamsToProjecteds()
Propagate visualization parameters to dependent elements.
virtual void CollectSceneParents(List_t &scenes)
Collect all parents of class TEveScene.
std::list< TEveElement * > List_t
Definition TEveElement.h:71
void IncDenyDestroy()
Increases the deny-destroy count of the element.
virtual Bool_t SetRnrChildren(Bool_t rnr)
Set render state of this element's children, i.e.
Short_t fImpliedSelected
virtual void Destroy()
Destroy this element.
virtual void DestroyElements()
Destroy all children of this element.
virtual TGListTreeItem * AddIntoListTree(TGListTree *ltree, TGListTreeItem *parent_lti)
Add this element into ltree to an already existing item parent_lti.
void SetVizModel(TEveElement *model)
Set visualization-parameter model element.
virtual void RemoveElement(TEveElement *el)
Remove el from the list of children.
virtual Bool_t HandleElementPaste(TEveElement *el)
React to element being pasted or dnd-ed.
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
virtual void ClearStamps()
List_t::iterator List_i
Definition TEveElement.h:72
virtual Bool_t RemoveFromListTree(TGListTree *ltree, TGListTreeItem *parent_lti)
Remove element from list-tree 'ltree' where its parent item is 'parent_lti'.
UChar_t GetChangeBits() const
Base class for event management and navigation.
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
void ConnectSignals()
Connect list-tree signals.
TEveGedEditor * GetEditor() const
Specialization of TGedEditor for proper update propagation to TEveManager.
TEveElement * GetEveElement() const
Return eve-element if it is the model object.
static void ElementDeleted(TEveElement *el)
Element is being deleted. Close editors showing it.
void DisplayElement(TEveElement *re)
Show a TEveElement in editor.
static void DestroyEditors()
Destroys all editors. Called from EVE termination.
static void ElementChanged(TEveElement *el)
Element was changed. Update editors showing it.
Exception handler for Eve exceptions.
Definition TEveManager.h:72
EStatus Handle(std::exception &exc) override
Handle exceptions deriving from TEveException.
Central application manager for Eve.
Definition TEveManager.h:50
TMap * fVizDB
Definition TEveManager.h:85
void AddElement(TEveElement *element, TEveElement *parent=nullptr)
Add an element.
TEveWindowManager * fWindowManager
Definition TEveManager.h:97
void AddGlobalElement(TEveElement *element, TEveElement *parent=nullptr)
Add a global element, i.e.
void DoRedraw3D()
Perform 3D redraw of scenes and viewers whose contents has changed.
void ClearOrphanage()
Clear the orphanage.
void SetStatusLine(const char *text)
Set the text in the right side of browser's status bar.
TGStatusBar * GetStatusBar() const
Returns main window status bar.
TEveViewerList * fViewers
Definition TEveManager.h:98
TGListTree * GetListTree() const
Get default list-tree widget.
TEveElementList * fOrphanage
TGeoManager * GetDefaultGeometry()
Get the default geometry.
TTimer fRedrawTimer
void RegisterRedraw3D()
Register a request for 3D redraw.
TEveSelection * fSelection
Bool_t fDropLogicals
Bool_t fTimerActive
static void Terminate()
Properly terminate global TEveManager.
void CloseEveWindow()
Close button has been clicked on EVE main window (browser).
void ClearROOTClassSaved()
Work-around uber ugly hack used in SavePrimitive and co.
void PreDeleteElement(TEveElement *element)
Called from TEveElement prior to its destruction so the framework components (like object editor) can...
TEveGListTreeEditorFrame * fLTEFrame
Definition TEveManager.h:93
Bool_t fVizDBUpdate
Definition TEveManager.h:87
TGeoManager * GetGeometryByAlias(const TString &alias)
Get geometry with given alias.
void ScenesChanged(TEveElement::List_t &scenes)
Mark all scenes from the given list as changed.
TGLViewer * GetDefaultGLViewer() const
Get TGLViewer of the default TEveViewer.
TEveViewer * GetDefaultViewer() const
Returns the default viewer - the first one in the fViewers list.
TCanvas * AddCanvasTab(const char *name)
Add a new canvas tab.
TExceptionHandler * fExcHandler
Definition TEveManager.h:83
TEveScene * fGlobalScene
Bool_t ElementPaste(TEveElement *element)
Paste has been called.
void ElementChanged(TEveElement *element, Bool_t update_scenes=kTRUE, Bool_t redraw=kFALSE)
Element was changed, perform framework side action.
void ElementSelect(TEveElement *element)
Select an element.
virtual ~TEveManager()
Destructor.
void EditElement(TEveElement *element)
Show element in default editor.
TEveBrowser * fBrowser
Definition TEveManager.h:92
Bool_t InsertVizDBEntry(const TString &tag, TEveElement *model, Bool_t replace, Bool_t update)
Insert a new visualization-parameter database entry.
void RemoveElement(TEveElement *element, TEveElement *parent)
Remove element from parent.
TEveManager(const TEveManager &)
void RegisterGeometryAlias(const TString &alias, const TString &filename)
Register 'name' as an alias for geometry file 'filename'.
TEveSelection * fHighlight
TEveGedEditor * GetEditor() const
Returns main object editor.
TEveScene * fEventScene
void SaveVizDB(const TString &filename)
Save visualization-parameter database to file filename.
TEveViewer * SpawnNewViewer(const char *name, const char *title="", Bool_t embed=kTRUE)
Create a new GL viewer.
TEveElement * FindVizDBEntry(const TString &tag)
Find a visualization-parameter database entry corresponding to tag.
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
TGListTreeItem * AddToListTree(TEveElement *re, Bool_t open, TGListTree *lt=nullptr)
TMacro * GetMacro(const char *name) const
Find macro in fMacroFolder by name.
void FullRedraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
Perform 3D redraw of all scenes and viewers.
TGListTreeItem * AddEvent(TEveEventManager *event)
Add a new event and make it the current event.
void Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
Bool_t fVizDBReplace
Definition TEveManager.h:86
TFolder * fMacroFolder
Definition TEveManager.h:95
TEveSceneList * fScenes
Definition TEveManager.h:99
TExMap * fStampedElements
Bool_t fResetCameras
void RemoveFromListTree(TEveElement *element, TGListTree *lt, TGListTreeItem *lti)
Remove top-level element from list-tree with specified tree-item.
TGWindow * GetMainWindow() const
Get the main window, i.e. EVE-browser.
void LoadVizDB(const TString &filename, Bool_t replace, Bool_t update)
Load visualization-parameter database from file filename.
TMap * fGeometryAliases
Definition TEveManager.h:90
TGeoManager * GetGeometry(const TString &filename)
Get geometry with given filename.
TEveScene * SpawnNewScene(const char *name, const char *title="")
Create a new scene.
TMap * fGeometries
Definition TEveManager.h:89
Bool_t fUseOrphanage
void ElementStamped(TEveElement *element)
Mark element as changed – it will be processed on next redraw.
TEveEventManager * fCurrentEvent
List of Scenes providing common operations on TEveScene collections.
Definition TEveScene.h:80
void DestroyScenes()
Destroy all scenes and their contents.
void DestroyElementRenderers(TEveElement *element)
Loop over all scenes and remove all instances of element from them.
void RepaintAllScenes(Bool_t dropLogicals)
Repaint all scenes.
void ProcessSceneChanges(Bool_t dropLogicals, TExMap *stampMap)
Loop over all scenes and update them accordingly:
Eve representation of TGLScene.
Definition TEveScene.h:27
Make sure there is a SINGLE running TEveSelection for each selection type (select/highlight).
virtual void RemoveImpliedSelected(TEveElement *el)
Remove element from all implied-selected sets.
void SetHighlightMode()
Set to 'highlight' mode.
static void Macro(const char *mac)
Execute macro 'mac'. Do not reload the macro.
Definition TEveUtil.cxx:164
static void SetupGUI()
Setup icon pictures and mime-types.
Definition TEveUtil.cxx:93
static void SetupEnvironment()
Setup Include and Macro paths.
Definition TEveUtil.cxx:50
List of Viewers providing common operations on TEveViewer collections.
Definition TEveViewer.h:80
void RepaintChangedViewers(Bool_t resetCameras, Bool_t dropLogicals)
Repaint viewers that are tagged as changed.
void AddElement(TEveElement *el) override
Call base-class implementation.
void RepaintAllViewers(Bool_t resetCameras, Bool_t dropLogicals)
Repaint all viewers.
Eve representation of TGLViewer.
Definition TEveViewer.h:31
TGLViewer * GetGLViewer() const
Definition TEveViewer.h:51
Manager for EVE windows.
TEveWindowSlot * GetCurrentWindowAsSlot() const
Return current window dynamic-casted to TEveWindowSlot.
void DestroyWindows()
Wait for all windows to shut-down.
Description of TEveWindowSlot.
Definition TEveWindow.h:302
static TEveWindowSlot * CreateWindowMainFrame(TEveWindow *eve_parent=nullptr)
Create a new main-frame and populate it with a default window-slot.
void ReplaceWindow(TEveWindow *w)
Replace this window with the passed one.
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.
Bool_t Next(ULong64_t &hash, Long64_t &key, Long64_t &value)
Get next entry from TExMap. Returns kFALSE at end of map.
Definition TExMap.cxx:412
This class stores a (key,value) pair using an external hash.
Definition TExMap.h:33
void Remove(ULong64_t hash, Long64_t key)
Remove entry with specified key from the TExMap.
Definition TExMap.cxx:217
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
Definition TExMap.cxx:174
void AddAt(UInt_t slot, ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table.
Definition TExMap.cxx:117
void Delete(Option_t *opt="") override
Delete all entries stored in the TExMap.
Definition TExMap.cxx:164
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:53
<div class="legacybox"><h2>Legacy Code</h2> TFolder is a legacy interface: there will be no bug fixes...
Definition TFolder.h:30
TObject * FindObject(const char *name) const override
Search object identified by name in the tree of folders inside this folder.
Definition TFolder.cxx:306
virtual void ClearViewPort()
Clear view port and redraw full content.
Definition TGCanvas.cxx:891
void MapWindow() override
map window
Definition TGFrame.h:204
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:276
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition TGLViewer.h:55
TGListTreeItem * GetParent() const
Definition TGListTree.h:58
A list tree is a widget that can contain a number of items arranged in a tree structure.
Definition TGListTree.h:195
void OpenItem(TGListTreeItem *item)
Open item in list tree (i.e. show child items).
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:397
void DontCallClose()
Typically call this method in the slot connected to the CloseWindow() signal to prevent the calling o...
Definition TGFrame.cxx:1780
Provides a StatusBar widget.
Definition TGStatusBar.h:21
ROOT GUI Window base class.
Definition TGWindow.h:23
virtual TObject * GetModel() const
Definition TGedEditor.h:79
An identity transformation.
Definition TGeoMatrix.h:406
The manager class for any TGeo geometry.
Definition TGeoManager.h:44
static void UnlockGeometry()
Unlock current geometry.
TObjArray * GetListOfVolumes() const
TObjArray * GetListOfMatrices() const
static Bool_t IsLocked()
Check lock state.
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
static function Import a geometry from a gdml or ROOT file
static void LockGeometry()
Lock current geometry so that no other geometry can be imported.
TGeoVolume * GetTopVolume() const
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
void VisibleDaughters(Bool_t vis=kTRUE)
set visibility for daughters
void SetLineColor(Color_t lcolor) override
Set the line color.
Class supporting a collection of lines with C++ code.
Definition TMacro.h:31
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition TMap.h:40
void Add(TObject *obj) override
This function may not be used (but we need to provide it since it is a pure virtual in TCollection).
Definition TMap.cxx:54
virtual void SetOwnerKeyValue(Bool_t ownkeys=kTRUE, Bool_t ownvals=kTRUE)
Set ownership for keys and values.
Definition TMap.cxx:352
TObject * FindObject(const char *keyname) const override
Check if a (key,value) pair exists with keyname as name of the key.
Definition TMap.cxx:215
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Definition TMap.cxx:236
An array of TObjects.
Definition TObjArray.h:31
TObject * At(Int_t idx) const override
Definition TObjArray.h:164
Collectable string class.
Definition TObjString.h:28
TString & String()
Definition TObjString.h:48
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition TObject.cxx:961
Wrapper for PCRE library (Perl Compatible Regular Expressions).
Definition TPRegexp.h:97
Int_t Substitute(TString &s, const TString &r, Bool_t doDollarSubst=kTRUE)
Substitute matching part of s with r, dollar back-ref substitution is performed if doDollarSubst is t...
Definition TPRegexp.cxx:963
Int_t Match(const TString &s, UInt_t start=0)
Runs a match on s against the regex 'this' was created with.
Definition TPRegexp.cxx:797
Class used by TMap to store (key,value) pairs.
Definition TMap.h:102
void SetValue(TObject *val)
Definition TMap.h:122
TObject * Value() const
Definition TMap.h:121
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
void StartEmbedding(Int_t pos=kRight, Int_t subpos=-1) override
Start embedding external frame in the tab "pos" and tab element "subpos".
void StopEmbedding(const char *name=nullptr) override
void SetStatusText(const char *txt, Int_t col) override
Set text in column col in status bar.
TGStatusBar * GetStatusBar() const
TGTab * GetTabRight() const
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:376
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2356
void Beep(Int_t freq=-1, Int_t duration=-1, Bool_t setDefault=kFALSE)
Beep for duration milliseconds with a tone of frequency freq.
Definition TSystem.cxx:324
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Definition TSystem.cxx:1274
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition TSystem.cxx:416
virtual void Start(Long_t milliSec=-1, Bool_t singleShot=kFALSE)
Starts the timer with a milliSec timeout.
Definition TTimer.cxx:213
virtual void Stop()
Definition TTimer.h:94
Double_t ex[n]
Definition legend1.C:17