CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
FWGeometryTableViewBase::FWViewCombo Class Reference

#include <FWGeometryTableViewBase.h>

Inheritance diagram for FWGeometryTableViewBase::FWViewCombo:

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
 
FWGeometryTableViewBasem_tableView
 

Detailed Description

Definition at line 50 of file FWGeometryTableViewBase.h.

Constructor & Destructor Documentation

FWGeometryTableViewBase::FWViewCombo::FWViewCombo ( const TGWindow *  p,
FWGeometryTableViewBase t 
)
inline

Definition at line 56 of file FWGeometryTableViewBase.h.

56  :
57  TGTextButton(p, "Select Views", -1, TGButton::GetDefaultGC()(), TGTextButton::GetDefaultFontStruct(), kRaisedFrame | kDoubleBorder ), m_tableView(t), m_el(0) {}
virtual FWGeometryTableViewBase::FWViewCombo::~FWViewCombo ( )
inlinevirtual

Definition at line 58 of file FWGeometryTableViewBase.h.

58 {}

Member Function Documentation

Bool_t FWGeometryTableViewBase::FWViewCombo::HandleButton ( Event_t *  event)
virtual

Definition at line 51 of file FWGeometryTableViewBase.cc.

References create_public_lumi_plots::ax, FWGeometryTableManagerBase::cancelEditor(), fwLog, FWGeometryTableViewBase::getTableManager(), training_settings::idx, fwlog::kInfo, m_el, m_tableView, genParticles_cff::map, AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::s, and findQualityFiles::v.

Referenced by setElement().

52 {
53  if (event->fType == kButtonPress)
54  {
55  bool map = false;
56 
57  FWPopupMenu* m_viewPopup = new FWPopupMenu(0);
58 
59  TEveElementList* views = gEve->GetViewers();
60  int idx = 0;
61 
62  for (TEveElement::List_i it = views->BeginChildren(); it != views->EndChildren(); ++it)
63  {
64  TEveViewer* v = ((TEveViewer*)(*it));
65  if (strstr( v->GetElementName(), "3D") )
66  {
67  bool added = false;
68  m_viewPopup->AddEntry(v->GetElementName(), idx);
69 
70  for (TEveElement::List_i eit = v->BeginChildren(); eit != v->EndChildren(); ++eit )
71  {
72  TEveScene* s = ((TEveSceneInfo*)*eit)->GetScene();
73  if (m_el && s->HasChildren() && s->FirstChild() == m_el) {
74  added = true;
75  break;
76  }
77  }
78  map = true;
79  if (added)
80  m_viewPopup->CheckEntry(idx);
81  }
82  ++idx;
83  }
84 
85  if (map) {
86 
87  Window_t wdummy;
88  Int_t ax,ay;
89  gVirtualX->TranslateCoordinates(GetId(),
90  gClient->GetDefaultRoot()->GetId(),
91  event->fX, event->fY, //0,0 in local coordinates
92  ax,ay, //coordinates of screen
93  wdummy);
94 
95 
96  m_viewPopup->PlaceMenu(ax, ay, true,true);
97  m_viewPopup->Connect("Activated(Int_t)",
98  "FWGeometryTableViewBase",
99  const_cast<FWGeometryTableViewBase*>(m_tableView),
100  "selectView(Int_t)");
101  }
102  else
103  {
104  fwLog(fwlog::kInfo) << "No 3D View added. \n";
105  }
106  }
107  return true;
108 }
#define fwLog(_level_)
Definition: fwLog.h:50
Definition: event.py:1
void FWGeometryTableViewBase::FWViewCombo::setElement ( TEveElement *  x)
inline

Member Data Documentation

TEveElement* FWGeometryTableViewBase::FWViewCombo::m_el
private

Definition at line 54 of file FWGeometryTableViewBase.h.

Referenced by HandleButton().

FWGeometryTableViewBase* FWGeometryTableViewBase::FWViewCombo::m_tableView
private

Definition at line 53 of file FWGeometryTableViewBase.h.

Referenced by HandleButton().