CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Member Functions

FWGLEventHandler Class Reference

#include <FWGLEventHandler.h>

List of all members.

Public Member Functions

 FWGLEventHandler (TGWindow *w, TObject *obj, TEveCaloLego *l=0)
virtual Bool_t HandleKey (Event_t *event)
virtual void PopupContextMenu (TGLPhysicalShape *pshp, Event_t *event, Int_t gx, Int_t gy)
virtual ~FWGLEventHandler ()

Public Attributes

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

Private Member Functions

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

Detailed Description

Definition at line 10 of file FWGLEventHandler.h.


Constructor & Destructor Documentation

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

Definition at line 10 of file FWGLEventHandler.cc.

                                                                            :
   TEveLegoEventHandler(w, obj, l)
{
}
virtual FWGLEventHandler::~FWGLEventHandler ( ) [inline, virtual]

Definition at line 14 of file FWGLEventHandler.h.

{}
FWGLEventHandler::FWGLEventHandler ( const FWGLEventHandler ) [private]

Member Function Documentation

Bool_t FWGLEventHandler::HandleKey ( Event_t *  event) [virtual]

Definition at line 34 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 16 of file FWGLEventHandler.cc.

References openSelectedModelContextMenu_.

Referenced by HandleKey().

{
   // Popup context menu.

  
   if (event->fState & kKeyShiftMask && event->fState & kKeyControlMask)
   {
      TGLEventHandler::PopupContextMenu(pshp, event, gx, gy);
      return;
   }

   if (pshp)
   {
      SelectForClicked(event);
      openSelectedModelContextMenu_(gx,gy);
   }
}

Member Data Documentation

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

Definition at line 20 of file FWGLEventHandler.h.

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