CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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=0)
 
virtual Bool_t HandleCrossing (Event_t *event)
 
virtual Bool_t HandleFocusChange (Event_t *event)
 
virtual Bool_t HandleKey (Event_t *event)
 
virtual void PopupContextMenu (TGLPhysicalShape *pshp, Event_t *event, Int_t gx, Int_t gy)
 
void setViewer (TEveViewer *ev)
 
virtual ~FWGLEventHandler ()
 

Public Attributes

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

Private Member Functions

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

Private Attributes

TEveViewer * m_viewer
 

Detailed Description

Definition at line 11 of file FWGLEventHandler.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file FWGLEventHandler.cc.

13  :
14  TEveLegoEventHandler(w, obj, l),
15  m_viewer(0)
16 {}
TEveViewer * m_viewer
T w() const
virtual FWGLEventHandler::~FWGLEventHandler ( )
inlinevirtual

Definition at line 15 of file FWGLEventHandler.h.

15 {}
FWGLEventHandler::FWGLEventHandler ( const FWGLEventHandler )
private

Member Function Documentation

Bool_t FWGLEventHandler::HandleCrossing ( Event_t *  event)
virtual

Definition at line 84 of file FWGLEventHandler.cc.

References m_viewer.

85 {
86  // Handle generic Event_t type 'event' - provided to catch focus changes
87  // and terminate any interaction in viewer.
88 
89  if (m_viewer && event->fType == kLeaveNotify)
90  TEveGedEditor::ElementChanged(m_viewer);
91 
92  return TGLEventHandler::HandleCrossing(event);
93 }
TEveViewer * 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
Bool_t FWGLEventHandler::HandleFocusChange ( Event_t *  event)
virtual

Definition at line 72 of file FWGLEventHandler.cc.

References m_viewer.

73 {
74  // Handle generic Event_t type 'event' - provided to catch focus changes
75  // and terminate any interaction in viewer.
76 
77  if (m_viewer && event->fType == kFocusOut)
78  TEveGedEditor::ElementChanged(m_viewer);
79 
80  return TGLEventHandler::HandleFocusChange(event);
81 }
TEveViewer * 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
Bool_t FWGLEventHandler::HandleKey ( Event_t *  event)
virtual

Definition at line 46 of file FWGLEventHandler.cc.

References event(), PopupContextMenu(), tmp, x, and detailsBasic3DVector::y.

47 {
48  UInt_t keysym;
49  char tmp[2];
50  gVirtualX->LookupString(event, tmp, sizeof(tmp), keysym);
51 
52  if (keysym == kKey_Enter || keysym == kKey_Return || keysym == kKey_Space)
53  {
54  if (event->fType == kGKeyPress)
55  {
56  Int_t x, y;
57  Window_t childdum;
58  gVirtualX->TranslateCoordinates(fGLViewer->GetGLWidget()->GetId(), gClient->GetDefaultRoot()->GetId(),
59  event->fX, event->fY, x, y, childdum);
60 
61  fGLViewer->RequestSelect(event->fX, event->fY);
62  PopupContextMenu(fGLViewer->GetSelRec().GetPhysShape(), event, x, y);
63  }
64  return kTRUE;
65  }
66  else
67  {
68  return TEveLegoEventHandler::HandleKey(event);
69  }
70 }
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
unsigned int UInt_t
Definition: FUTypes.h:12
virtual void PopupContextMenu(TGLPhysicalShape *pshp, Event_t *event, Int_t gx, Int_t gy)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
Definition: DDAxes.h:10
const FWGLEventHandler& FWGLEventHandler::operator= ( const FWGLEventHandler )
private
void FWGLEventHandler::PopupContextMenu ( TGLPhysicalShape *  pshp,
Event_t *  event,
Int_t  gx,
Int_t  gy 
)
virtual

Definition at line 19 of file FWGLEventHandler.cc.

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

Referenced by HandleKey().

20 {
21  // Popup context menu.
22 
23  if (event->fState & kKeyShiftMask && event->fState & kKeyControlMask)
24  {
25  TGLEventHandler::PopupContextMenu(pshp, event, gx, gy);
26  return;
27  }
28 
29  if (pshp)
30  {
31  SelectForClicked(event);
32 
33  if (pshp->GetLogical())
34  {
35  FWGeoTopNodeGLScene* js = dynamic_cast<FWGeoTopNodeGLScene*>(pshp->GetLogical()->GetScene());
36  if (js) {
37  js->GeoPopupMenu(gx, gy, m_viewer->GetGLViewer());
38  return;
39  }
40  }
41 
43  }
44 }
void GeoPopupMenu(Int_t gx, Int_t gy, TGLViewer *)
TEveViewer * 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
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
void FWGLEventHandler::setViewer ( TEveViewer *  ev)
inline

Definition at line 26 of file FWGLEventHandler.h.

References m_viewer.

Referenced by FWEveView::FWEveView().

26 { m_viewer = ev; }
TEveViewer * m_viewer

Member Data Documentation

TEveViewer* FWGLEventHandler::m_viewer
private

Definition at line 32 of file FWGLEventHandler.h.

Referenced by HandleCrossing(), HandleFocusChange(), PopupContextMenu(), and setViewer().

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

Definition at line 24 of file FWGLEventHandler.h.

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