CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
FWGLEventHandler Class Reference

#include <FWGLEventHandler.h>

Inheritance diagram for FWGLEventHandler:

Public Member Functions

 FWGLEventHandler (TGWindow *w, TObject *obj, TEveCaloLego *l=nullptr)
 
Bool_t HandleButton (Event_t *event) override
 
Bool_t HandleCrossing (Event_t *event) override
 
Bool_t HandleFocusChange (Event_t *event) override
 
Bool_t HandleKey (Event_t *event) override
 
void PopupContextMenu (TGLPhysicalShape *pshp, Event_t *event, Int_t gx, Int_t gy) override
 
void setViewer (FWEveView *ev)
 
 ~FWGLEventHandler () override
 

Public Attributes

sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
 

Private Member Functions

 FWGLEventHandler (const FWGLEventHandler &)=delete
 
const FWGLEventHandleroperator= (const FWGLEventHandler &)=delete
 

Private Attributes

FWEveViewm_viewer
 

Detailed Description

Definition at line 11 of file FWGLEventHandler.h.

Constructor & Destructor Documentation

FWGLEventHandler::FWGLEventHandler ( TGWindow *  w,
TObject *  obj,
TEveCaloLego *  l = nullptr 
)

Definition at line 16 of file FWGLEventHandler.cc.

Referenced by setViewer().

16  :
17  TEveLegoEventHandler(w, obj, l),
18  m_viewer(nullptr)
19 {}
const double w
Definition: UKUtility.cc:23
FWEveView * m_viewer
FWGLEventHandler::~FWGLEventHandler ( )
inlineoverride
FWGLEventHandler::FWGLEventHandler ( const FWGLEventHandler )
privatedelete

Member Function Documentation

Bool_t FWGLEventHandler::HandleButton ( Event_t *  event)
override

Definition at line 53 of file FWGLEventHandler.cc.

References m_viewer, FWEveView::requestGLHandlerPick(), FW3DViewBase::setCurrentDMTVertex(), findQualityFiles::v, x, and y.

Referenced by ~FWGLEventHandler().

54 {
55  Bool_t res = TEveLegoEventHandler::HandleButton(event);
56  if (m_viewer && m_viewer->requestGLHandlerPick() && event->fType == kButtonPress )
57  {
58  Int_t x, y;
59  Window_t childdum;
60  gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(), fGLViewer->GetGLWidget()->GetId(),event->fX, event->fY, x, y, childdum); fGLViewer->RequestSelect(event->fX, event->fY);
61  if (fGLViewer->GetSelRec().GetN() > 0 )
62  {
63  TGLVector3 v(event->fX, event->fY, 0.5*fGLViewer->GetSelRec().GetMinZ());
64  fGLViewer->CurrentCamera().WindowToViewport(v);
65  v = fGLViewer->CurrentCamera().ViewportToWorld(v);
66  FW3DViewBase* v3d = dynamic_cast<FW3DViewBase*>(m_viewer);
67  v3d->setCurrentDMTVertex(v.X(), v.Y(), v.Z());
68  }
69  }
70 
71  return res;
72 }
virtual bool requestGLHandlerPick() const
Definition: FWEveView.h:95
FWEveView * m_viewer
void setCurrentDMTVertex(double x, double y, double z)
Definition: Electron.h:6
Definition: event.py:1
Bool_t FWGLEventHandler::HandleCrossing ( Event_t *  event)
override

Definition at line 112 of file FWGLEventHandler.cc.

References m_viewer, and FWEveView::viewer().

Referenced by ~FWGLEventHandler().

113 {
114  // Handle generic Event_t type 'event' - provided to catch focus changes
115  // and terminate any interaction in viewer.
116 
117  if (m_viewer && m_viewer->viewer() && event->fType == kLeaveNotify)
118  TEveGedEditor::ElementChanged(m_viewer->viewer());
119 
120  return TGLEventHandler::HandleCrossing(event);
121 }
FWEveView * m_viewer
TEveViewer * viewer()
Definition: FWEveView.cc:196
Definition: event.py:1
Bool_t FWGLEventHandler::HandleFocusChange ( Event_t *  event)
override

Definition at line 100 of file FWGLEventHandler.cc.

References m_viewer, and FWEveView::viewer().

Referenced by ~FWGLEventHandler().

101 {
102  // Handle generic Event_t type 'event' - provided to catch focus changes
103  // and terminate any interaction in viewer.
104 
105  if (m_viewer && m_viewer->viewer() && event->fType == kFocusOut)
106  TEveGedEditor::ElementChanged(m_viewer->viewer());
107 
108  return TGLEventHandler::HandleFocusChange(event);
109 }
FWEveView * m_viewer
TEveViewer * viewer()
Definition: FWEveView.cc:196
Definition: event.py:1
Bool_t FWGLEventHandler::HandleKey ( Event_t *  event)
override

Definition at line 74 of file FWGLEventHandler.cc.

References event(), m_viewer, PopupContextMenu(), tmp, x, and y.

Referenced by ~FWGLEventHandler().

75 {
76  UInt_t keysym;
77  char tmp[2];
78  gVirtualX->LookupString(event, tmp, sizeof(tmp), keysym);
79 
80  if (m_viewer && (keysym == kKey_Enter || keysym == kKey_Return || keysym == kKey_Space))
81  {
82  if (event->fType == kGKeyPress)
83  {
84  Int_t x, y;
85  Window_t childdum;
86  gVirtualX->TranslateCoordinates(fGLViewer->GetGLWidget()->GetId(), gClient->GetDefaultRoot()->GetId(),
87  event->fX, event->fY, x, y, childdum);
88 
89  fGLViewer->RequestSelect(event->fX, event->fY);
90  PopupContextMenu(fGLViewer->GetSelRec().GetPhysShape(), event, x, y);
91  }
92  return kTRUE;
93  }
94  else {
95  return TEveLegoEventHandler::HandleKey(event);
96 
97  }
98 }
void PopupContextMenu(TGLPhysicalShape *pshp, Event_t *event, Int_t gx, Int_t gy) override
FWEveView * m_viewer
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
Definition: event.py:1
const FWGLEventHandler& FWGLEventHandler::operator= ( const FWGLEventHandler )
privatedelete

Referenced by setViewer().

void FWGLEventHandler::PopupContextMenu ( TGLPhysicalShape *  pshp,
Event_t *  event,
Int_t  gx,
Int_t  gy 
)
override

Definition at line 23 of file FWGLEventHandler.cc.

References FWGeoTopNodeGLScene::GeoPopupMenu(), m_viewer, and openSelectedModelContextMenu_.

Referenced by HandleKey(), and ~FWGLEventHandler().

24 {
25  // Popup context menu.
26 
27  if (event->fState & kKeyShiftMask && event->fState & kKeyControlMask)
28  {
29  TGLEventHandler::PopupContextMenu(pshp, event, gx, gy);
30  return;
31  }
32 
33  if (m_viewer && pshp)
34  {
35  SelectForClicked(event);
36 
37  if (pshp->GetLogical())
38  {
39  FWGeoTopNodeGLScene* js = dynamic_cast<FWGeoTopNodeGLScene*>(pshp->GetLogical()->GetScene());
40  if (js) {
41  js->GeoPopupMenu(gx, gy, fGLViewer);
42  return;
43  }
44  }
45 
47  }
48 }
void GeoPopupMenu(Int_t gx, Int_t gy, TGLViewer *)
FWEveView * m_viewer
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
Definition: event.py:1
void FWGLEventHandler::setViewer ( FWEveView ev)
inline

Definition at line 28 of file FWGLEventHandler.h.

References ev, FWGLEventHandler(), m_viewer, and operator=().

Referenced by FWEveView::FWEveView().

28 { m_viewer = ev; }
FWEveView * m_viewer
bool ev

Member Data Documentation

FWEveView* FWGLEventHandler::m_viewer
private
sigc::signal<void,Int_t,Int_t> FWGLEventHandler::openSelectedModelContextMenu_

Definition at line 26 of file FWGLEventHandler.h.

Referenced by FWEveView::FWEveView(), and PopupContextMenu().