Logo ROOT  
Reference Guide
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 #include "TGEventHandler.h"
22 #include "TPoint.h"
23 
24 class TGToolTip;
25 
26 class TGLViewer;
27 class TGLPhysicalShape;
28 
30 {
31 protected:
33  TTimer *fMouseTimer; // mouse delay timer
38  TGToolTip *fTooltip; // tooltip for highlight
49  Int_t fSecSelType; // secondary selection type
55 
56  virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2);
57 
58  virtual void GrabMouse();
59  virtual void UnGrabMouse();
60 
61  virtual void SelectForClicked(Event_t *event);
62  virtual void SelectForMouseOver();
63 
65 
66 public:
68  virtual ~TGLEventHandler();
69 
70  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
71  virtual Bool_t HandleEvent(Event_t *event);
72  virtual Bool_t HandleExpose(Event_t * event);
73  virtual Bool_t HandleFocusChange(Event_t *event);
74  virtual Bool_t HandleCrossing(Event_t *event);
75  virtual Bool_t HandleButton(Event_t * event);
76  virtual Bool_t HandleDoubleClick(Event_t *event);
77  virtual Bool_t HandleConfigureNotify(Event_t *event);
78  virtual Bool_t HandleKey(Event_t *event);
79  virtual Bool_t HandleMotion(Event_t * event);
80  virtual Bool_t HandleTimer(TTimer *t);
81  virtual void StartMouseTimer();
82  virtual void StopMouseTimer();
83  virtual void ClearMouseOver();
84  virtual void Repaint();
85 
86  virtual void PopupContextMenu(TGLPhysicalShape* pshp, Event_t *event, Int_t gx, Int_t gy);
87 
88  virtual void TriggerTooltip(const char* text);
89  virtual void RemoveTooltip();
90 
93 
96 
97  Int_t GetSecSelType() const { return fSecSelType; }
98  void SetSecSelType(Int_t t) { fSecSelType = t; }
99 
102 
103  Bool_t GetArcBall() const { return fArcBall; }
104  void SetArcBall(Bool_t a) { fArcBall = a; }
105 
106  ClassDef(TGLEventHandler, 0); // Base-class and default implementation of event-handler for TGLViewer.
107 };
108 
109 #endif
110 
TGLEventHandler::SetSecSelType
void SetSecSelType(Int_t t)
Definition: TGLEventHandler.h:98
TGEventHandler.h
TGWindow
Definition: TGWindow.h:31
TGLEventHandler::fActiveButtonID
UInt_t fActiveButtonID
Definition: TGLEventHandler.h:41
TGLEventHandler::SetArcBall
void SetArcBall(Bool_t a)
Definition: TGLEventHandler.h:104
TGLEventHandler::RemoveTooltip
virtual void RemoveTooltip()
Hide the tooltip.
Definition: TGLEventHandler.cxx:1116
TGLEventHandler::HandleDoubleClick
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle mouse double click 'event'.
Definition: TGLEventHandler.cxx:671
TGLEventHandler::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion 'event'.
Definition: TGLEventHandler.cxx:889
TGLEventHandler::Repaint
virtual void Repaint()
Handle window expose 'event' - show.
Definition: TGLEventHandler.cxx:1047
TGLEventHandler::fInPointerGrab
Bool_t fInPointerGrab
Definition: TGLEventHandler.h:44
TGLEventHandler::GetArcBall
Bool_t GetArcBall() const
Definition: TGLEventHandler.h:103
TGLEventHandler::fArrowKeyFactor
Float_t fArrowKeyFactor
Definition: TGLEventHandler.h:52
TGLEventHandler::fLastEventState
UInt_t fLastEventState
Definition: TGLEventHandler.h:42
TGLEventHandler::fSecSelType
Int_t fSecSelType
Definition: TGLEventHandler.h:49
TGLEventHandler::fTooltip
TGToolTip * fTooltip
Definition: TGLEventHandler.h:38
TGLEventHandler::HandleKey
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard 'event'.
Definition: TGLEventHandler.cxx:745
Float_t
float Float_t
Definition: RtypesCore.h:57
TGLEventHandler::SelectForMouseOver
virtual void SelectForMouseOver()
Run selection (optionally with on secondary selection) and emit corresponding MouseOver() signals.
Definition: TGLEventHandler.cxx:169
Int_t
int Int_t
Definition: RtypesCore.h:45
TGLEventHandler::SetMouseOverTooltipDelay
void SetMouseOverTooltipDelay(Int_t ms)
Set delay of tooltip timer.
Definition: TGLEventHandler.cxx:1133
TGLEventHandler::fButtonPushPos
TPoint fButtonPushPos
Definition: TGLEventHandler.h:34
TGLEventHandler::fArcBall
Bool_t fArcBall
Definition: TGLEventHandler.h:47
x
Double_t x[n]
Definition: legend1.C:17
TGToolTip
Definition: TGToolTip.h:35
TGLEventHandler::ClearMouseOver
virtual void ClearMouseOver()
Clear mouse-over state and emit mouse-over signals.
Definition: TGLEventHandler.cxx:1033
TGLEventHandler::GrabMouse
virtual void GrabMouse()
Acquire mouse grab.
Definition: TGLEventHandler.cxx:99
TGLEventHandler::PopupContextMenu
virtual void PopupContextMenu(TGLPhysicalShape *pshp, Event_t *event, Int_t gx, Int_t gy)
Popup context menu.
Definition: TGLEventHandler.cxx:1062
TGLEventHandler::SetDoInternalSelection
void SetDoInternalSelection(Bool_t x)
Definition: TGLEventHandler.h:101
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
v
@ v
Definition: rootcling_impl.cxx:3635
text
TText * text
Definition: entrylist_figure1.C:10
bool
TGLEventHandler::UnGrabMouse
virtual void UnGrabMouse()
Release mouse grab.
Definition: TGLEventHandler.cxx:113
TGLEventHandler::SetTooltipPixelTolerance
void SetTooltipPixelTolerance(Int_t t)
Definition: TGLEventHandler.h:95
TTimer
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
TGLViewer
Base GL viewer object - used by both standalone and embedded (in pad) GL.
Definition: TGLViewer.h:55
TGLEventHandler::SelectForClicked
virtual void SelectForClicked(Event_t *event)
Run selection (optionally with on secondary selection) and emit corresponding Clicked() signals.
Definition: TGLEventHandler.cxx:127
TGLEventHandler::fTooltipPixelTolerance
Int_t fTooltipPixelTolerance
Definition: TGLEventHandler.h:48
TGLEventHandler::fMouseTimer
TTimer * fMouseTimer
Definition: TGLEventHandler.h:33
TGLEventHandler::fDoInternalSelection
Bool_t fDoInternalSelection
Definition: TGLEventHandler.h:50
TGLEventHandler::HandleExpose
virtual Bool_t HandleExpose(Event_t *event)
Handle window expose 'event' - show.
Definition: TGLEventHandler.cxx:726
a
auto * a
Definition: textangle.C:12
TGLEventHandler::TGLEventHandler
TGLEventHandler(TGWindow *w, TObject *obj)
Constructor.
Definition: TGLEventHandler.cxx:58
TGLEventHandler::fLastPos
TPoint fLastPos
Definition: TGLEventHandler.h:35
TGLEventHandler::fLastMouseOverPos
TPoint fLastMouseOverPos
Definition: TGLEventHandler.h:36
TGLEventHandler::HandleCrossing
virtual Bool_t HandleCrossing(Event_t *event)
Handle generic Event_t type 'event' - provided to catch focus changes and terminate any interaction i...
Definition: TGLEventHandler.cxx:403
TGLEventHandler::ExecuteEvent
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,...
Definition: TGLEventHandler.cxx:219
TGLEventHandler::SetMouseOverSelectDelay
void SetMouseOverSelectDelay(Int_t ms)
Set delay of mouse-over probe (highlight).
Definition: TGLEventHandler.cxx:1125
TGLEventHandler::fLastGlobalPos
TPoint fLastGlobalPos
Definition: TGLEventHandler.h:39
TGEventHandler
Definition: TGEventHandler.h:27
TGLEventHandler::fTooltipShown
Bool_t fTooltipShown
Definition: TGLEventHandler.h:46
TGLEventHandler::fIgnoreButtonUp
Bool_t fIgnoreButtonUp
Definition: TGLEventHandler.h:43
TGLEventHandler::HandleEvent
virtual Bool_t HandleEvent(Event_t *event)
Handle generic Event_t type 'event' - provided to catch focus changes and terminate any interaction i...
Definition: TGLEventHandler.cxx:351
TGLEventHandler::GetSecSelType
Int_t GetSecSelType() const
Definition: TGLEventHandler.h:97
unsigned int
TGLEventHandler::fViewerCentricControls
Bool_t fViewerCentricControls
Definition: TGLEventHandler.h:51
TPoint
Definition: TPoint.h:31
TGLEventHandler::Rotate
virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Method to handle action TGLViewer::kDragCameraRotate.
Definition: TGLEventHandler.cxx:979
TGLEventHandler::HandleFocusChange
virtual Bool_t HandleFocusChange(Event_t *event)
Handle generic Event_t type 'event' - provided to catch focus changes and terminate any interaction i...
Definition: TGLEventHandler.cxx:376
TGLEventHandler::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button 'event'.
Definition: TGLEventHandler.cxx:435
TGLEventHandler::fMouseDragFactor
Float_t fMouseDragFactor
Definition: TGLEventHandler.h:53
TGLEventHandler::fMouseWheelFactor
Float_t fMouseWheelFactor
Definition: TGLEventHandler.h:54
TGLEventHandler::StartMouseTimer
virtual void StartMouseTimer()
Start mouse timer in single-shot mode.
Definition: TGLEventHandler.cxx:1014
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TGLEventHandler
Base-class and default implementation of event-handler for TGLViewer.
Definition: TGLEventHandler.h:30
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
Event_t
Definition: GuiTypes.h:173
TGLEventHandler::GetTooltipPixelTolerance
Int_t GetTooltipPixelTolerance() const
Definition: TGLEventHandler.h:94
TGLPhysicalShape
Concrete physical shape - a GL drawable.
Definition: TGLPhysicalShape.h:32
TGLEventHandler::StopMouseTimer
virtual void StopMouseTimer()
Make sure mouse timers are not running.
Definition: TGLEventHandler.cxx:1023
TGLEventHandler::HandleTimer
virtual Bool_t HandleTimer(TTimer *t)
If mouse delay timer times out emit signal.
Definition: TGLEventHandler.cxx:989
TGLEventHandler::fGLViewer
TGLViewer * fGLViewer
Definition: TGLEventHandler.h:32
TGLEventHandler::fMouseTimerRunning
Bool_t fMouseTimerRunning
Definition: TGLEventHandler.h:45
TGeant4Unit::ms
static constexpr double ms
Definition: TGeant4SystemOfUnits.h:163
TPoint.h
TGLEventHandler::ControlValue
Int_t ControlValue(Int_t v)
Definition: TGLEventHandler.h:64
TGLEventHandler::HandleConfigureNotify
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handle configure notify 'event' - a window resize/movement.
Definition: TGLEventHandler.cxx:703
TGLEventHandler::~TGLEventHandler
virtual ~TGLEventHandler()
Destructor.
Definition: TGLEventHandler.cxx:90
TGLEventHandler::fLastMouseOverShape
TGLPhysicalShape * fLastMouseOverShape
Definition: TGLEventHandler.h:37
TGLEventHandler::fTooltipPos
TPoint fTooltipPos
Definition: TGLEventHandler.h:40
TGLEventHandler::TriggerTooltip
virtual void TriggerTooltip(const char *text)
Trigger display of tooltip.
Definition: TGLEventHandler.cxx:1089
int
TGLEventHandler::GetDoInternalSelection
Bool_t GetDoInternalSelection() const
Definition: TGLEventHandler.h:100