#include <FWGLEventHandler.h>
Public Member Functions | |
FWGLEventHandler (TGWindow *w, TObject *obj, TEveCaloLego *l=0) | |
virtual Bool_t | HandleButton (Event_t *event) |
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 (FWEveView *ev) |
virtual | ~FWGLEventHandler () |
Public Attributes | |
sigc::signal< void, Int_t, Int_t > | openSelectedModelContextMenu_ |
Private Member Functions | |
FWGLEventHandler (const FWGLEventHandler &) | |
const FWGLEventHandler & | operator= (const FWGLEventHandler &) |
Private Attributes | |
FWEveView * | m_viewer |
Definition at line 11 of file FWGLEventHandler.h.
FWGLEventHandler::FWGLEventHandler | ( | TGWindow * | w, |
TObject * | obj, | ||
TEveCaloLego * | l = 0 |
||
) |
virtual FWGLEventHandler::~FWGLEventHandler | ( | ) | [inline, virtual] |
Definition at line 15 of file FWGLEventHandler.h.
{}
FWGLEventHandler::FWGLEventHandler | ( | const FWGLEventHandler & | ) | [private] |
Bool_t FWGLEventHandler::HandleButton | ( | Event_t * | event | ) | [virtual] |
Definition at line 49 of file FWGLEventHandler.cc.
References m_viewer, FWEveView::requestGLHandlerPick(), FW3DViewBase::setCurrentDMTVertex(), findQualityFiles::v, x, and detailsBasic3DVector::y.
{ Bool_t res = TEveLegoEventHandler::HandleButton(event); if (m_viewer->requestGLHandlerPick() && event->fType == kButtonPress ) { Int_t x, y; Window_t childdum; gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(), fGLViewer->GetGLWidget()->GetId(),event->fX, event->fY, x, y, childdum); fGLViewer->RequestSelect(event->fX, event->fY); if (fGLViewer->GetSelRec().GetN() > 0 ) { TGLVector3 v(event->fX, event->fY, 0.5*fGLViewer->GetSelRec().GetMinZ()); fGLViewer->CurrentCamera().WindowToViewport(v); v = fGLViewer->CurrentCamera().ViewportToWorld(v); FW3DViewBase* v3d = dynamic_cast<FW3DViewBase*>(m_viewer); v3d->setCurrentDMTVertex(v.X(), v.Y(), v.Z()); } } return res; }
Bool_t FWGLEventHandler::HandleCrossing | ( | Event_t * | event | ) | [virtual] |
Definition at line 108 of file FWGLEventHandler.cc.
References m_viewer, and FWEveView::viewer().
Bool_t FWGLEventHandler::HandleFocusChange | ( | Event_t * | event | ) | [virtual] |
Definition at line 96 of file FWGLEventHandler.cc.
References m_viewer, and FWEveView::viewer().
Bool_t FWGLEventHandler::HandleKey | ( | Event_t * | event | ) | [virtual] |
Definition at line 70 of file FWGLEventHandler.cc.
References event(), PopupContextMenu(), tmp, x, and detailsBasic3DVector::y.
{ UInt_t keysym; char tmp[2]; gVirtualX->LookupString(event, tmp, sizeof(tmp), keysym); if (keysym == kKey_Enter || keysym == kKey_Return || keysym == kKey_Space) { if (event->fType == kGKeyPress) { Int_t x, y; Window_t childdum; gVirtualX->TranslateCoordinates(fGLViewer->GetGLWidget()->GetId(), gClient->GetDefaultRoot()->GetId(), event->fX, event->fY, x, y, childdum); fGLViewer->RequestSelect(event->fX, event->fY); PopupContextMenu(fGLViewer->GetSelRec().GetPhysShape(), event, x, y); } return kTRUE; } else { return TEveLegoEventHandler::HandleKey(event); } }
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 22 of file FWGLEventHandler.cc.
References FWGeoTopNodeGLScene::GeoPopupMenu(), m_viewer, openSelectedModelContextMenu_, and FWEveView::viewerGL().
Referenced by HandleKey().
{ // Popup context menu. if (event->fState & kKeyShiftMask && event->fState & kKeyControlMask) { TGLEventHandler::PopupContextMenu(pshp, event, gx, gy); return; } if (pshp) { SelectForClicked(event); if (pshp->GetLogical()) { FWGeoTopNodeGLScene* js = dynamic_cast<FWGeoTopNodeGLScene*>(pshp->GetLogical()->GetScene()); if (js) { js->GeoPopupMenu(gx, gy, m_viewer->viewerGL()); return; } } openSelectedModelContextMenu_(gx,gy); } }
void FWGLEventHandler::setViewer | ( | FWEveView * | ev | ) | [inline] |
Definition at line 28 of file FWGLEventHandler.h.
References m_viewer.
Referenced by FWEveView::FWEveView().
{ m_viewer = ev; }
FWEveView* FWGLEventHandler::m_viewer [private] |
Definition at line 34 of file FWGLEventHandler.h.
Referenced by HandleButton(), HandleCrossing(), HandleFocusChange(), PopupContextMenu(), and setViewer().
sigc::signal<void,Int_t,Int_t> FWGLEventHandler::openSelectedModelContextMenu_ |
Definition at line 26 of file FWGLEventHandler.h.
Referenced by FWEveView::FWEveView(), and PopupContextMenu().