14 #include <boost/bind.hpp>
22 #include "TEveManager.h"
23 #include "TEveWindowManager.h"
24 #include "TEveWindow.h"
47 return iFull.substr(first+1,second-first-1);
56 gROOT->SetStyle(
"Plain");
59 gEve->GetWindowManager()->Connect(
"WindowDeleted(TEveWindow*)",
"FWDetailViewManager",
this,
"eveWindowDestroyed(TEveWindow*)");
65 gEve->GetWindowManager()->Disconnect(
"WindowDeleted(TEveWindow*)",
this,
"eveWindowDestroyed(TEveWindow*)" );
72 TEveWindowSlot* slot = TEveWindow::CreateWindowMainFrame();
73 TEveCompositeFrameInMainFrame* eveFrame = (TEveCompositeFrameInMainFrame*)slot->GetEveFrame();
78 if(0==viewerNames.size()) {
80 "use for object " <<
id.item()->name() << std::endl;
81 assert(0!=viewerNames.size());
86 for(std::vector<std::string>::iterator it = viewerNames.begin(), itEnd = viewerNames.end(); it != itEnd; ++it) {
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.push_back(
ViewFrame(eveFrame, detailView, eveFrame->GetEveWindow()));
111 std::vector<std::string>
116 std::vector<std::string> justViewNames;
117 justViewNames.reserve(fullNames.size());
119 return justViewNames;
131 std::vector<std::string>
135 std::vector<std::string> returnValue;
137 std::map<std::string,std::vector<std::string> >::const_iterator itFind =
m_typeToViewers.find(iType);
139 return itFind->second;
142 std::set<std::string> detailViews;
147 std::inserter(detailViews,detailViews.begin()),
149 unsigned int closestMatch= 0xFFFFFFFF;
152 for(std::set<std::string>::iterator it = detailViews.begin(), itEnd=detailViews.end();
157 std::size_t
found = it->find(
"PF ");
158 if (found != std::string::npos)
171 if(firstD != std::string::npos) {
172 std::stringstream
ss(it->substr(firstD));
174 while(std::getline(
ss, ml,
'&')) {
176 fwLog(
fwlog::kDebug) <<
"DetailView "<< *it <<
" requires module label " << ml << std::endl;
183 returnValue.push_back(*it);
188 vn.insert(++first,
"!");
189 returnValue.push_back(vn);
194 std::vector<std::string>::iterator it;
195 it =
std::unique (returnValue.begin(), returnValue.end(), pluginComapreFunc);
215 m_views.front().m_eveWindow->DestroyWindowAndSlot();
224 if (ew ==
i->m_eveWindow)
227 delete i->m_detailView;
virtual FWRepresentationInfo infoFor(const std::string &iTypeName) 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
bool getHidePFBuilders() const
fireworks::Context * m_context
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_
virtual ~FWDetailViewManager()
const FWEventItem * item() const
T get(const Candidate &c)