25 #include "TEveBrowser.h"
26 #include "TEveManager.h"
27 #include "TEveElement.h"
28 #include "TEveWindow.h"
29 #include "TEveViewer.h"
30 #include "TGLViewer.h"
38 using namespace DD4hep;
44 :
PopupMenu(display->client().GetRoot()), m_display(display), m_title(title)
46 InstanceCount::increment(
this);
50 ViewMenu::~ViewMenu() {
51 InstanceCount::decrement(
this);
55 void ViewMenu::Build(TGMenuBar*
bar,
int hints) {
56 pair<string,string>* p = 0;
58 view_menu->
AddEntry(
"3&D View",
this, &ViewMenu::CreateView, p=
new pair<string,string>(
"DD4hep_DDEve_View3D",
"3D"));
59 view_menu->
AddEntry(
"Rho-&Z Projection",
this, &ViewMenu::CreateView, p=
new pair<string,string>(
"DD4hep_DDEve_RhoZProjection",
"Rho-Z"));
60 view_menu->
AddEntry(
"Rho-&Phi Projection",
this, &ViewMenu::CreateView, p=
new pair<string,string>(
"DD4hep_DDEve_RhoPhiProjection",
"Rho-Phi"));
62 for(Display::ViewConfigurations::const_iterator i=vc.begin(); i!=vc.end(); ++i) {
64 view_menu->
AddEntry(v.
name.c_str(),
this, &ViewMenu::CreateView,p=
new pair<string,string>(
"DD4hep_DDEve_"+v.
type,v.
name));
66 bar->AddPopup(m_title.c_str(),*view_menu,
new TGLayoutHints(hints, 0, 4, 0, 0));
70 void ViewMenu::CreateView(TGMenuEntry*,
void* ud) {
71 pair<string,string>* args = (pair<string,string>*)ud;
72 CreateView(args->first,args->second);
75 View* ViewMenu::CreateView(
const std::string& type,
const std::string& title) {
76 pair<string,string> args(
"DD4hep_DDEve_"+type,title);
77 View*
v = PluginService::Create<View*>(type.c_str(),m_display,title.c_str());
83 View* ViewMenu::CreateView3D(
const std::string& title) {
84 return CreateView(
"DD4hep_DDEve_View3D",title.c_str());
88 View* ViewMenu::CreateRhoZProjection(
const std::string& title ) {
89 return CreateView(
"DD4hep_DDEve_RhoZProjection",title.c_str());
93 View* ViewMenu::CreateRhoPhiProjection(
const std::string& title ) {
94 return CreateView(
"DD4hep_DDEve_RhoPhiProjection",title.c_str());
98 void ViewMenu::BuildView(
View*
v)
const {
99 TEveManager&
m = m_display->manager();
100 TEveBrowser *browser = m.GetBrowser();
101 TGTab *right = browser->GetTabRight();
102 TEveWindowSlot *
slot = TEveWindow::CreateWindowInTab(right);
104 m_display->RegisterEvents(v);
108 right->SetTab(right->GetNumberOfTabs()-1);
virtual void ConfigureEventFromInfo()
Configure a view with event info. Used configuration if present.
virtual void ConfigureGeometryFromInfo()
Configure a view with geo info. Used configuration if present.
View TEveWindowSlot * slot
class View View.h DDEve/View.h
std::map< std::string, ViewConfig > ViewConfigurations
virtual View & Build(TEveWindow *slot)
Build the view view and map it to the given slot.
virtual void Initialize()
Initialize the view port.
The main class of the DDEve display.