14 #include <boost/bind.hpp>
21 #include "TEveManager.h"
22 #include "TEveWindowManager.h"
23 #include "TEveWindow.h"
42 return iFull.substr(first+1,second-first-1);
49 m_colorManager(colMng)
52 gROOT->SetStyle(
"Plain");
55 gEve->GetWindowManager()->Connect(
"WindowDeleted(TEveWindow*)",
"FWDetailViewManager",
this,
"eveWindowDestroyed(TEveWindow*)");
61 gEve->GetWindowManager()->Disconnect(
"WindowDeleted(TEveWindow*)",
this,
"eveWindowDestroyed(TEveWindow*)" );
67 TEveWindowSlot* slot = TEveWindow::CreateWindowMainFrame();
68 TEveCompositeFrameInMainFrame* eveFrame = (TEveCompositeFrameInMainFrame*)slot->GetEveFrame();
73 if(0==viewerNames.size()) {
75 "use for object " <<
id.item()->name() << std::endl;
76 assert(0!=viewerNames.size());
81 for(std::vector<std::string>::iterator it = viewerNames.begin(), itEnd = viewerNames.end(); it != itEnd; ++it) {
89 assert(match.size() != 0);
91 assert(0!=detailView);
93 TEveWindowSlot* ws = (TEveWindowSlot*)(eveFrame->GetEveWindow());
95 detailView->build(
id);
98 TGMainFrame* mf = (TGMainFrame*)(eveFrame->GetParent());
99 mf->SetWindowName(Form(
"%s Detail View [%d]",
id.item()->
name().c_str(),
id.
index()));
101 m_views.push_back(
ViewFrame(eveFrame, detailView, eveFrame->GetEveWindow()));
106 std::vector<std::string>
111 std::vector<std::string> justViewNames;
112 justViewNames.reserve(fullNames.size());
114 return justViewNames;
117 std::vector<std::string>
120 std::vector<std::string> returnValue;
122 std::map<std::string,std::vector<std::string> >::const_iterator itFind =
m_typeToViewers.find(iType);
124 return itFind->second;
127 std::set<std::string> detailViews;
132 std::inserter(detailViews,detailViews.begin()),
134 unsigned int closestMatch= 0xFFFFFFFF;
135 for(std::set<std::string>::iterator it = detailViews.begin(), itEnd=detailViews.end();
149 returnValue.push_back(*it);
169 m_views.front().m_eveWindow->DestroyWindowAndSlot();
178 if (ew ==
i->m_eveWindow)
181 delete i->m_detailView;
FWDetailViewManager(FWColorManager *)
virtual FWRepresentationInfo infoFor(const std::string &iTypeName) const
Color_t background() 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
FWColorManager * m_colorManager
std::vector< std::string > detailViewsFor(const FWModelId &) const
void openDetailViewFor(const FWModelId &, const std::string &)
const TClass * modelType() const
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)