31#include "RConfigure.h"
142 switch (
fGLViewer->fSecSelRec.GetSecSelResult())
187 switch (
fGLViewer->fSecSelRec.GetSecSelResult())
239 Event_t eventSt = {
kOtherEvent, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
240 kFALSE, 0, 0, {0, 0, 0, 0, 0} };
355 Error(
"TGLEventHandler::HandleEvent",
"active drag-action at focus-in.");
362 Warning(
"TGLEventHandler::HandleEvent",
"drag-action active at focus-out.");
381 Error(
"TGLEventHandler::HandleFocusChange",
"active drag-action at focus-in.");
389 Warning(
"TGLEventHandler::HandleFocusChange",
"drag-action active at focus-out.");
406 if (event->
fCode != 0) {
413 Error(
"TGLEventHandler::HandleCrossing",
"active drag-action at enter-notify.");
422 Warning(
"TGLEventHandler::HandleCrossing",
"drag-action active at leave-notify.");
439 Info(
"TGLEventHandler::HandleButton",
"ignored - viewer is %s",
489#if defined(R__HAS_COCOA)
514 fGLViewer->CurrentCamera().WindowToViewport(
v);
519 fGLViewer->CurrentCamera().SetCenterVec(
v.X(),
v.Y(),
v.Z());
524 TObject* obj = rec.GetObject();
526 Int_t x =
event->fX,
y =
event->fY;
554 switch (event->
fCode)
593 Warning(
"TGLEventHandler::HandleButton",
"Unexpected button-release.");
652 event->
fX, event->
fY,
x,
y, childdum);
676 Info(
"TGLEventHandler::HandleDoubleClick",
"ignored - viewer is %s",
682 if (event->
fCode > 3)
709 Info(
"TGLEventHandler::HandleConfigureNotify",
"ignored - viewer is %s",
716 Int_t x =
event->fX,
y =
event->fY,
w =
event->fWidth,
h =
event->fHeight;
733 Info(
"TGLViewer::HandleExpose",
"ignored - viewer is %s",
760 Info(
"TGLEventHandler::HandleKey",
"ignored - viewer is %s",
770 gVirtualX->LookupString(event, tmp,
sizeof(tmp), keysym);
772 keysym =
event->fCode;
773 fGLViewer->fRnrCtx->SetEventKeySym(keysym);
832 redraw =
fGLViewer->CurrentCamera().Dolly(shift, mod1, mod2);
837 redraw =
fGLViewer->CurrentCamera().Dolly(-shift, mod1, mod2);
840 redraw =
fGLViewer->CurrentCamera().Truck(0, shift, mod1, mod2);
843 redraw =
fGLViewer->CurrentCamera().Truck(0, -shift, mod1, mod2);
846 redraw =
fGLViewer->CurrentCamera().Truck(-shift, 0, mod1, mod2);
849 redraw =
fGLViewer->CurrentCamera().Truck(shift, 0, mod1, mod2);
866 Info(
"OpenGL viewer debug mode : ",
fGLViewer->fDebugMode ?
"ON" :
"OFF");
871 Info(
"OpenGL viewer FORCED rebuild",
" ");
895 Info(
"TGLEventHandler::HandleMotion",
"ignored - viewer is %s",
922 if (
fGLViewer->fRedrawTimer->IsPending()) {
924 Info(
"TGLEventHandler::HandleMotion",
"Redraw pending, ignoring.");
927 changed =
fGLViewer->RequestOverlaySelect(event->
fX, event->
fY);
940 processed =
Rotate(xDelta, yDelta, mod1, mod2);
944 processed =
fGLViewer->CurrentCamera().Truck(xDelta, -yDelta, mod1, mod2);
948 processed =
fGLViewer->CurrentCamera().Dolly(yDelta - xDelta, mod1, mod2);
965 if (processed || changed) {
984 else return cam.
Rotate (xDelta, -yDelta, mod1, mod2);
996 if (
fGLViewer->fRedrawTimer->IsPending()) {
998 Info(
"TGLEventHandler::HandleTimer",
"Redraw pending, ignoring.");
1052 Info(
"TGLViewer::HandleExpose",
"ignored - viewer is %s",
1092 static UInt_t screenW = 0, screenH = 0;
1097 if (screenW == 0 || screenH == 0) {
1098 screenW =
gClient->GetDisplayWidth();
1099 screenH =
gClient->GetDisplayHeight();
1101 if (
x + 5 +
fTooltip->GetWidth() > screenW) {
1103 if (
y + 5 +
fTooltip->GetHeight() > screenH) {
1107 if (
y + 5 +
fTooltip->GetHeight() > screenH) {
1108 y = screenH -
fTooltip->GetHeight() - 10;
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
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void w
Option_t Option_t TPoint TPoint const char text
TGEventHandler(const TGEventHandler &)=delete
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Rotate the camera round view volume center established in Setup().
Bool_t GetExternalCenter()
void SetExternalCenter(Bool_t x)
Set camera center diffrent than scene center, if enable is kTRUE.
virtual Bool_t RotateArcBall(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod2)
Rotate the camera round view volume center established in Setup().
Base-class and default implementation of event-handler for TGLViewer.
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.
Abstract logical shape - a GL 'drawable' - base for all shapes - faceset sphere etc.
virtual void ProcessSelection(TGLRnrCtx &rnrCtx, TGLSelectRecord &rec)
Virtual method called-back after a secondary selection hit is recorded (see TGLViewer::HandleButton()...
virtual Bool_t AlwaysSecondarySelect() const
Concrete physical shape - a GL drawable.
void InvokeContextMenu(TContextMenu &menu, UInt_t x, UInt_t y) const
Request creation of context menu on shape, attached to 'menu' at screen position 'x' 'y'.
Viewport (pixel base) 2D rectangle class.
Standard selection record including information about containing scene and details ob out selected ob...
@ kModifyingInternalSelection
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.
Base GL viewer object - used by both standalone and embedded (in pad) GL.
ROOT GUI Window base class.
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.
TObject()
TObject constructor.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Handles synchronous and a-synchronous timer events.
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