31#include "RConfigure.h"
60 fMouseTimer (nullptr),
62 fLastMouseOverPos (-1, -1),
63 fLastMouseOverShape (nullptr),
69 fMouseTimerRunning (
kFALSE),
72 fTooltipPixelTolerance (3),
74 fDoInternalSelection(
kTRUE),
75 fViewerCentricControls(
kFALSE)
238 Event_t eventSt = {
kOtherEvent, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
239 kFALSE, 0, 0, {0, 0, 0, 0, 0} };
354 Error(
"TGLEventHandler::HandleEvent",
"active drag-action at focus-in.");
361 Warning(
"TGLEventHandler::HandleEvent",
"drag-action active at focus-out.");
380 Error(
"TGLEventHandler::HandleFocusChange",
"active drag-action at focus-in.");
388 Warning(
"TGLEventHandler::HandleFocusChange",
"drag-action active at focus-out.");
405 if (event->
fCode != 0) {
412 Error(
"TGLEventHandler::HandleCrossing",
"active drag-action at enter-notify.");
421 Warning(
"TGLEventHandler::HandleCrossing",
"drag-action active at leave-notify.");
438 Info(
"TGLEventHandler::HandleButton",
"ignored - viewer is %s",
488#if defined(R__HAS_COCOA)
523 TObject* obj = rec.GetObject();
525 Int_t x =
event->fX,
y =
event->fY;
529 1 -
y * 1.0f/
vp.Height(),
v);
553 switch (event->
fCode)
592 Warning(
"TGLEventHandler::HandleButton",
"Unexpected button-release.");
675 Info(
"TGLEventHandler::HandleDoubleClick",
"ignored - viewer is %s",
681 if (event->
fCode > 3)
708 Info(
"TGLEventHandler::HandleConfigureNotify",
"ignored - viewer is %s",
715 Int_t x =
event->fX,
y =
event->fY,
w =
event->fWidth,
h =
event->fHeight;
732 Info(
"TGLViewer::HandleExpose",
"ignored - viewer is %s",
759 Info(
"TGLEventHandler::HandleKey",
"ignored - viewer is %s",
853 cam.SetExternalCenter(!
cam.GetExternalCenter());
870 Info(
"OpenGL viewer FORCED rebuild",
" ");
894 Info(
"TGLEventHandler::HandleMotion",
"ignored - viewer is %s",
923 Info(
"TGLEventHandler::HandleMotion",
"Redraw pending, ignoring.");
997 Info(
"TGLEventHandler::HandleTimer",
"Redraw pending, ignoring.");
1051 Info(
"TGLViewer::HandleExpose",
"ignored - viewer is %s",
const Mask_t kButtonPressMask
const Mask_t kKeyMod1Mask
typically the Alt key
Handle_t Window_t
Window handle.
const Mask_t kPointerMotionMask
const Mask_t kKeyShiftMask
const Mask_t kKeyControlMask
const Mask_t kKeyMod2Mask
typically mod on numeric keys
const Mask_t kButtonReleaseMask
int Int_t
Signed integer 4 bytes (int)
short Short_t
Signed Short integer 2 bytes (short)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char text
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
virtual Bool_t Dolly(Int_t delta, Bool_t mod1, Bool_t mod2)
Dolly the camera - 'move camera along eye line, retaining lens focal length'.
virtual Bool_t Truck(Double_t xDelta, Double_t yDelta)
Truck the camera - 'move camera parallel to film plane'.
virtual Bool_t Zoom(Int_t delta, Bool_t mod1, Bool_t mod2)=0
void WindowToViewport(Int_t &, Int_t &y) const
void SetExternalCenter(Bool_t x)
Set camera center diffrent than scene center, if enable is kTRUE.
void SetCenterVec(Double_t x, Double_t y, Double_t z)
Set camera center vector.
TGLVertex3 ViewportToWorld(const TGLVertex3 &viewportVertex, TGLMatrix *modviewMat=nullptr) const
Convert a '3D' viewport vertex to 3D world one.
Bool_t HandleDoubleClick(Event_t *event) override
Handle mouse double click 'event'.
virtual void GrabMouse()
Acquire mouse grab.
void SetMouseOverSelectDelay(Int_t ms)
Set delay of mouse-over probe (highlight).
TGLEventHandler(TGWindow *w, TObject *obj)
Constructor.
virtual void SelectForClicked(Event_t *event)
Run selection (optionally with on secondary selection) and emit corresponding Clicked() signals.
TGLPhysicalShape * fLastMouseOverShape
virtual void UnGrabMouse()
Release mouse grab.
virtual Bool_t HandleExpose(Event_t *event)
Handle window expose 'event' - show.
virtual void StartMouseTimer()
Start mouse timer in single-shot mode.
virtual void TriggerTooltip(const char *text)
Trigger display of tooltip.
virtual void StopMouseTimer()
Make sure mouse timers are not running.
Bool_t HandleTimer(TTimer *t) override
If mouse delay timer times out emit signal.
virtual void PopupContextMenu(TGLPhysicalShape *pshp, Event_t *event, Int_t gx, Int_t gy)
Popup context menu.
Bool_t HandleFocusChange(Event_t *event) override
Handle generic Event_t type 'event' - provided to catch focus changes and terminate any interaction i...
Bool_t HandleButton(Event_t *event) override
Handle mouse button 'event'.
virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Method to handle action TGLViewer::kDragCameraRotate.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Process event of type 'event' - one of EEventType types, occurring at window location px,...
~TGLEventHandler() override
Destructor.
Bool_t fMouseTimerRunning
Bool_t HandleKey(Event_t *event) override
Handle keyboard 'event'.
Bool_t HandleConfigureNotify(Event_t *event) override
Handle configure notify 'event' - a window resize/movement.
Float_t fMouseWheelFactor
Bool_t fViewerCentricControls
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion 'event'.
Bool_t HandleEvent(Event_t *event) override
Handle generic Event_t type 'event' - provided to catch focus changes and terminate any interaction i...
void SetMouseOverTooltipDelay(Int_t ms)
Set delay of tooltip timer.
Bool_t fDoInternalSelection
virtual void ClearMouseOver()
Clear mouse-over state and emit mouse-over signals.
virtual void SelectForMouseOver()
Run selection (optionally with on secondary selection) and emit corresponding MouseOver() signals.
Bool_t HandleCrossing(Event_t *event) override
Handle generic Event_t type 'event' - provided to catch focus changes and terminate any interaction i...
Int_t fTooltipPixelTolerance
virtual void RemoveTooltip()
Hide the tooltip.
Int_t ControlValue(Int_t v)
void Repaint() override
Handle window expose 'event' - show.
ELock CurrentLock() const
static const char * LockName(ELock lock)
Return name-string for given lock-type.
Abstract logical shape - a GL 'drawable' - base for all shapes - faceset sphere etc.
virtual Bool_t Handle(TGLRnrCtx &rnrCtx, TGLOvlSelectRecord &selRec, Event_t *event)
Handle overlay event.
Concrete physical shape - a GL drawable.
Viewport (pixel base) 2D rectangle class.
void RequestDraw(Int_t milliSec, Short_t redrawLOD)
void SetEventKeySym(UInt_t k)
Standard selection record including information about containing scene and details ob out selected ob...
@ kModifyingInternalSelection
ESecSelResult GetSecSelResult() const
void SetHighlight(Bool_t hlt)
void SetMultiple(Bool_t multi)
TObject * GetObject() const
TGLLogicalShape * GetLogShape() const
TGLPhysicalShape * GetPhysShape() const
static Float_t GetScreenScalingFactor()
Returns scaling factor between screen points and GL viewport pixels.
static void PointToViewport(Int_t &x, Int_t &y)
Convert from point/screen coordinates to GL viewport coordinates.
3 component (x/y/z) vector class.
void SetStyle(Short_t st)
Base GL viewer object - used by both standalone and embedded (in pad) GL.
TGLRedrawTimer * fRedrawTimer
! timer for triggering redraws
virtual void MouseOver(TGLPhysicalShape *)
Emit MouseOver signal.
virtual void RefreshPadEditor(TObject *obj=nullptr)
Update GED editor if it is set.
EPushAction GetPushAction() const
TGLSelectRecord fSelRec
! select record from last select (should go to context)
virtual void ReMouseOver(TObject *obj, UInt_t state)
Emit MouseOver signal.
virtual void Clicked(TObject *obj)
Emit Clicked signal.
virtual void SelectionChanged()
Update GUI components for embedded viewer selection change.
virtual void UnClicked(TObject *obj, UInt_t button, UInt_t state)
Emit UnClicked signal with button id and modifier state.
Bool_t RequestOverlaySelect(Int_t x, Int_t y)
Post request for secondary selection rendering of selected object around the window point (x,...
virtual void MouseIdle(TGLPhysicalShape *, UInt_t, UInt_t)
Emit MouseIdle signal.
void RequestDraw(Short_t LOD=TGLRnrCtx::kLODMed)
Post request for redraw of viewer at level of detail 'LOD' Request is directed via cross thread gVirt...
void SwitchColorSet()
Switch between dark and light colorsets.
TGLSelectRecord fSecSelRec
! select record from last secondary select (should go to context)
TGLCamera & CurrentCamera() const
TContextMenu * fContextMenu
!
void UpdateScene(Bool_t redraw=kTRUE)
Force update of pad-scenes.
virtual void OverlayDragFinished()
An overlay operation can result in change to an object.
Bool_t RequestSecondarySelect(Int_t x, Int_t y)
Request secondary select.
TGLSelectRecord & GetSelRec()
void SetViewport(Int_t x, Int_t y, Int_t width, Int_t height)
Set viewer viewport (window area) with bottom/left at (x,y), with dimensions 'width'/'height'.
virtual void UnMouseOver(TObject *obj, UInt_t state)
Emit UnMouseOver signal.
virtual void ReClicked(TObject *obj, UInt_t button, UInt_t state)
Emit ReClicked signal with button id and modifier state.
void ClearCurrentOvlElm()
Reset current overlay-element to zero, eventually notifying the old one that the mouse has left.
void ApplySelection()
Process result from last selection (in fSelRec) and extract a new current selection from it.
Bool_t RequestSelect(Int_t x, Int_t y)
Post request for selection render pass viewer, picking objects around the window point (x,...
virtual void DoubleClicked()
const TGLPhysicalShape * GetSelected() const
Return selected physical shape.
Bool_t fDebugMode
! debug mode (forced rebuild + draw scene/frustum/interest boxes)
Int_t fGLDevice
!for embedded gl viewer
TGLOvlSelectRecord fOvlSelRec
! select record from last overlay select
TGLOverlayElement * fCurrentOvlElm
! current overlay element
void ResetCurrentCamera()
Resets position/rotation of current camera to default values.
TGLWidget * GetGLWidget()
ROOT GUI Window base class.
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * GetTitle() const
Returns title of object.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Handles synchronous and a-synchronous timer events.
virtual void TurnOff()
Remove timer from system timer list.
virtual void Start(Long_t milliSec=-1, Bool_t singleShot=kFALSE)
Starts the timer with a milliSec timeout.
virtual void TurnOn()
Add the timer to the system timer list.
void Reset()
Reset the timer.
void SetTime(Long_t milliSec)
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
EGEventType fType
of event (see EGEventType)
Int_t fY
pointer x, y coordinates in event window
Int_t fCount
if non-zero, at least this many more exposes
UInt_t fState
key or button mask
Int_t fYRoot
coordinates relative to root
UInt_t fCode
key or button code