31#include "RConfigure.h"
141 switch (
fGLViewer->fSecSelRec.GetSecSelResult())
186 switch (
fGLViewer->fSecSelRec.GetSecSelResult())
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)
513 fGLViewer->CurrentCamera().WindowToViewport(
v);
518 fGLViewer->CurrentCamera().SetCenterVec(
v.X(),
v.Y(),
v.Z());
525 Int_t x =
event->fX,
y =
event->fY;
553 switch (event->
fCode)
592 Warning(
"TGLEventHandler::HandleButton",
"Unexpected button-release.");
651 event->
fX, event->
fY,
x,
y, childdum);
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",
769 gVirtualX->LookupString(event, tmp,
sizeof(tmp), keysym);
771 keysym =
event->fCode;
772 fGLViewer->fRnrCtx->SetEventKeySym(keysym);
831 redraw =
fGLViewer->CurrentCamera().Dolly(shift, mod1, mod2);
836 redraw =
fGLViewer->CurrentCamera().Dolly(-shift, mod1, mod2);
839 redraw =
fGLViewer->CurrentCamera().Truck(0, shift, mod1, mod2);
842 redraw =
fGLViewer->CurrentCamera().Truck(0, -shift, mod1, mod2);
845 redraw =
fGLViewer->CurrentCamera().Truck(-shift, 0, mod1, mod2);
848 redraw =
fGLViewer->CurrentCamera().Truck(shift, 0, mod1, mod2);
865 Info(
"OpenGL viewer debug mode : ",
fGLViewer->fDebugMode ?
"ON" :
"OFF");
870 Info(
"OpenGL viewer FORCED rebuild",
" ");
894 Info(
"TGLEventHandler::HandleMotion",
"ignored - viewer is %s",
921 if (
fGLViewer->fRedrawTimer->IsPending()) {
923 Info(
"TGLEventHandler::HandleMotion",
"Redraw pending, ignoring.");
926 changed =
fGLViewer->RequestOverlaySelect(event->
fX, event->
fY);
939 processed =
Rotate(xDelta, yDelta, mod1, mod2);
943 processed =
fGLViewer->CurrentCamera().Truck(xDelta, -yDelta, mod1, mod2);
947 processed =
fGLViewer->CurrentCamera().Dolly(yDelta - xDelta, mod1, mod2);
964 if (processed || changed) {
983 else return cam.
Rotate (xDelta, -yDelta, mod1, mod2);
995 if (
fGLViewer->fRedrawTimer->IsPending()) {
997 Info(
"TGLEventHandler::HandleTimer",
"Redraw pending, ignoring.");
1051 Info(
"TGLViewer::HandleExpose",
"ignored - viewer is %s",
1091 static UInt_t screenW = 0, screenH = 0;
1096 if (screenW == 0 || screenH == 0) {
1097 screenW =
gClient->GetDisplayWidth();
1098 screenH =
gClient->GetDisplayHeight();
1100 if (
x + 5 +
fTooltip->GetWidth() > screenW) {
1102 if (
y + 5 +
fTooltip->GetHeight() > screenH) {
1106 if (
y + 5 +
fTooltip->GetHeight() > screenH) {
1107 y = screenH -
fTooltip->GetHeight() - 10;
const Mask_t kButtonPressMask
const Mask_t kKeyMod1Mask
typically the Alt key
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
Handle_t Window_t
Window handle.
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
short Short_t
Signed Short integer 2 bytes (short).
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().
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
TObject * GetObject() 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.
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