DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
View.h
Go to the documentation of this file.
1 // $Id: $
2 //==========================================================================
3 // AIDA Detector description implementation for LCD
4 //--------------------------------------------------------------------------
5 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6 // All rights reserved.
7 //
8 // For the licensing terms see $DD4hepINSTALL/LICENSE.
9 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10 //
11 // Author : M.Frank
12 //
13 //==========================================================================
14 #ifndef DD4HEP_DDEVE_VIEW_H
15 #define DD4HEP_DDEVE_VIEW_H
16 
17 // Framework include files
18 #include "DD4hep/LCDD.h"
20 
21 // Eve include files
22 #include <TEveScene.h>
23 #include <TEveViewer.h>
24 
25 // C/C++ include files
26 #include <map>
27 #include <string>
28 
29 // Forward declarations
30 class TEveManager;
31 class TEveElementList;
32 
34 namespace DD4hep {
35 
36  // Forward declarations
37  class Display;
38  class EventHandler;
39 
41  /*
42  * \author M.Frank
43  * \version 1.0
44  * \ingroup DD4HEP_EVE
45  */
46  class View {
47  public:
51  typedef std::map<std::string, TEveElementList*> Topics;
52  protected:
55  TEveViewer *m_view;
57  TEveScene *m_geoScene;
59  TEveScene *m_eveScene;
63 
65  std::string m_name;
66 
70 
71  public:
73  virtual TEveElement* ImportGeoElement(TEveElement* element, TEveElementList* list);
75  virtual TEveElement* ImportGeoTopic(TEveElement* element, TEveElementList* list);
77  virtual TEveElement* ImportEventElement(TEveElement* element, TEveElementList* list);
78 
79  public:
81  View(Display* eve, const std::string& name);
83  virtual ~View();
85  const std::string& name() const { return m_name; }
86  const char* c_name() const { return m_name.c_str(); }
88  TEveViewer* viewer() const { return m_view; }
90  bool showGlobal() const { return m_showGlobal; }
92  void setShowGlobal(bool value) { m_showGlobal = value; }
94  virtual View& Build(TEveWindow* slot);
96  virtual void Initialize();
98  virtual View& Map(TEveWindow* slot);
99 
101  virtual View& CreateScenes();
103  virtual TEveElementList* AddToGlobalItems(const std::string& nam);
104 
107  TEveScene* geoScene() const { return m_geoScene; }
110  virtual View& CreateGeoScene();
111 
113  virtual void ConfigureGeometryFromInfo();
115  virtual void ConfigureGeometryFromGlobal();
117  virtual void ConfigureGeometry(const DisplayConfiguration::ViewConfig& config);
118 
120  virtual std::pair<bool,TEveElement*>
121  CreateGeometry(DetElement de, const DisplayConfiguration::Config& cfg);
123  virtual std::pair<bool,TEveElement*>
124  GetGlobalGeometry(DetElement de, const DisplayConfiguration::Config& cfg);
125 
126 
128  virtual void ImportGeo(const std::string& topic, TEveElement* element);
130  virtual void ImportGeo(TEveElementList& topic, TEveElement* element);
132  virtual void ImportGeo(TEveElement* element);
134  virtual void ImportGeoTopics(const std::string& title);
136  virtual TEveElementList& GetGeoTopic(const std::string& name);
137 
138 
141  TEveScene* eveScene() const { return m_eveScene; }
144  virtual View& CreateEventScene();
146  virtual void ConfigureEventFromInfo();
148  virtual void ConfigureEventFromGlobal();
150  virtual void ConfigureEvent(const DisplayConfiguration::ViewConfig& config);
152  virtual void ImportEvent(TEveElement* element);
154  virtual void ImportEventTopics();
155 
157  ClassDef(View,0);
158  };
159 } /* End namespace DD4hep */
160 
161 
162 #endif /* DD4HEP_DDEVE_VIEW_H */
Handle class to hold the information of a sensitive detector.
Definition: Detector.h:47
Display * m_eve
Definition: View.h:53
Class of the ROOT toolkit. See http://root.cern.ch/root/htmldoc/ClassIndex.html.
Definition: ROOTClasses.h:10
TEveScene * geoScene() const
Access to the Eve geometry scene.
Definition: View.h:108
virtual TEveElement * ImportEventElement(TEveElement *element, TEveElementList *list)
Call an element to a event element list.
Definition: View.cpp:109
Topics m_geoTopics
Definition: View.h:67
std::string m_name
The name of the view.
Definition: View.h:65
virtual void ImportEvent(TEveElement *element)
Call to import event elements into the main event scene.
Definition: View.cpp:289
bool showGlobal() const
Show global directory.
Definition: View.h:90
virtual TEveElementList & GetGeoTopic(const std::string &name)
Access/Create an geometry topic by name.
Definition: View.cpp:296
bool m_showGlobal
Definition: View.h:69
virtual void ConfigureEventFromInfo()
Configure a view with event info. Used configuration if present.
Definition: View.cpp:231
virtual void ImportGeoTopics(const std::string &title)
Call to import geometry topics. If title is empty, do not add to global item list.
Definition: View.cpp:206
virtual View & Map(TEveWindow *slot)
Map the view view to the slot.
Definition: View.cpp:335
virtual std::pair< bool, TEveElement * > GetGlobalGeometry(DetElement de, const DisplayConfiguration::Config &cfg)
Access the global instance of the subdetector geometry.
Definition: View.cpp:124
virtual void ImportGeo(const std::string &topic, TEveElement *element)
Call to import geometry elements into topics.
Definition: View.cpp:216
Geometry::SensitiveDetector SensitiveDetector
Definition: View.h:50
virtual void ConfigureGeometryFromInfo()
Configure a view with geo info. Used configuration if present.
Definition: View.cpp:140
View TEveWindowSlot * slot
Definition: MultiView.cpp:30
const DisplayConfiguration::ViewConfig * m_config
Definition: View.h:62
TEveScene * m_eveScene
Reference to the event scene.
Definition: View.h:59
std::map< std::string, TEveElementList * > Topics
Definition: View.h:51
TEveViewer * m_view
Reference to the view.
Definition: View.h:55
virtual std::pair< bool, TEveElement * > CreateGeometry(DetElement de, const DisplayConfiguration::Config &cfg)
Create a new instance of the geometry of a sub-detector.
Definition: View.cpp:133
virtual TEveElementList * AddToGlobalItems(const std::string &nam)
Add the view to the global list of eve objects.
Definition: View.cpp:83
virtual void ConfigureGeometryFromGlobal()
Configure a single geometry view by default from the global geometry scene with all subdetectors...
Definition: View.cpp:147
class View View.h DDEve/View.h
Definition: View.h:46
virtual ~View()
Default destructor.
Definition: View.cpp:49
ClassDef(View, 0)
Root implementation macro.
Geometry::DetElement DetElement
Definition: View.h:49
View(Display *eve, const std::string &name)
Initializing constructor.
Definition: View.cpp:41
void setShowGlobal(bool value)
Set show globals.
Definition: View.h:92
const char * c_name() const
Definition: View.h:86
TEveScene * m_geoScene
Reference to the geometry scene.
Definition: View.h:57
Geometry::LCDD LCDD
Definition: View.h:48
virtual void ImportEventTopics()
Import event typics after creation.
Definition: View.cpp:285
TEveScene * eveScene() const
Access to the Eve event scene.
Definition: View.h:142
virtual View & CreateGeoScene()
Create the geometry scene.
Definition: View.cpp:325
TEveElementList * m_global
Reference to the global item (if added.
Definition: View.h:61
virtual View & Build(TEveWindow *slot)
Build the view view and map it to the given slot.
Definition: View.cpp:60
virtual View & CreateScenes()
Create the geometry and the event scene.
Definition: View.cpp:307
virtual TEveElement * ImportGeoTopic(TEveElement *element, TEveElementList *list)
Call an element to a geometry element list.
Definition: View.cpp:104
virtual void Initialize()
Initialize the view port.
Definition: View.cpp:65
Topics m_eveTopics
Definition: View.h:68
Handle class describing a detector element.
Definition: Detector.h:172
virtual void ConfigureEvent(const DisplayConfiguration::ViewConfig &config)
Configure a single event scene view.
Definition: View.cpp:245
TEveViewer * viewer() const
Access to the Eve viewer.
Definition: View.h:88
virtual void ConfigureGeometry(const DisplayConfiguration::ViewConfig &config)
Configure a single geometry view.
Definition: View.cpp:160
The main interface to the DD4hep detector description package.
Definition: LCDD.h:82
virtual View & CreateEventScene()
Create the event scene.
Definition: View.cpp:315
virtual TEveElement * ImportGeoElement(TEveElement *element, TEveElementList *list)
Call an element to a geometry element list.
Definition: View.cpp:94
virtual void ConfigureEventFromGlobal()
Configure an event view by default from the global event scene.
Definition: View.cpp:238
The main class of the DDEve display.
Definition: Display.h:57
const std::string & name() const
Access to the view name/title.
Definition: View.h:85