Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
customtabletevent.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <QGraphicsSceneEvent>
4 #include <QString>
5 
6 class QWidget;
7 
8 namespace geometrize
9 {
10 
11 namespace scene
12 {
13 
17 enum class TabletEventType
18 {
19  Move,
20  Press,
21  Release,
22  EnterProximity, // Wacom tablets/pens don't have to touch the screen to send motion, just be within proximity
24  Unknown
25 };
26 
32 QString tabletEventTypeToString(const TabletEventType& type);
33 
38 {
40  Pen,
41  Cursor,
42  Eraser
43 };
44 
51 
56 {
57 public:
58  TabletEventData() = default;
59  ~TabletEventData() = default;
60  TabletEventData& operator=(const TabletEventData&) = default;
61  TabletEventData(const TabletEventData&) = default;
62 
65  float xViewPos{0.0f};
66  float yViewPos{0.0f};
67  float xScenePos{0.0f};
68  float yScenePos{0.0f};
69  float pressure{0.0f};
70  float tangentialPressure{0.0f};
71  float rotation{0.0f};
72  float xTilt{0.0f};
73  float yTilt{0.0f};
74 };
75 
81 QString tabletEventDataToString(const TabletEventData& data);
82 
87 class CustomTabletEvent : public QGraphicsSceneEvent
88 {
89 public:
93  static const int customEventId;
94 
100  CustomTabletEvent(const TabletEventData& data, QWidget* sourceWidget);
101  ~CustomTabletEvent() = default;
102 
103  const TabletEventData& getData() const;
104 
105 private:
107 };
108 
109 }
110 
111 }
float yViewPos
Definition: customtabletevent.h:66
CustomTabletEvent(const TabletEventData &data, QWidget *sourceWidget)
CustomTabletEvent Creates a custom tablet event.
Definition: customtabletevent.cpp:59
TabletEventType
The TabletEventType enum represents the ids of tablet events the Wacom pen/tablet generates...
Definition: customtabletevent.h:17
float yScenePos
Definition: customtabletevent.h:68
float tangentialPressure
Definition: customtabletevent.h:70
TabletEventPointerType
The TabletEventPointerType enum represents the type of pointer generating the tablet event...
Definition: customtabletevent.h:37
TabletEventData & operator=(const TabletEventData &)=default
const TabletEventData & getData() const
Definition: customtabletevent.cpp:64
QString tabletEventDataToString(const TabletEventData &data)
tabletEventDataToString Helper function to convert a structure of tablet event data to a string ...
Definition: customtabletevent.cpp:44
The CustomTabletEvent class represents a tablet event (specifically from a Wacom Pro pen) that can be...
Definition: customtabletevent.h:87
float xTilt
Definition: customtabletevent.h:72
float yTilt
Definition: customtabletevent.h:73
static const int customEventId
CustomTabletEventTypeId is the id for the corresponding custom tablet event type. ...
Definition: customtabletevent.h:93
const TabletEventData m_data
Definition: customtabletevent.h:106
float xViewPos
Definition: customtabletevent.h:65
The TabletEventData class represents data produced from a Wacom pen/tablet event (in the context of a...
Definition: customtabletevent.h:55
float xScenePos
Definition: customtabletevent.h:67
TabletEventPointerType pointerType
Definition: customtabletevent.h:64
QString tabletEventTypeToString(const TabletEventType &type)
tabletEventTypeToString Helper function to convert a tablet event type enum value to a string ...
Definition: customtabletevent.cpp:12
QString tabletEventPointerTypeToString(const TabletEventPointerType &type)
tabletEventPointerTypeToString Helper function to convert a tablet event pointer type enum value to a...
Definition: customtabletevent.cpp:30
TabletEventType eventType
Definition: customtabletevent.h:63
float rotation
Definition: customtabletevent.h:71
float pressure
Definition: customtabletevent.h:69