14 #include <boost/bind.hpp> 22 #include "TEveManager.h" 23 #include "TEveWindowManager.h" 24 #include "TEveWindow.h" 45 return iFull.substr(first + 1, second - first - 1);
52 gROOT->SetStyle(
"Plain");
55 gEve->GetWindowManager()->Connect(
56 "WindowDeleted(TEveWindow*)",
"FWDetailViewManager",
this,
"eveWindowDestroyed(TEveWindow*)");
61 gEve->GetWindowManager()->Disconnect(
"WindowDeleted(TEveWindow*)",
this,
"eveWindowDestroyed(TEveWindow*)");
65 std::unique_ptr<FWDetailViewBase>
v,
67 : m_eveFrame(f), m_detailView(
std::
move(v)), m_eveWindow(w) {}
71 TEveWindowSlot* slot = TEveWindow::CreateWindowMainFrame();
72 TEveCompositeFrameInMainFrame* eveFrame = (TEveCompositeFrameInMainFrame*)slot->GetEveFrame();
77 if (viewerNames.empty()) {
80 <<
id.item()->name() << std::endl;
81 assert(!viewerNames.empty());
86 for (std::vector<std::string>::iterator it = viewerNames.begin(), itEnd = viewerNames.end(); it != itEnd; ++it) {
94 assert(!match.empty());
96 assert(
nullptr != detailView);
98 TEveWindowSlot* ws = (TEveWindowSlot*)(eveFrame->GetEveWindow());
100 detailView->build(
id);
103 TGMainFrame* mf = (TGMainFrame*)(eveFrame->GetParent());
104 mf->SetWindowName(Form(
"%s Detail View [%d]",
id.
item()->
name().c_str(),
id.
index()));
106 m_views.emplace_back(eveFrame,
std::move(detailView), eveFrame->GetEveWindow());
114 std::vector<std::string> justViewNames;
115 justViewNames.reserve(fullNames.size());
117 return justViewNames;
130 std::vector<std::string> returnValue;
132 std::map<std::string, std::vector<std::string> >::const_iterator itFind =
m_typeToViewers.find(iType);
134 return itFind->second;
137 std::set<std::string> detailViews;
139 std::vector<edmplugin::PluginInfo>
all =
143 std::inserter(detailViews, detailViews.begin()),
145 unsigned int closestMatch = 0xFFFFFFFF;
147 for (std::set<std::string>::iterator it = detailViews.begin(), itEnd = detailViews.end(); it != itEnd; ++it) {
149 std::size_t
found = it->find(
"PF ");
150 if (found != std::string::npos)
163 if (firstD != std::string::npos) {
164 std::stringstream
ss(it->substr(firstD));
166 while (std::getline(
ss, ml,
'&')) {
168 fwLog(
fwlog::kDebug) <<
"DetailView " << *it <<
" requires module label " << ml << std::endl;
175 returnValue.push_back(*it);
179 vn.insert(++first,
"!");
180 returnValue.push_back(vn);
185 std::vector<std::string>::iterator it;
186 it =
std::unique(returnValue.begin(), returnValue.end(), pluginComapreFunc);
200 m_views.front().m_eveWindow->DestroyWindowAndSlot();
206 if (ew ==
i->m_eveWindow) {
const CategoryToInfos & categoryToInfos() const
Color_t background() const
FWColorManager * colorManager() const
vViews_t::iterator vViews_i
static std::string viewNameFrom(const std::string &iFull)
std::vector< std::string > findViewersFor(const std::string &) const
unsigned int proximity() const
measures how 'close' this representation is to the type in question, the large the number the farther...
void eveWindowDestroyed(TEveWindow *)
U second(std::pair< T, U > const &p)
std::map< std::string, std::vector< std::string > > m_typeToViewers
def unique(seq, keepstr=True)
bool getHidePFBuilders() const
fireworks::Context * m_context
ViewFrame(TEveCompositeFrameInMainFrame *f, std::unique_ptr< FWDetailViewBase > v, TEveWindow *w)
FWJobMetadataManager * metadataManager() const
std::vector< std::string > detailViewsFor(const FWModelId &) const
void openDetailViewFor(const FWModelId &, const std::string &)
const TClass * modelType() const
FWDetailViewManager(fireworks::Context *)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
sigc::signal< void > colorsHaveChanged_
static PluginManager * get()
virtual ~FWDetailViewManager()
const FWEventItem * item() const
FWRepresentationInfo infoFor(const std::string &iTypeName) const override