ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TGLEventHandler.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Bertrand Bellenot 29/01/2008
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGLEventHandler
13 #define ROOT_TGLEventHandler
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TGLEventHandler //
18 // //
19 //////////////////////////////////////////////////////////////////////////
20 
21 #ifndef ROOT_TGEventHandler
22 #include "TGEventHandler.h"
23 #endif
24 #ifndef ROOT_TPoint
25 #include "TPoint.h"
26 #endif
27 
28 class TGToolTip;
29 
30 class TGLViewer;
31 class TGLPhysicalShape;
32 
34 {
35 protected:
37  TTimer *fMouseTimer; // mouse delay timer
42  TGToolTip *fTooltip; // tooltip for highlight
53  Int_t fSecSelType; // secondary selection type
59 
60  virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2);
61 
62  virtual void GrabMouse();
63  virtual void UnGrabMouse();
64 
65  virtual void SelectForClicked(Event_t *event);
66  virtual void SelectForMouseOver();
67 
69 
70 public:
72  virtual ~TGLEventHandler();
73 
74  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
75  virtual Bool_t HandleEvent(Event_t *event);
76  virtual Bool_t HandleExpose(Event_t * event);
77  virtual Bool_t HandleFocusChange(Event_t *event);
78  virtual Bool_t HandleCrossing(Event_t *event);
79  virtual Bool_t HandleButton(Event_t * event);
80  virtual Bool_t HandleDoubleClick(Event_t *event);
81  virtual Bool_t HandleConfigureNotify(Event_t *event);
82  virtual Bool_t HandleKey(Event_t *event);
83  virtual Bool_t HandleMotion(Event_t * event);
84  virtual Bool_t HandleTimer(TTimer *t);
85  virtual void StartMouseTimer();
86  virtual void StopMouseTimer();
87  virtual void ClearMouseOver();
88  virtual void Repaint();
89 
90  virtual void PopupContextMenu(TGLPhysicalShape* pshp, Event_t *event, Int_t gx, Int_t gy);
91 
92  virtual void TriggerTooltip(const char* text);
93  virtual void RemoveTooltip();
94 
97 
100 
101  Int_t GetSecSelType() const { return fSecSelType; }
103 
106 
107  Bool_t GetArcBall() const { return fArcBall; }
108  void SetArcBall(Bool_t a) { fArcBall = a; }
109 
110  ClassDef(TGLEventHandler, 0); // Base-class and default implementation of event-handler for TGLViewer.
111 };
112 
113 #endif
114 
float Float_t
Definition: RtypesCore.h:53
TGLEventHandler(TGWindow *w, TObject *obj)
Constructor.
Float_t fMouseWheelFactor
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void SelectForMouseOver()
Run selection (optionally with on secondary selection) and emit corresponding MouseOver() signals...
TArc * a
Definition: textangle.C:12
virtual void UnGrabMouse()
Release mouse grab.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Process event of type 'event' - one of EEventType types, occurring at window location px...
void SetArcBall(Bool_t a)
Float_t py
Definition: hprod.C:33
void SetTooltipPixelTolerance(Int_t t)
TTimer * fMouseTimer
Concrete physical shape - a GL drawable.
Int_t ControlValue(Int_t v)
Bool_t fMouseTimerRunning
virtual ~TGLEventHandler()
Destructor.
Bool_t fDoInternalSelection
Double_t x[n]
Definition: legend1.C:17
virtual Bool_t HandleEvent(Event_t *event)
Handle generic Event_t type 'event' - provided to catch focus changes and terminate any interaction i...
void SetDoInternalSelection(Bool_t x)
void SetMouseOverTooltipDelay(Int_t ms)
Set delay of tooltip timer.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion 'event'.
virtual void GrabMouse()
Acquire mouse grab.
Definition: TPoint.h:33
virtual void StopMouseTimer()
Make sure mouse timers are not running.
virtual void PopupContextMenu(TGLPhysicalShape *pshp, Event_t *event, Int_t gx, Int_t gy)
Popup context menu.
TThread * t[5]
Definition: threadsh1.C:13
ClassDef(TGLEventHandler, 0)
void SetMouseOverSelectDelay(Int_t ms)
Set delay of mouse-over probe (highlight).
TGLViewer * fGLViewer
virtual Bool_t HandleTimer(TTimer *t)
If mouse delay timer times out emit signal.
Float_t fArrowKeyFactor
SVector< double, 2 > v
Definition: Dict.h:5
virtual Bool_t HandleFocusChange(Event_t *event)
Handle generic Event_t type 'event' - provided to catch focus changes and terminate any interaction i...
unsigned int UInt_t
Definition: RtypesCore.h:42
TGToolTip * fTooltip
tuple w
Definition: qtexample.py:51
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:57
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition: TGLViewer.h:53
Bool_t GetDoInternalSelection() const
Int_t fTooltipPixelTolerance
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle mouse double click 'event'.
TGLPhysicalShape * fLastMouseOverShape
virtual void TriggerTooltip(const char *text)
Trigger display of tooltip.
virtual void ClearMouseOver()
Clear mouse-over state and emit mouse-over signals.
Int_t GetTooltipPixelTolerance() const
TText * text
Base-class and default implementation of event-handler for TGLViewer.
Int_t GetSecSelType() const
Mother of all ROOT objects.
Definition: TObject.h:58
Float_t px
Definition: hprod.C:33
virtual Bool_t HandleCrossing(Event_t *event)
Handle generic Event_t type 'event' - provided to catch focus changes and terminate any interaction i...
Bool_t GetArcBall() const
virtual void SelectForClicked(Event_t *event)
Run selection (optionally with on secondary selection) and emit corresponding Clicked() signals...
virtual Bool_t HandleExpose(Event_t *event)
Handle window expose 'event' - show.
TPoint fLastMouseOverPos
void SetSecSelType(Int_t t)
virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Method to handle action TGLViewer::kDragCameraRotate.
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handle configure notify 'event' - a window resize/movement.
virtual void StartMouseTimer()
Start mouse timer in single-shot mode.
TObject * obj
Bool_t fViewerCentricControls
Float_t fMouseDragFactor
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button 'event'.
virtual void RemoveTooltip()
Hide the tooltip.
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard 'event'.
virtual void Repaint()
Handle window expose 'event' - show.