Logo ROOT  
Reference Guide
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 "TBrowser.h"
37#include "TCanvas.h"
38#include "TSystem.h"
39#include "TRint.h"
40#include "TVirtualX.h"
41#include "TColor.h"
42#include "TPluginManager.h"
43#include "TPRegexp.h"
44#include "TClass.h"
45
46#include "Riostream.h"
47
49
50/** \class TEveManager
51\ingroup TEve
52Central application manager for Eve.
53Manages elements, GUI, GL scenes and GL viewers.
54*/
55
57
58////////////////////////////////////////////////////////////////////////////////
59
61 fExcHandler (0),
62 fVizDB (0), fVizDBReplace(kTRUE), fVizDBUpdate(kTRUE),
63 fGeometries (0),
64 fGeometryAliases (0),
65 fBrowser (0),
66
67 fMacroFolder (0),
68
69 fWindowManager (0),
70 fViewers (0),
71 fScenes (0),
72 fGlobalScene (0),
73 fEventScene (0),
74 fCurrentEvent (0),
75
76 fRedrawDisabled (0),
77 fResetCameras (kFALSE),
78 fDropLogicals (kFALSE),
79 fKeepEmptyCont (kFALSE),
80 fTimerActive (kFALSE),
81 fRedrawTimer (),
82
83 fStampedElements(0),
84 fSelection (0),
85 fHighlight (0),
86
87 fOrphanage (0),
88 fUseOrphanage (kFALSE)
89{
90 // Constructor.
91 // If map_window is true, the TEveBrowser window is mapped.
92 //
93 // Option string is first parsed for the following characters:
94 // V - spawn a default GL viewer.
95 //
96 // The consumed characters are removed from the options and they
97 // are passed to TEveBrowser for creation of additional plugins.
98 //
99 // Default options: "FIV" - file-browser, command-line, GL-viewer.
100
101
102 static const TEveException eh("TEveManager::TEveManager ");
103
104 if (gEve != 0)
105 throw(eh + "There can be only one!");
106
107 gEve = this;
108
110
114
116
117 fSelection = new TEveSelection("Global Selection");
119 fHighlight = new TEveSelection("Global Highlight");
122
123 fOrphanage = new TEveElementList("Global Orphanage");
125
126 fRedrawTimer.Connect("Timeout()", "TEveManager", this, "DoRedraw3D()");
127 fMacroFolder = new TFolder("EVE", "Visualization macros");
128 gROOT->GetListOfBrowsables()->Add(fMacroFolder);
129
130
131 fWindowManager = new TEveWindowManager("WindowManager", "Manager of EVE windows");
132
133 // Build GUI
134 fBrowser = new TEveBrowser(w, h);
135
136 // ListTreeEditor
139 fBrowser->StopEmbedding("Eve");
141
142 // See how many GL viewers are requested, remove from options.
143 TString str_opt(opt);
144 TPMERegexp viewer_re("V", "g");
145 Int_t viewer_count = viewer_re.Substitute(str_opt, "", kFALSE);
146
147 // Create the main window / browse.
148 fBrowser->InitPlugins(str_opt);
149 if (map_window)
151
152 // --------------------------------
153
156
157 fViewers = new TEveViewerList("Viewers");
160
161 fScenes = new TEveSceneList ("Scenes");
164
165 fGlobalScene = new TEveScene("Geometry scene");
168
169 fEventScene = new TEveScene("Event scene");
172
173 for (Int_t vc = 0; vc < viewer_count; ++vc)
174 {
175 TEveViewer* v = SpawnNewViewer(Form("Viewer %d", vc+1));
176 v->AddScene(fGlobalScene);
177 v->AddScene(fEventScene);
178 }
179
180 if (GetDefaultViewer())
181 {
183 }
184
186}
187
188////////////////////////////////////////////////////////////////////////////////
189/// Destructor.
190
192{
193 // Stop timer and deny further redraw requests.
196
197 delete fCurrentEvent;
198 fCurrentEvent = 0;
199
204 fScenes->Destroy();
205 fScenes = 0;
206
209 fViewers->Destroy();
210 fViewers = 0;
211
215 fWindowManager = 0;
216
220
221 gROOT->GetListOfBrowsables()->Remove(fMacroFolder);
222 delete fMacroFolder;
223
224 delete fGeometryAliases;
225 delete fGeometries;
226 delete fVizDB;
227 delete fExcHandler;
228 delete fStampedElements;
229
231
233 fBrowser->TRootBrowser::CloseWindow();
234}
235
236////////////////////////////////////////////////////////////////////////////////
237/// Clear the orphanage.
238
240{
241 Bool_t old_state = fUseOrphanage;
244 fUseOrphanage = old_state;
245}
246
247////////////////////////////////////////////////////////////////////////////////
248/// Get the main window, i.e. EVE-browser.
249
251{
252 return fBrowser;
253}
254
255////////////////////////////////////////////////////////////////////////////////
256/// Returns the default viewer - the first one in the fViewers list.
257
259{
260 return dynamic_cast<TEveViewer*>(fViewers->FirstChild());
261}
262
263////////////////////////////////////////////////////////////////////////////////
264/// Get TGLViewer of the default TEveViewer.
265
267{
269 return ev ? ev->GetGLViewer() : 0;
270}
271
272////////////////////////////////////////////////////////////////////////////////
273/// Returns main object editor.
274
276{
277 return fLTEFrame->GetEditor();
278}
279
280////////////////////////////////////////////////////////////////////////////////
281/// Returns main window status bar.
282
284{
285 return fBrowser->GetStatusBar();
286}
287
288////////////////////////////////////////////////////////////////////////////////
289/// Add a new canvas tab.
290
292{
293 fBrowser->StartEmbedding(1, -1);
294 TCanvas* c = new TCanvas;
296
297 return c;
298}
299
300////////////////////////////////////////////////////////////////////////////////
301/// Create a new GL viewer.
302
303TEveViewer* TEveManager::SpawnNewViewer(const char* name, const char* title,
304 Bool_t embed)
305{
306 TEveWindowSlot* slot = 0;
307 if (embed)
308 {
310 if (slot == 0)
311 {
312 // In principle should have some default/current container
313 // in TEveWindowManager.
314 // Also to store closed windows.
317 }
318 }
319 else
320 {
322 }
323
324 TEveViewer* v = new TEveViewer(name, title);
325 v->SpawnGLViewer(embed ? GetEditor() : 0);
326
327 slot->ReplaceWindow(v);
328
330
331 return v;
332}
333
334////////////////////////////////////////////////////////////////////////////////
335/// Create a new scene.
336
337TEveScene* TEveManager::SpawnNewScene(const char* name, const char* title)
338{
339 TEveScene* s = new TEveScene(name, title);
341 return s;
342}
343
344////////////////////////////////////////////////////////////////////////////////
345/// Find macro in fMacroFolder by name.
346
348{
349 return dynamic_cast<TMacro*>(fMacroFolder->FindObject(name));
350}
351
352////////////////////////////////////////////////////////////////////////////////
353/// Show element in default editor.
354
356{
357 static const TEveException eh("TEveManager::EditElement ");
358
359 GetEditor()->DisplayElement(element);
360}
361
362////////////////////////////////////////////////////////////////////////////////
363/// Register a request for 3D redraw.
364
366{
369}
370
371////////////////////////////////////////////////////////////////////////////////
372/// Perform 3D redraw of scenes and viewers whose contents has
373/// changed.
374
376{
377 static const TEveException eh("TEveManager::DoRedraw3D ");
378
379 // printf("TEveManager::DoRedraw3D redraw triggered\n");
380
381 // Process element visibility changes, mark relevant scenes as changed.
382 {
383 TEveElement::List_t scenes;
384 Long64_t key, value;
385 TExMapIter stamped_elements(fStampedElements);
386 while (stamped_elements.Next(key, value))
387 {
388 TEveElement *el = reinterpret_cast<TEveElement*>(key);
390 {
391 el->CollectSceneParents(scenes);
392 }
393 }
394 ScenesChanged(scenes);
395 }
396
397 // Process changes in scenes.
400
401 // Process changed elements again, update GUI (just editor so far,
402 // but more can come).
403 {
404 Long64_t key, value;
405 TExMapIter stamped_elements(fStampedElements);
406 while (stamped_elements.Next(key, value))
407 {
408 TEveElement *el = reinterpret_cast<TEveElement*>(key);
409 if (GetEditor()->GetModel() == el->GetEditorObject(eh))
410 EditElement(el);
412
413 el->ClearStamps();
414 }
415 }
417 GetListTree()->ClearViewPort(); // Fix this when several list-trees can be added.
418
421
423}
424
425////////////////////////////////////////////////////////////////////////////////
426/// Perform 3D redraw of all scenes and viewers.
427
428void TEveManager::FullRedraw3D(Bool_t resetCameras, Bool_t dropLogicals)
429{
430 fScenes ->RepaintAllScenes (dropLogicals);
431 fViewers->RepaintAllViewers(resetCameras, dropLogicals);
432}
433
434////////////////////////////////////////////////////////////////////////////////
435/// Element was changed, perform framework side action.
436/// Called from TEveElement::ElementChanged().
437
438void TEveManager::ElementChanged(TEveElement* element, Bool_t update_scenes, Bool_t redraw)
439{
440 static const TEveException eh("TEveElement::ElementChanged ");
441
442 if (GetEditor()->GetModel() == element->GetEditorObject(eh))
443 EditElement(element);
445
446 if (update_scenes) {
447 TEveElement::List_t scenes;
448 element->CollectSceneParents(scenes);
449 ScenesChanged(scenes);
450 }
451
452 if (redraw)
453 Redraw3D();
454}
455
456////////////////////////////////////////////////////////////////////////////////
457/// Mark all scenes from the given list as changed.
458
460{
461 for (TEveElement::List_i s=scenes.begin(); s!=scenes.end(); ++s)
462 ((TEveScene*)*s)->Changed();
463}
464
465////////////////////////////////////////////////////////////////////////////////
466/// Mark element as changed -- it will be processed on next redraw.
467
469{
470 UInt_t slot;
471 if (fStampedElements->GetValue((ULong64_t) element, (Long64_t) element, slot) == 0)
472 {
473 fStampedElements->AddAt(slot, (ULong64_t) element, (Long64_t) element, 1);
474 }
475}
476
477////////////////////////////////////////////////////////////////////////////////
478/// Get default list-tree widget.
479
481{
482 return fLTEFrame->fListTree;
483}
484
487{
488 // Add element as a top-level to a list-tree.
489 // Only add a single copy of a render-element as a top level.
490
491 if (lt == 0) lt = GetListTree();
493 if (open) lt->OpenItem(lti);
494 return lti;
495}
496
497////////////////////////////////////////////////////////////////////////////////
498/// Remove top-level element from list-tree with specified tree-item.
499
501 TGListTree* lt, TGListTreeItem* lti)
502{
503 static const TEveException eh("TEveManager::RemoveFromListTree ");
504
505 if (lti->GetParent())
506 throw(eh + "not a top-level item.");
507
508 element->RemoveFromListTree(lt, 0);
509}
510
511////////////////////////////////////////////////////////////////////////////////
512/// Add a new event and make it the current event.
513/// It is added into the event-scene and as a top-level list-tree
514/// item.
515
517{
518 fCurrentEvent = event;
521 return AddToListTree(event, kTRUE);
522}
523
524////////////////////////////////////////////////////////////////////////////////
525/// Add an element. If parent is not specified it is added into
526/// current event (which is created if does not exist).
527
529{
530 if (parent == 0) {
531 if (fCurrentEvent == 0)
532 AddEvent(new TEveEventManager("Event", "Auto-created event directory"));
533 parent = fCurrentEvent;
534 }
535
536 parent->AddElement(element);
537}
538
539////////////////////////////////////////////////////////////////////////////////
540/// Add a global element, i.e. one that does not change on each
541/// event, like geometry or projection manager.
542/// If parent is not specified it is added to a global scene.
543
545{
546 if (parent == 0)
547 parent = fGlobalScene;
548
549 parent->AddElement(element);
550}
551
552////////////////////////////////////////////////////////////////////////////////
553/// Remove element from parent.
554
556 TEveElement* parent)
557{
558 parent->RemoveElement(element);
559}
560
561////////////////////////////////////////////////////////////////////////////////
562/// Called from TEveElement prior to its destruction so the
563/// framework components (like object editor) can unreference it.
564
566{
567 if (GetEditor()->GetEveElement() == element)
568 EditElement(0);
570
571 if (fScenes)
573
574 if (fStampedElements->GetValue((ULong64_t) element, (Long64_t) element) != 0)
575 fStampedElements->Remove((ULong64_t) element, (Long64_t) element);
576
577 if (element->fImpliedSelected > 0)
579 if (element->fImpliedHighlighted > 0)
581}
582
583////////////////////////////////////////////////////////////////////////////////
584/// Select an element.
585/// Now it only calls EditElement() - should also update selection state.
586
588{
589 if (element != 0)
590 EditElement(element);
591}
592
593////////////////////////////////////////////////////////////////////////////////
594/// Paste has been called.
595
597{
598 // The object to paste is taken from the editor (this is not
599 // exactly right) and handed to 'element' for pasting.
600
602 if (src)
603 return element->HandleElementPaste(src);
604 return kFALSE;
605}
606
607////////////////////////////////////////////////////////////////////////////////
608/// Insert a new visualization-parameter database entry. Returns
609/// true if the element is inserted successfully.
610/// If entry with the same key already exists the behaviour depends on the
611/// 'replace' flag:
612/// - true - The old model is deleted and new one is inserted (default).
613/// Clients of the old model are transferred to the new one and
614/// if 'update' flag is true (default), the new model's parameters
615/// are assigned to all clients.
616/// - false - The old model is kept, false is returned.
617///
618/// If insert is successful, the ownership of the model-element is
619/// transferred to the manager.
620
622 Bool_t replace, Bool_t update)
623{
624 TPair* pair = (TPair*) fVizDB->FindObject(tag);
625 if (pair)
626 {
627 if (replace)
628 {
629 model->IncDenyDestroy();
630 model->SetRnrChildren(kFALSE);
631
632 TEveElement* old_model = dynamic_cast<TEveElement*>(pair->Value());
633 if (old_model)
634 {
635 while (old_model->HasChildren())
636 {
637 TEveElement *el = old_model->FirstChild();
638 el->SetVizModel(model);
639 if (update)
640 {
641 el->CopyVizParams(model);
643 }
644 }
645 old_model->DecDenyDestroy();
646 }
647 pair->SetValue(dynamic_cast<TObject*>(model));
648 return kTRUE;
649 }
650 else
651 {
652 return kFALSE;
653 }
654 }
655 else
656 {
657 model->IncDenyDestroy();
658 model->SetRnrChildren(kFALSE);
659 fVizDB->Add(new TObjString(tag), dynamic_cast<TObject*>(model));
660 return kTRUE;
661 }
662}
663
664////////////////////////////////////////////////////////////////////////////////
665/// Insert a new visualization-parameter database entry with the default
666/// parameters for replace and update, as specified by members
667/// fVizDBReplace(default=kTRUE) and fVizDBUpdate(default=kTRUE).
668/// See docs of the above function.
669
671{
672 return InsertVizDBEntry(tag, model, fVizDBReplace, fVizDBUpdate);
673}
674
675////////////////////////////////////////////////////////////////////////////////
676/// Find a visualization-parameter database entry corresponding to tag.
677/// If the entry is not found 0 is returned.
678
680{
681 return dynamic_cast<TEveElement*>(fVizDB->GetValue(tag));
682}
683
684////////////////////////////////////////////////////////////////////////////////
685/// Load visualization-parameter database from file filename. The
686/// replace, update arguments replace the values of fVizDBReplace
687/// and fVizDBUpdate members for the duration of the macro
688/// execution.
689
690void TEveManager::LoadVizDB(const TString& filename, Bool_t replace, Bool_t update)
691{
692 Bool_t ex_replace = fVizDBReplace;
693 Bool_t ex_update = fVizDBUpdate;
694 fVizDBReplace = replace;
696
697 LoadVizDB(filename);
698
699 fVizDBReplace = ex_replace;
700 fVizDBUpdate = ex_update;
701}
702
703////////////////////////////////////////////////////////////////////////////////
704/// Load visualization-parameter database from file filename.
705/// State of data-members fVizDBReplace and fVizDBUpdate determine
706/// how the registered entries are handled.
707
708void TEveManager::LoadVizDB(const TString& filename)
709{
710 TEveUtil::Macro(filename);
711 Redraw3D();
712}
713
714////////////////////////////////////////////////////////////////////////////////
715/// Save visualization-parameter database to file filename.
716
717void TEveManager::SaveVizDB(const TString& filename)
718{
719 TPMERegexp re("(.+)\\.\\w+");
720 if (re.Match(filename) != 2) {
721 Error("SaveVizDB", "filename does not match required format '(.+)\\.\\w+'.");
722 return;
723 }
724
725 TString exp_filename(filename);
726 gSystem->ExpandPathName(exp_filename);
727
728 std::ofstream out(exp_filename, std::ios::out | std::ios::trunc);
729 out << "void " << re[1] << "()\n";
730 out << "{\n";
731 out << " TEveManager::Create();\n";
732
734
735 Int_t var_id = 0;
736 TString var_name;
737 TIter next(fVizDB);
738 TObjString *key;
739 while ((key = (TObjString*)next()))
740 {
741 TEveElement* mdl = dynamic_cast<TEveElement*>(fVizDB->GetValue(key));
742 if (mdl)
743 {
744 var_name.Form("x%03d", var_id++);
745 mdl->SaveVizParams(out, key->String(), var_name);
746 }
747 else
748 {
749 Warning("SaveVizDB", "Saving failed for key '%s'.", key->String().Data());
750 }
751 }
752
753 out << "}\n";
754 out.close();
755}
756
757////////////////////////////////////////////////////////////////////////////////
758/// Get geometry with given filename.
759/// This is cached internally so the second time this function is
760/// called with the same argument the same geo-manager is returned.
761/// gGeoManager is set to the return value.
762
764{
765 static const TEveException eh("TEveManager::GetGeometry ");
766
767 TString exp_filename = filename;
768 gSystem->ExpandPathName(exp_filename);
769 printf("%s loading: '%s' -> '%s'.\n", eh.Data(),
770 filename.Data(), exp_filename.Data());
771
773 if (gGeoManager)
774 {
776 }
777 else
778 {
779 Bool_t locked = TGeoManager::IsLocked();
780 if (locked) {
781 Warning(eh, "TGeoManager is locked ... unlocking it.");
783 }
784 if (TGeoManager::Import(filename) == 0) {
785 throw(eh + "TGeoManager::Import() failed for '" + exp_filename + "'.");
786 }
787 if (locked) {
789 }
790
792
793 // Import colors exported by Gled, if they exist.
794 {
795 TFile f(exp_filename, "READ");
796 TObjArray* collist = (TObjArray*) f.Get("ColorList");
797 f.Close();
798 if (collist != 0) {
800 TGeoVolume* vol;
801 while ((vol = (TGeoVolume*) next()) != 0)
802 {
803 Int_t oldID = vol->GetLineColor();
804 TColor* col = (TColor*)collist->At(oldID);
805 Float_t r, g, b;
806 col->GetRGB(r, g, b);
807 Int_t newID = TColor::GetColor(r,g,b);
808 vol->SetLineColor(newID);
809 }
810 }
811 }
812
813 fGeometries->Add(new TObjString(filename), gGeoManager);
814 }
815 return gGeoManager;
816}
817
818////////////////////////////////////////////////////////////////////////////////
819/// Get geometry with given alias.
820/// The alias must be registered via RegisterGeometryAlias().
821
823{
824 static const TEveException eh("TEveManager::GetGeometry ");
825
826 TObjString* full_name = (TObjString*) fGeometryAliases->GetValue(alias);
827 if (!full_name)
828 throw(eh + "geometry alias '" + alias + "' not registered.");
829 return GetGeometry(full_name->String());
830}
831
832////////////////////////////////////////////////////////////////////////////////
833/// Get the default geometry.
834/// It should be registered via RegisterGeometryName("Default", <URL>).
835
837{
838 return GetGeometryByAlias("Default");
839}
840
841////////////////////////////////////////////////////////////////////////////////
842/// Register 'name' as an alias for geometry file 'filename'.
843/// The old aliases are silently overwritten.
844/// After that the geometry can be retrieved also by calling:
845/// gEve->GetGeometryByName(name);
846
847void TEveManager::RegisterGeometryAlias(const TString& alias, const TString& filename)
848{
849 fGeometryAliases->Add(new TObjString(alias), new TObjString(filename));
850}
851
852////////////////////////////////////////////////////////////////////////////////
853/// Set the text in the right side of browser's status bar.
854
856{
858}
859
860////////////////////////////////////////////////////////////////////////////////
861/// Work-around uber ugly hack used in SavePrimitive and co.
862
864{
865 TIter nextcl(gROOT->GetListOfClasses());
866 TClass *cls;
867 while((cls = (TClass *)nextcl()))
868 {
870 }
871}
872
873////////////////////////////////////////////////////////////////////////////////
874/// Close button has been clicked on EVE main window (browser).
875/// Cleanup and terminate application.
876
878{
880 TEveBrowser *eb = dynamic_cast<TEveBrowser*>(mf);
881 if (eb == fBrowser)
882 {
883 mf->DontCallClose();
884 Terminate();
886 }
887}
888
889////////////////////////////////////////////////////////////////////////////////
890/// If global TEveManager* gEve is not set initialize it.
891/// Returns gEve.
892
894{
895 static const TEveException eh("TEveManager::Create ");
896
897 if (gEve == 0)
898 {
899 // Make sure that the GUI system is initialized.
900 if (gROOT->IsBatch())
901 {
902 throw eh + "ROOT is running in batch mode.";
903 }
906 if (gROOT->IsBatch() || gClient == 0 || gClient->IsZombie())
907 {
908 throw eh + "window system not initialized.";
909 }
910
911 Int_t w = 1024;
912 Int_t h = 768;
913
916 gEve = new TEveManager(w, h, map_window, opt);
917 }
918 return gEve;
919}
920
921////////////////////////////////////////////////////////////////////////////////
922/// Properly terminate global TEveManager.
923
925{
926 if (!gEve) return;
927
929
930 delete gEve;
931 gEve = 0;
932}
933
934/** \class TEveManager::TExceptionHandler
935\ingroup TEve
936Exception handler for Eve exceptions.
937*/
938
940
941////////////////////////////////////////////////////////////////////////////////
942/// Handle exceptions deriving from TEveException.
943
946{
947 TEveException* ex = dynamic_cast<TEveException*>(&exc);
948 if (ex) {
949 Info("Handle", "%s", ex->Data());
950 gEve->SetStatusLine(ex->Data());
951 gSystem->Beep();
952 return kSEHandled;
953 } else {
954 return kSEProceed;
955 }
956}
ROOT::R::TRInterface & r
Definition: Object.C:4
#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)
const Bool_t kFALSE
Definition: RtypesCore.h:90
long long Long64_t
Definition: RtypesCore.h:71
unsigned long long ULong64_t
Definition: RtypesCore.h:72
float Float_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassImp(name)
Definition: Rtypes.h:361
R__EXTERN TApplication * gApplication
Definition: TApplication.h:166
void Error(const char *location, const char *msgfmt,...)
void Warning(const char *location, const char *msgfmt,...)
TEveManager * gEve
Definition: TEveManager.cxx:48
#define gClient
Definition: TGClient.h:166
char name[80]
Definition: TGX11.cxx:109
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:600
R__EXTERN TGeoIdentity * gGeoIdentity
Definition: TGeoMatrix.h:478
R__EXTERN void * gTQSender
Definition: TQObject.h:44
#define gROOT
Definition: TROOT.h:406
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
Definition: TSystem.h:556
void InitializeGraphics()
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:27
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
@ kClassSaved
Definition: TClass.h:94
The color creation and management class.
Definition: TColor.h:19
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
Definition: TColor.h:51
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:1769
Specialization of TRootBrowser for Eve.
Definition: TEveBrowser.h:130
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.
Definition: TEveElement.h:431
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:34
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
Definition: TEveElement.h:197
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
Definition: TEveElement.h:169
Short_t fImpliedHighlighted
Definition: TEveElement.h:314
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:69
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
Definition: TEveElement.h:313
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()
Definition: TEveElement.h:402
List_t::iterator List_i
Definition: TEveElement.h:70
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
Definition: TEveElement.h:404
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
TGListTree * fListTree
Definition: TEveBrowser.h:94
void ConnectSignals()
Connect list-tree signals.
TEveGedEditor * GetEditor() const
Definition: TEveBrowser.h:115
Specialization of TGedEditor for proper update propagation to TEveManager.
Definition: TEveGedEditor.h:27
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
virtual EStatus Handle(std::exception &exc)
Handle exceptions deriving from TEveException.
Central application manager for Eve.
Definition: TEveManager.h:50
TMap * fVizDB
Definition: TEveManager.h:85
TEveWindowManager * fWindowManager
Definition: TEveManager.h:97
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
Definition: TEveManager.h:120
TGeoManager * GetDefaultGeometry()
Get the default geometry.
TTimer fRedrawTimer
Definition: TEveManager.h:111
void RegisterRedraw3D()
Register a request for 3D redraw.
TEveSelection * fSelection
Definition: TEveManager.h:117
Bool_t fDropLogicals
Definition: TEveManager.h:108
void AddElement(TEveElement *element, TEveElement *parent=0)
Add an element.
Bool_t fTimerActive
Definition: TEveManager.h:110
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 AddGlobalElement(TEveElement *element, TEveElement *parent=0)
Add a global element, i.e.
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
Definition: TEveManager.h:101
TGListTreeItem * AddToListTree(TEveElement *re, Bool_t open, TGListTree *lt=0)
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
Definition: TEveManager.h:118
TEveGedEditor * GetEditor() const
Returns main object editor.
TEveScene * fEventScene
Definition: TEveManager.h:102
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.
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)
Definition: TEveManager.h:168
Bool_t fVizDBReplace
Definition: TEveManager.h:86
TFolder * fMacroFolder
Definition: TEveManager.h:95
TEveSceneList * fScenes
Definition: TEveManager.h:99
TExMap * fStampedElements
Definition: TEveManager.h:114
Bool_t fResetCameras
Definition: TEveManager.h:107
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
Definition: TEveManager.h:121
void ElementStamped(TEveElement *element)
Mark element as changed – it will be processed on next redraw.
TEveEventManager * fCurrentEvent
Definition: TEveManager.h:103
List of Scenes providing common operations on TEveScene collections.
Definition: TEveScene.h:80
void DestroyScenes()
Destroy all scenes and their contents.
Definition: TEveScene.cxx:247
void DestroyElementRenderers(TEveElement *element)
Loop over all scenes and remove all instances of element from them.
Definition: TEveScene.cxx:287
void RepaintAllScenes(Bool_t dropLogicals)
Repaint all scenes.
Definition: TEveScene.cxx:276
void ProcessSceneChanges(Bool_t dropLogicals, TExMap *stampMap)
Loop over all scenes and update them accordingly:
Definition: TEveScene.cxx:307
Eve representation of TGLScene.
Definition: TEveScene.h:27
Make sure there is a SINGLE running TEveSelection for each selection type (select/highlight).
Definition: TEveSelection.h:23
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:168
static void SetupGUI()
Setup icon pictures and mime-types.
Definition: TEveUtil.cxx:97
static void SetupEnvironment()
Setup Include and Macro paths.
Definition: TEveUtil.cxx:54
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.
Definition: TEveViewer.cxx:438
virtual void AddElement(TEveElement *el)
Call base-class implementation.
Definition: TEveViewer.cxx:359
void RepaintAllViewers(Bool_t resetCameras, Bool_t dropLogicals)
Repaint all viewers.
Definition: TEveViewer.cxx:458
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
void ReplaceWindow(TEveWindow *w)
Replace this window with the passed one.
Definition: TEveWindow.cxx:820
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.
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:411
This class stores a (key,value) pair using an external hash.
Definition: TExMap.h:33
void Delete(Option_t *opt="")
Delete all entries stored in the TExMap.
Definition: TExMap.cxx:163
void Remove(ULong64_t hash, Long64_t key)
Remove entry with specified key from the TExMap.
Definition: TExMap.cxx:216
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
Definition: TExMap.cxx:173
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:116
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:53
A TFolder object is a collection of objects and folders.
Definition: TFolder.h:30
virtual TObject * FindObject(const char *name) const
Search object identified by name in the tree of folders inside this folder.
Definition: TFolder.cxx:310
virtual void ClearViewPort()
Clear view port and redraw full content.
Definition: TGCanvas.cxx:886
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:260
virtual void MapWindow()
map window
Definition: TGFrame.h:229
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition: TGLViewer.h:57
TGListTreeItem * GetParent() const
Definition: TGListTree.h:73
void OpenItem(TGListTreeItem *item)
Open item in list tree (i.e. show child items).
void DontCallClose()
Typically call this method in the slot connected to the CloseWindow() signal to prevent the calling o...
Definition: TGFrame.cxx:1740
virtual TObject * GetModel() const
Definition: TGedEditor.h:90
An identity transformation.
Definition: TGeoMatrix.h:384
The manager class for any TGeo geometry.
Definition: TGeoManager.h:43
static void UnlockGeometry()
Unlock current geometry.
TObjArray * GetListOfVolumes() const
Definition: TGeoManager.h:491
TObjArray * GetListOfMatrices() const
Definition: TGeoManager.h:488
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
Definition: TGeoManager.h:530
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:47
void VisibleDaughters(Bool_t vis=kTRUE)
set visibility for daughters
virtual void SetLineColor(Color_t lcolor)
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)
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 * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Definition: TMap.cxx:236
TObject * FindObject(const char *keyname) const
Check if a (key,value) pair exists with keyname as name of the key.
Definition: TMap.cxx:215
An array of TObjects.
Definition: TObjArray.h:37
TObject * At(Int_t idx) const
Definition: TObjArray.h:166
Collectable string class.
Definition: TObjString.h:28
TString & String()
Definition: TObjString.h:48
Mother of all ROOT objects.
Definition: TObject.h:37
void ResetBit(UInt_t f)
Definition: TObject.h:186
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:865
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:874
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:708
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:866
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".
TGStatusBar * GetStatusBar() const
Definition: TRootBrowser.h:139
TGTab * GetTabRight() const
Definition: TRootBrowser.h:141
virtual void SetStatusText(const char *txt, Int_t col)
Set text in culumn col in status bar.
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
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:322
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Definition: TSystem.cxx:1269
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition: TSystem.cxx:414
virtual void Start(Long_t milliSec=-1, Bool_t singleShot=kFALSE)
Starts the timer with a milliSec timeout.
Definition: TTimer.cxx:211
virtual void Stop()
Definition: TTimer.h:93
TText * text
Double_t ex[n]
Definition: legend1.C:17
static constexpr double s