File indexing completed on 2025-01-18 09:55:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef DDEVE_VIEW_H
0014 #define DDEVE_VIEW_H
0015
0016
0017 #include "DD4hep/Detector.h"
0018 #include "DDEve/DisplayConfiguration.h"
0019
0020
0021 #include <TEveScene.h>
0022 #include <TEveViewer.h>
0023
0024
0025 #include <map>
0026 #include <string>
0027
0028
0029 class TEveManager;
0030 class TEveElementList;
0031
0032
0033 namespace dd4hep {
0034
0035
0036 class Display;
0037 class EventHandler;
0038
0039
0040
0041
0042
0043
0044
0045 class View {
0046 public:
0047 typedef std::map<std::string, TEveElementList*> Topics;
0048 protected:
0049 Display *m_eve;
0050
0051 TEveViewer *m_view;
0052
0053 TEveScene *m_geoScene;
0054
0055 TEveScene *m_eveScene;
0056
0057 TEveElementList *m_global;
0058 const DisplayConfiguration::ViewConfig* m_config;
0059
0060
0061 std::string m_name;
0062
0063 Topics m_geoTopics;
0064 Topics m_eveTopics;
0065 bool m_showGlobal;
0066
0067 public:
0068
0069 virtual TEveElement* ImportGeoElement(TEveElement* element, TEveElementList* list);
0070
0071 virtual TEveElement* ImportGeoTopic(TEveElement* element, TEveElementList* list);
0072
0073 virtual TEveElement* ImportEventElement(TEveElement* element, TEveElementList* list);
0074
0075 public:
0076
0077 View(Display* eve, const std::string& name);
0078
0079 virtual ~View();
0080
0081 const std::string& name() const { return m_name; }
0082 const char* c_name() const { return m_name.c_str(); }
0083
0084 TEveViewer* viewer() const { return m_view; }
0085
0086 bool showGlobal() const { return m_showGlobal; }
0087
0088 void setShowGlobal(bool value) { m_showGlobal = value; }
0089
0090 virtual View& Build(TEveWindow* slot);
0091
0092 virtual void Initialize();
0093
0094 virtual View& Map(TEveWindow* slot);
0095
0096
0097 virtual View& CreateScenes();
0098
0099 virtual TEveElementList* AddToGlobalItems(const std::string& nam);
0100
0101
0102
0103
0104 TEveScene* geoScene() const { return m_geoScene; }
0105
0106 virtual View& CreateGeoScene();
0107
0108
0109 virtual void ConfigureGeometryFromInfo();
0110
0111 virtual void ConfigureGeometryFromGlobal();
0112
0113 virtual void ConfigureGeometry(const DisplayConfiguration::ViewConfig& config);
0114
0115
0116 virtual std::pair<bool,TEveElement*>
0117 CreateGeometry(DetElement de, const DisplayConfiguration::Config& cfg);
0118
0119 virtual std::pair<bool,TEveElement*>
0120 GetGlobalGeometry(DetElement de, const DisplayConfiguration::Config& cfg);
0121
0122
0123
0124 virtual void ImportGeo(const std::string& topic, TEveElement* element);
0125
0126 virtual void ImportGeo(TEveElementList& topic, TEveElement* element);
0127
0128 virtual void ImportGeo(TEveElement* element);
0129
0130 virtual void ImportGeoTopics(const std::string& title);
0131
0132 virtual TEveElementList& GetGeoTopic(const std::string& name);
0133
0134
0135
0136
0137
0138 TEveScene* eveScene() const { return m_eveScene; }
0139
0140 virtual View& CreateEventScene();
0141
0142 virtual void ConfigureEventFromInfo();
0143
0144 virtual void ConfigureEventFromGlobal();
0145
0146 virtual void ConfigureEvent(const DisplayConfiguration::ViewConfig& config);
0147
0148 virtual void ImportEvent(TEveElement* element);
0149
0150 virtual void ImportEventTopics();
0151
0152
0153 ClassDef(View,0);
0154 };
0155 }
0156 #endif