MeVisLab Toolbox Reference
SoQtTouchpad.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3/*
4 _______________________________________________________________________
5 __________________ F R A U N H O F E R M E V I S __________________
6 |
7 | Description:
8 | SoQtTouchpad
9 |
10 | Author(s) : Felix Ritter
11 |
12 __________________ F R A U N H O F E R M E V I S __________________
13 _______________________________________________________________________
14 */
15
16#ifndef __SoQtTouchpad_H
17#define __SoQtTouchpad_H
18
19#include "SoTouchControlInit.h"
20#include <Inventor/Qt/SoQt.h>
21#include <Inventor/Qt/devices/SoQtSubDevice.h>
29#include <Inventor/events/SoMouseButtonEvent.h>
30#include <set>
31
32#include <Inventor/fields/SoSFBool.h>
33
35
44class TOUCHCONTROL_API SoQtTouchpad : public SoQtDevice, public QObject
45{
46 SO_QT_DEVICE_HEADER();
47
48public:
50
53 enum Mask {
54 MAGNIFY = 0x01,
55 ROTATE = 0x02,
56 PAN = 0x04,
57 SWIPE = 0x08,
58 DOUBLETAP = 0x10,
59 HOLDWHILEPAN = 0x20,
60 PINCH = 0x40,
61 ALL = 0xFF
62 };
63
67 ~SoQtTouchpad() override;
68
70
75 virtual void enable(QWidget *w, SoQtEventHandler *f, void *data) override;
76 virtual void disable(QWidget *w, SoQtEventHandler *f, void *data) override;
78
80
83 virtual const SoEvent *translateEvent(QEvent *event) override;
84
85 SoINTERNAL public:
86 static void initClass();
87
88private:
89
90 Mask eventMask; // Event interest for this device
91 SoPinch2GestureEvent *pinchEvent;
92 SoMagnify2GestureEvent *magnifyEvent;
93 SoRotate2GestureEvent *rotateEvent;
94 SoSwipe2GestureEvent *swipeEvent;
95 SoPan2GestureEvent *panEvent;
96 SoMultiTapGestureEvent *multiTapEvent;
97 SoHoldWhilePanGestureEvent *holdWhilePanEvent;
98 SoMouseButtonEvent *mouseButtonEvent;
99
100 Qt::GestureType doubleTapGestureType;
101 Qt::GestureType holdWhilePanGestureType;
102 Qt::GestureType newPinchGestureType;
103 Qt::GestureType newPanGestureType;
104 Qt::GestureType panNoDelayGestureType;
105
106 static std::set<SoQtTouchpad *> activeInstances;
107
108 QWidget *gestureWidget;
109 bool enabled;
110 SoEvent *currentEvent;
111};
112
113#endif // __SoQtTouchpad_H
A SoHoldWhilePanGestureEvent derived from SoGestureEvent.
A SoMagnify2GestureEvent derived from SoGestureEvent.
A SoMultiTapGestureEvent derived from SoGestureEvent.
A SoPan2GestureEvent derived from SoGestureEvent.
A SoPinch2GestureEvent derived from SoGestureEvent.
A SoRotate2GestureEvent derived from SoGestureEvent.
A SoSwipe2GestureEvent derived from SoGestureEvent.
#define TOUCHCONTROL_API
A SoHoldWhilePanGestureEvent derived from SoGestureEvent.
A SoMagnify2GestureEvent derived from SoGestureEvent.
A SoMultiTapGestureEvent derived from SoGestureEvent.
A SoPan2GestureEvent derived from SoGestureEvent.
A SoPinch2GestureEvent derived from SoGestureEvent.
Touchpad device driver for Open Inventor.
~SoQtTouchpad() override
Destructor.
virtual void enable(QWidget *w, SoQtEventHandler *f, void *data) override
virtual const SoEvent * translateEvent(QEvent *event) override
This converts a window system event into an SoEvent.
virtual void disable(QWidget *w, SoQtEventHandler *f, void *data) override
Mask
Event mask values.
@ ALL
All Touchpad events.
static void initClass()
SoQtTouchpad(Mask mask=SoQtTouchpad::ALL)
Constructor.
A SoRotate2GestureEvent derived from SoGestureEvent.
A SoSwipe2GestureEvent derived from SoGestureEvent.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.