22 #include "TEveManager.h"
23 #include "TEveWindowManager.h"
24 #include "TEveWindow.h"
26 #include "TObjString.h"
46 return iFull.substr(first + 1, second - first - 1);
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)
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) {
const CategoryToInfos & categoryToInfos() const
Color_t background() const
static const char category[]
FWRepresentationInfo infoFor(const std::string &iTypeName) const override
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
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