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
55
56////////////////////////////////////////////////////////////////////////////////
57
59 fExcHandler (nullptr),
60 fVizDB (nullptr), fVizDBReplace(kTRUE), fVizDBUpdate(kTRUE),
61 fGeometries (nullptr),
62 fGeometryAliases (nullptr),
63 fBrowser (nullptr),
64
65 fMacroFolder (nullptr),
66
67 fWindowManager (nullptr),
68 fViewers (nullptr),
69 fScenes (nullptr),
70 fGlobalScene (nullptr),
71 fEventScene (nullptr),
72 fCurrentEvent (nullptr),
73
74 fRedrawDisabled (0),
75 fResetCameras (kFALSE),
76 fDropLogicals (kFALSE),
77 fKeepEmptyCont (kFALSE),
78 fTimerActive (kFALSE),
79 fRedrawTimer (),
80
81 fStampedElements(nullptr),
82 fSelection (nullptr),
83 fHighlight (nullptr),
84
85 fOrphanage (nullptr),
86 fUseOrphanage (kFALSE)
87{
88 // Constructor.
89 // If map_window is true, the TEveBrowser window is mapped.
90 //
91 // Option string is first parsed for the following characters:
92 // V - spawn a default GL viewer.
93 //
94 // The consumed characters are removed from the options and they
95 // are passed to TEveBrowser for creation of additional plugins.
96 //
97 // Default options: "FIV" - file-browser, command-line, GL-viewer.
98
99
100 static const TEveException eh("TEveManager::TEveManager ");
101
102 if (gEve != nullptr)
103 throw(eh + "There can be only one!");
104
105 gEve = this;
106
108
112
114
115 fSelection = new TEveSelection("Global Selection");
117 fHighlight = new TEveSelection("Global Highlight");
120
121 fOrphanage = new TEveElementList("Global Orphanage");
123
124 fRedrawTimer.Connect("Timeout()", "TEveManager", this, "DoRedraw3D()");
125 fMacroFolder = new TFolder("EVE", "Visualization macros");
126 gROOT->GetListOfBrowsables()->Add(fMacroFolder);
127
128
129 fWindowManager = new TEveWindowManager("WindowManager", "Manager of EVE windows");
130
131 // Build GUI
132 fBrowser = new TEveBrowser(w, h);
133
134 // ListTreeEditor
137 fBrowser->StopEmbedding("Eve");
139
140 // See how many GL viewers are requested, remove from options.
141 TString str_opt(opt);
142 TPMERegexp viewer_re("V", "g");
143 Int_t viewer_count = viewer_re.Substitute(str_opt, "", kFALSE);
144
145 // Create the main window / browse.
147 if (map_window)
149
150 // --------------------------------
151
154
155 fViewers = new TEveViewerList("Viewers");
158
159 fScenes = new TEveSceneList ("Scenes");
162
163 fGlobalScene = new TEveScene("Geometry scene");
166
167 fEventScene = new TEveScene("Event scene");
170
171 for (Int_t vc = 0; vc < viewer_count; ++vc)
172 {
173 TEveViewer* v = SpawnNewViewer(Form("Viewer %d", vc+1));
174 v->AddScene(fGlobalScene);
175 v->AddScene(fEventScene);
176 }
177
178 if (GetDefaultViewer())
179 {
181 }
182
184}
185
186////////////////////////////////////////////////////////////////////////////////
187/// Destructor.
188
190{
191 // Stop timer and deny further redraw requests.
194
195 delete fCurrentEvent;
196 fCurrentEvent = nullptr;
197
202 fScenes->Destroy();
203 fScenes = nullptr;
204
207 fViewers->Destroy();
208 fViewers = nullptr;
209
213 fWindowManager = nullptr;
214
218
219 gROOT->GetListOfBrowsables()->Remove(fMacroFolder);
220 delete fMacroFolder;
221
222 delete fGeometryAliases;
223 delete fGeometries;
224 delete fVizDB;
225 delete fExcHandler;
226 delete fStampedElements;
227
229
231 fBrowser->TRootBrowser::CloseWindow();
232}
233
234////////////////////////////////////////////////////////////////////////////////
235/// Clear the orphanage.
236
244
245////////////////////////////////////////////////////////////////////////////////
246/// Get the main window, i.e. EVE-browser.
247
249{
250 return fBrowser;
251}
252
253////////////////////////////////////////////////////////////////////////////////
254/// Returns the default viewer - the first one in the fViewers list.
255
257{
258 return dynamic_cast<TEveViewer*>(fViewers->FirstChild());
259}
260
261////////////////////////////////////////////////////////////////////////////////
262/// Get TGLViewer of the default TEveViewer.
263
265{
267 return ev ? ev->GetGLViewer() : nullptr;
268}
269
270////////////////////////////////////////////////////////////////////////////////
271/// Returns main object editor.
272
274{
275 return fLTEFrame->GetEditor();
276}
277
278////////////////////////////////////////////////////////////////////////////////
279/// Returns main window status bar.
280
285
286////////////////////////////////////////////////////////////////////////////////
287/// Add a new canvas tab.
288
290{
291 fBrowser->StartEmbedding(1, -1);
292 TCanvas* c = new TCanvas;
294
295 return c;
296}
297
298////////////////////////////////////////////////////////////////////////////////
299/// Create a new GL viewer.
300
301TEveViewer* TEveManager::SpawnNewViewer(const char* name, const char* title,
303{
304 TEveWindowSlot* slot = nullptr;
305 if (embed)
306 {
308 if (slot == nullptr)
309 {
310 // In principle should have some default/current container
311 // in TEveWindowManager.
312 // Also to store closed windows.
315 }
316 }
317 else
318 {
320 }
321
322 TEveViewer* v = new TEveViewer(name, title);
323 v->SpawnGLViewer(embed ? GetEditor() : nullptr);
324
325 slot->ReplaceWindow(v);
326
328
329 return v;
330}
331
332////////////////////////////////////////////////////////////////////////////////
333/// Create a new scene.
334
335TEveScene* TEveManager::SpawnNewScene(const char* name, const char* title)
336{
337 TEveScene* s = new TEveScene(name, title);
339 return s;
340}
341
342////////////////////////////////////////////////////////////////////////////////
343/// Find macro in fMacroFolder by name.
344
346{
347 return dynamic_cast<TMacro*>(fMacroFolder->FindObject(name));
348}
349
350////////////////////////////////////////////////////////////////////////////////
351/// Show element in default editor.
352
354{
355 static const TEveException eh("TEveManager::EditElement ");
356
358}
359
360////////////////////////////////////////////////////////////////////////////////
361/// Register a request for 3D redraw.
362
368
369////////////////////////////////////////////////////////////////////////////////
370/// Perform 3D redraw of scenes and viewers whose contents has
371/// changed.
372
374{
375 static const TEveException eh("TEveManager::DoRedraw3D ");
376
377 // printf("TEveManager::DoRedraw3D redraw triggered\n");
378
379 // Process element visibility changes, mark relevant scenes as changed.
380 {
382 Long64_t key, value;
384 while (stamped_elements.Next(key, value))
385 {
386 TEveElement *el = reinterpret_cast<TEveElement*>(key);
387 if (el->GetChangeBits() & TEveElement::kCBVisibility)
388 {
389 el->CollectSceneParents(scenes);
390 }
391 }
393 }
394
395 // Process changes in scenes.
398
399 // Process changed elements again, update GUI (just editor so far,
400 // but more can come).
401 {
402 Long64_t key, value;
404 while (stamped_elements.Next(key, value))
405 {
406 TEveElement *el = reinterpret_cast<TEveElement*>(key);
407 if (GetEditor()->GetModel() == el->GetEditorObject(eh))
410
411 el->ClearStamps();
412 }
413 }
415 GetListTree()->ClearViewPort(); // Fix this when several list-trees can be added.
416
419
421}
422
423////////////////////////////////////////////////////////////////////////////////
424/// Perform 3D redraw of all scenes and viewers.
425
431
432////////////////////////////////////////////////////////////////////////////////
433/// Element was changed, perform framework side action.
434/// Called from TEveElement::ElementChanged().
435
437{
438 static const TEveException eh("TEveElement::ElementChanged ");
439
440 if (GetEditor()->GetModel() == element->GetEditorObject(eh))
443
444 if (update_scenes) {
446 element->CollectSceneParents(scenes);
448 }
449
450 if (redraw)
451 Redraw3D();
452}
453
454////////////////////////////////////////////////////////////////////////////////
455/// Mark all scenes from the given list as changed.
456
458{
459 for (TEveElement::List_i s=scenes.begin(); s!=scenes.end(); ++s)
460 ((TEveScene*)*s)->Changed();
461}
462
463////////////////////////////////////////////////////////////////////////////////
464/// Mark element as changed -- it will be processed on next redraw.
465
474
475////////////////////////////////////////////////////////////////////////////////
476/// Get default list-tree widget.
477
482
485{
486 // Add element as a top-level to a list-tree.
487 // Only add a single copy of a render-element as a top level.
488
489 if (lt == nullptr) lt = GetListTree();
490 TGListTreeItem* lti = re->AddIntoListTree(lt, (TGListTreeItem*)nullptr);
491 if (open) lt->OpenItem(lti);
492 return lti;
493}
494
495////////////////////////////////////////////////////////////////////////////////
496/// Remove top-level element from list-tree with specified tree-item.
497
500{
501 static const TEveException eh("TEveManager::RemoveFromListTree ");
502
503 if (lti->GetParent())
504 throw(eh + "not a top-level item.");
505
506 element->RemoveFromListTree(lt, nullptr);
507}
508
509////////////////////////////////////////////////////////////////////////////////
510/// Add a new event and make it the current event.
511/// It is added into the event-scene and as a top-level list-tree
512/// item.
513
521
522////////////////////////////////////////////////////////////////////////////////
523/// Add an element. If parent is not specified it is added into
524/// current event (which is created if does not exist).
525
527{
528 if (parent == nullptr) {
529 if (fCurrentEvent == nullptr)
530 AddEvent(new TEveEventManager("Event", "Auto-created event directory"));
531 parent = fCurrentEvent;
532 }
533
534 parent->AddElement(element);
535}
536
537////////////////////////////////////////////////////////////////////////////////
538/// Add a global element, i.e. one that does not change on each
539/// event, like geometry or projection manager.
540/// If parent is not specified it is added to a global scene.
541
543{
544 if (parent == nullptr)
545 parent = fGlobalScene;
546
547 parent->AddElement(element);
548}
549
550////////////////////////////////////////////////////////////////////////////////
551/// Remove element from parent.
552
558
559////////////////////////////////////////////////////////////////////////////////
560/// Called from TEveElement prior to its destruction so the
561/// framework components (like object editor) can unreference it.
562
564{
565 if (GetEditor()->GetEveElement() == element)
566 EditElement(nullptr);
568
569 if (fScenes)
571
574
575 if (element->fImpliedSelected > 0)
577 if (element->fImpliedHighlighted > 0)
579}
580
581////////////////////////////////////////////////////////////////////////////////
582/// Select an element.
583/// Now it only calls EditElement() - should also update selection state.
584
586{
587 if (element != nullptr)
589}
590
591////////////////////////////////////////////////////////////////////////////////
592/// Paste has been called.
593
595{
596 // The object to paste is taken from the editor (this is not
597 // exactly right) and handed to 'element' for pasting.
598
600 if (src)
601 return element->HandleElementPaste(src);
602 return kFALSE;
603}
604
605////////////////////////////////////////////////////////////////////////////////
606/// Insert a new visualization-parameter database entry. Returns
607/// true if the element is inserted successfully.
608/// If entry with the same key already exists the behaviour depends on the
609/// 'replace' flag:
610/// - true - The old model is deleted and new one is inserted (default).
611/// Clients of the old model are transferred to the new one and
612/// if 'update' flag is true (default), the new model's parameters
613/// are assigned to all clients.
614/// - false - The old model is kept, false is returned.
615///
616/// If insert is successful, the ownership of the model-element is
617/// transferred to the manager.
618
620 Bool_t replace, Bool_t update)
621{
622 TPair* pair = (TPair*) fVizDB->FindObject(tag);
623 if (pair)
624 {
625 if (replace)
626 {
627 model->IncDenyDestroy();
628 model->SetRnrChildren(kFALSE);
629
630 TEveElement* old_model = dynamic_cast<TEveElement*>(pair->Value());
631 if (old_model)
632 {
633 while (old_model->HasChildren())
634 {
635 TEveElement *el = old_model->FirstChild();
636 el->SetVizModel(model);
637 if (update)
638 {
639 el->CopyVizParams(model);
640 el->PropagateVizParamsToProjecteds();
641 }
642 }
643 old_model->DecDenyDestroy();
644 }
645 pair->SetValue(dynamic_cast<TObject*>(model));
646 return kTRUE;
647 }
648 else
649 {
650 return kFALSE;
651 }
652 }
653 else
654 {
655 model->IncDenyDestroy();
656 model->SetRnrChildren(kFALSE);
657 fVizDB->Add(new TObjString(tag), dynamic_cast<TObject*>(model));
658 return kTRUE;
659 }
660}
661
662////////////////////////////////////////////////////////////////////////////////
663/// Insert a new visualization-parameter database entry with the default
664/// parameters for replace and update, as specified by members
665/// fVizDBReplace(default=kTRUE) and fVizDBUpdate(default=kTRUE).
666/// See docs of the above function.
667
672
673////////////////////////////////////////////////////////////////////////////////
674/// Find a visualization-parameter database entry corresponding to tag.
675/// If the entry is not found 0 is returned.
676
678{
679 return dynamic_cast<TEveElement*>(fVizDB->GetValue(tag));
680}
681
682////////////////////////////////////////////////////////////////////////////////
683/// Load visualization-parameter database from file filename. The
684/// replace, update arguments replace the values of fVizDBReplace
685/// and fVizDBUpdate members for the duration of the macro
686/// execution.
687
700
701////////////////////////////////////////////////////////////////////////////////
702/// Load visualization-parameter database from file filename.
703/// State of data-members fVizDBReplace and fVizDBUpdate determine
704/// how the registered entries are handled.
705
711
712////////////////////////////////////////////////////////////////////////////////
713/// Save visualization-parameter database to file filename.
714
716{
717 TPMERegexp re("(.+)\\.\\w+");
718 if (re.Match(filename) != 2) {
719 Error("SaveVizDB", "filename does not match required format '(.+)\\.\\w+'.");
720 return;
721 }
722
725
726 std::ofstream out(exp_filename, std::ios::out | std::ios::trunc);
727 out << "void " << re[1] << "()\n";
728 out << "{\n";
729 out << " TEveManager::Create();\n";
730
732
733 Int_t var_id = 0;
735 TIter next(fVizDB);
736 TObjString *key;
737 while ((key = (TObjString*)next()))
738 {
739 TEveElement* mdl = dynamic_cast<TEveElement*>(fVizDB->GetValue(key));
740 if (mdl)
741 {
742 var_name.Form("x%03d", var_id++);
743 mdl->SaveVizParams(out, key->String(), var_name);
744 }
745 else
746 {
747 Warning("SaveVizDB", "Saving failed for key '%s'.", key->String().Data());
748 }
749 }
750
751 out << "}\n";
752 out.close();
753}
754
755////////////////////////////////////////////////////////////////////////////////
756/// Get geometry with given filename.
757/// This is cached internally so the second time this function is
758/// called with the same argument the same geo-manager is returned.
759/// gGeoManager is set to the return value.
760
762{
763 static const TEveException eh("TEveManager::GetGeometry ");
764
767 printf("%s loading: '%s' -> '%s'.\n", eh.Data(),
768 filename.Data(), exp_filename.Data());
769
771 if (gGeoManager)
772 {
774 }
775 else
776 {
778 if (locked) {
779 Warning(eh, "TGeoManager is locked ... unlocking it.");
781 }
782 if (TGeoManager::Import(filename) == nullptr) {
783 throw(eh + "TGeoManager::Import() failed for '" + exp_filename + "'.");
784 }
785 if (locked) {
787 }
788
790
791 // Import colors exported by Gled, if they exist.
792 if (exp_filename.EndsWith(".root")) {
793 TFile f(exp_filename, "READ");
794 TObjArray* collist = (TObjArray*) f.Get("ColorList");
795 f.Close();
796 if (collist != nullptr) {
798 TGeoVolume* vol;
799 while ((vol = (TGeoVolume*) next()) != nullptr)
800 {
801 Int_t oldID = vol->GetLineColor();
802 TColor* col = (TColor*)collist->At(oldID);
803 Float_t r, g, b;
804 col->GetRGB(r, g, b);
806 vol->SetLineColor(newID);
807 }
808 }
809 }
810
812 }
813 return gGeoManager;
814}
815
816////////////////////////////////////////////////////////////////////////////////
817/// Get geometry with given alias.
818/// The alias must be registered via RegisterGeometryAlias().
819
821{
822 static const TEveException eh("TEveManager::GetGeometry ");
823
825 if (!full_name)
826 throw(eh + "geometry alias '" + alias + "' not registered.");
827 return GetGeometry(full_name->String());
828}
829
830////////////////////////////////////////////////////////////////////////////////
831/// Get the default geometry.
832/// It should be registered via RegisterGeometryName("Default", `<URL>`).
833
838
839////////////////////////////////////////////////////////////////////////////////
840/// Register 'name' as an alias for geometry file 'filename'.
841/// The old aliases are silently overwritten.
842/// After that the geometry can be retrieved also by calling:
843/// gEve->GetGeometryByName(name);
844
849
850////////////////////////////////////////////////////////////////////////////////
851/// Set the text in the right side of browser's status bar.
852
854{
856}
857
858////////////////////////////////////////////////////////////////////////////////
859/// Work-around uber ugly hack used in SavePrimitive and co.
860
862{
863 gROOT->ResetClassSaved();
864}
865
866////////////////////////////////////////////////////////////////////////////////
867/// Close button has been clicked on EVE main window (browser).
868/// Cleanup and terminate application.
869
871{
873 TEveBrowser *eb = dynamic_cast<TEveBrowser*>(mf);
874 if (eb == fBrowser)
875 {
876 mf->DontCallClose();
877 Terminate();
879 }
880}
881
882////////////////////////////////////////////////////////////////////////////////
883/// If global TEveManager* gEve is not set initialize it.
884/// Returns gEve.
885
887{
888 static const TEveException eh("TEveManager::Create ");
889
890 if (gEve == nullptr)
891 {
892 // Make sure that the GUI system is initialized.
893 if (gROOT->IsBatch())
894 {
895 throw eh + "ROOT is running in batch mode.";
896 }
899 if (gROOT->IsBatch() || gClient == nullptr || gClient->IsZombie())
900 {
901 throw eh + "window system not initialized.";
902 }
903
904 Int_t w = 1024;
905 Int_t h = 768;
906
909 gEve = new TEveManager(w, h, map_window, opt);
910 }
911 return gEve;
912}
913
914////////////////////////////////////////////////////////////////////////////////
915/// Properly terminate global TEveManager.
916
918{
919 if (!gEve) return;
920
922
923 delete gEve;
924 gEve = nullptr;
925}
926
927/** \class TEveManager::TExceptionHandler
928\ingroup TEve
929Exception handler for Eve exceptions.
930*/
931
932
933////////////////////////////////////////////////////////////////////////////////
934/// Handle exceptions deriving from TEveException.
935
938{
939 TEveException* ex = dynamic_cast<TEveException*>(&exc);
940 if (ex) {
941 Info("Handle", "%s", ex->Data());
942 gEve->SetStatusLine(ex->Data());
943 gSystem->Beep();
944 return kSEHandled;
945 } else {
946 return kSEProceed;
947 }
948}
#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
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
R__EXTERN TApplication * gApplication
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:208
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition TError.cxx:252
TEveManager * gEve
R__EXTERN TEveManager * gEve
#define gClient
Definition TGClient.h:157
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:411
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2495
R__EXTERN TSystem * gSystem
Definition TSystem.h:572
const_iterator begin() const
const_iterator end() const
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:35
The Canvas class.
Definition TCanvas.h:23
The color creation and management class.
Definition TColor.h:22
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
Definition TColor.h:55
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:1926
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
virtual void AddElement(TEveElement *el)
Add el to the list of children.
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.
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.
virtual void Destroy()
Destroy this element.
virtual void DestroyElements()
Destroy all children of this element.
virtual void RemoveElement(TEveElement *el)
Remove el from the list of children.
List_t::iterator List_i
Definition TEveElement.h:72
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:163
static void SetupGUI()
Setup icon pictures and mime-types.
Definition TEveUtil.cxx:92
static void SetupEnvironment()
Setup Include and Macro paths.
Definition TEveUtil.cxx:49
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
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.
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.
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: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
void Delete(Option_t *opt="") override
Delete all entries stored in the TExMap.
Definition TExMap.cxx:163
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:131
<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:305
virtual void ClearViewPort()
Clear view port and redraw full content.
Definition TGCanvas.cxx:888
void MapWindow() override
map window
Definition TGFrame.h:206
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:268
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition TGLViewer.h:55
A list tree is a widget that can contain a number of items arranged in a tree structure.
Definition TGListTree.h:197
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:399
void DontCallClose()
Typically call this method in the slot connected to the CloseWindow() signal to prevent the calling o...
Definition TGFrame.cxx:1772
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:45
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:53
virtual void SetOwnerKeyValue(Bool_t ownkeys=kTRUE, Bool_t ownvals=kTRUE)
Set ownership for keys and values.
Definition TMap.cxx:351
TObject * FindObject(const char *keyname) const override
Check if a (key,value) pair exists with keyname as name of the key.
Definition TMap.cxx:214
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Definition TMap.cxx:235
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:1045
Wrapper for PCRE library (Perl Compatible Regular Expressions).
Definition TPRegexp.h:97
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:865
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:138
const char * Data() const
Definition TString.h:384
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:1285
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:216
virtual void Stop()
Definition TTimer.h:94
Double_t ex[n]
Definition legend1.C:17