14 #include <boost/bind.hpp>
22 #include "TEveManager.h"
23 #include "TEveWindowManager.h"
24 #include "TEveWindow.h"
26 #include "TObjString.h"
53 gROOT->SetStyle(
"Plain");
56 gEve->GetWindowManager()->Connect(
57 "WindowDeleted(TEveWindow*)",
"FWDetailViewManager",
this,
"eveWindowDestroyed(TEveWindow*)");
62 gEve->GetWindowManager()->Disconnect(
"WindowDeleted(TEveWindow*)",
this,
"eveWindowDestroyed(TEveWindow*)");
66 std::unique_ptr<FWDetailViewBase>
v,
68 : m_eveFrame(
f), m_detailView(
std::
move(
v)), m_eveWindow(
w) {}
72 TEveWindowSlot* slot = TEveWindow::CreateWindowMainFrame();
73 TEveCompositeFrameInMainFrame* eveFrame = (TEveCompositeFrameInMainFrame*)slot->GetEveFrame();
78 if (viewerNames.empty()) {
81 <<
id.item()->name() << std::endl;
82 assert(!viewerNames.empty());
87 for (std::vector<std::string>::iterator it = viewerNames.begin(), itEnd = viewerNames.end(); it != itEnd; ++it) {
97 assert(
nullptr != detailView);
99 TEveWindowSlot* ws = (TEveWindowSlot*)(eveFrame->GetEveWindow());
100 detailView->init(ws);
101 detailView->build(
id);
104 TGMainFrame* mf = (TGMainFrame*)(eveFrame->GetParent());
105 mf->SetWindowName(Form(
"%s Detail View [%d]",
id.
item()->
name().c_str(),
id.
index()));
107 m_views.emplace_back(eveFrame,
std::move(detailView), eveFrame->GetEveWindow());
115 std::vector<std::string> justViewNames;
116 justViewNames.reserve(fullNames.size());
118 return justViewNames;
131 std::vector<std::string> returnValue;
133 std::map<std::string, std::vector<std::string> >::const_iterator itFind =
m_typeToViewers.find(iType);
135 return itFind->second;
138 std::set<std::string> detailViews;
140 std::vector<edmplugin::PluginInfo>
all =
144 std::inserter(detailViews, detailViews.begin()),
146 unsigned int closestMatch = 0xFFFFFFFF;
148 for (std::set<std::string>::iterator it = detailViews.begin(), itEnd = detailViews.end(); it != itEnd; ++it) {
150 std::size_t
found = it->find(
"PF ");
151 if (
found != std::string::npos)
161 if (closestMatch >
info.proximity()) {
164 if (firstD != std::string::npos) {
165 std::stringstream
ss(it->substr(firstD));
167 while (std::getline(
ss, ml,
'&')) {
169 fwLog(
fwlog::kDebug) <<
"DetailView " << *it <<
" requires module label " << ml << std::endl;
176 returnValue.push_back(*it);
180 vn.insert(++
first,
"!");
181 returnValue.push_back(vn);
186 std::vector<std::string>::iterator it;
187 it =
std::unique(returnValue.begin(), returnValue.end(), pluginComapreFunc);
201 m_views.front().m_eveWindow->DestroyWindowAndSlot();
207 if (ew ==
i->m_eveWindow) {