#include <FWGeometryTableViewBase.h>
Public Member Functions | |
FWViewCombo (const TGWindow *p, FWGeometryTableViewBase *t) | |
virtual Bool_t | HandleButton (Event_t *event) |
void | setElement (TEveElement *x) |
virtual | ~FWViewCombo () |
Private Attributes | |
TEveElement * | m_el |
FWGeometryTableViewBase * | m_tableView |
Definition at line 51 of file FWGeometryTableViewBase.h.
FWGeometryTableViewBase::FWViewCombo::FWViewCombo | ( | const TGWindow * | p, |
FWGeometryTableViewBase * | t | ||
) | [inline] |
Definition at line 57 of file FWGeometryTableViewBase.h.
: TGTextButton(p, "Select Views", -1, TGButton::GetDefaultGC()(), TGTextButton::GetDefaultFontStruct(), kRaisedFrame | kDoubleBorder ), m_tableView(t), m_el(0) {}
virtual FWGeometryTableViewBase::FWViewCombo::~FWViewCombo | ( | ) | [inline, virtual] |
Definition at line 59 of file FWGeometryTableViewBase.h.
{}
Bool_t FWGeometryTableViewBase::FWViewCombo::HandleButton | ( | Event_t * | event | ) | [virtual] |
Definition at line 51 of file FWGeometryTableViewBase.cc.
References lumiQTWidget::ax, fwLog, UserOptions_cff::idx, fwlog::kInfo, m_el, m_tableView, Association::map, alignCSCRings::s, and v.
{ if (event->fType == kButtonPress) { bool map = false; FWPopupMenu* m_viewPopup = new FWPopupMenu(0); TEveElementList* views = gEve->GetViewers(); int idx = 0; for (TEveElement::List_i it = views->BeginChildren(); it != views->EndChildren(); ++it) { TEveViewer* v = ((TEveViewer*)(*it)); if (strstr( v->GetElementName(), "3D") ) { bool added = false; m_viewPopup->AddEntry(v->GetElementName(), idx); for (TEveElement::List_i eit = v->BeginChildren(); eit != v->EndChildren(); ++eit ) { TEveScene* s = ((TEveSceneInfo*)*eit)->GetScene(); if (m_el && s->HasChildren() && s->FirstChild() == m_el) { added = true; break; } } map = true; if (added) m_viewPopup->CheckEntry(idx); } ++idx; } if (map) { Window_t wdummy; Int_t ax,ay; gVirtualX->TranslateCoordinates(GetId(), gClient->GetDefaultRoot()->GetId(), event->fX, event->fY, //0,0 in local coordinates ax,ay, //coordinates of screen wdummy); m_viewPopup->PlaceMenu(ax, ay, true,true); m_viewPopup->Connect("Activated(Int_t)", "FWGeometryTableViewBase", const_cast<FWGeometryTableViewBase*>(m_tableView), "selectView(Int_t)"); } else { fwLog(fwlog::kInfo) << "No 3D View added. \n"; } } return true; }
void FWGeometryTableViewBase::FWViewCombo::setElement | ( | TEveElement * | x | ) | [inline] |
Definition at line 60 of file FWGeometryTableViewBase.h.
Referenced by FWGeometryTableViewBase::populate3DViewsFromConfig(), and FWGeometryTableViewBase::selectView().
TEveElement* FWGeometryTableViewBase::FWViewCombo::m_el [private] |
Definition at line 55 of file FWGeometryTableViewBase.h.
Referenced by HandleButton(), and setElement().
Definition at line 54 of file FWGeometryTableViewBase.h.
Referenced by HandleButton().