QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
inputcontroller
qgs3dgamepadcontroller.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgs3dgamepadcontroller.h
3
---------------------
4
begin : March 2023
5
copyright : (C) 2023 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGS3DGAMEPADCONTROLLER_H
17
#define QGS3DGAMEPADCONTROLLER_H
18
19
#include "qgsconfig.h"
20
21
#include "
qgis_sip.h
"
22
23
SIP_IF_MODULE
( HAVE_QTGAMEPAD )
24
25
#ifdef HAVE_QTGAMEPAD
26
27
#include "qgis_gui.h"
28
#include "
qgis.h
"
29
#include "
qgs3dmapcontroller.h
"
30
31
#include <QPointer>
32
33
#ifdef SIP_RUN
34
// this is needed for the "convert to subclass" code below to compile
35
//%ModuleHeaderCode
36
#include "
qgs3dgamepadcontroller.h
"
37
//%End
38
#endif
39
40
class
QGamepad;
41
42
50
class
GUI_EXPORT QgsGamepad3DMapController :
public
QgsAbstract3DMapController
51
{
52
Q_OBJECT
53
54
#ifdef SIP_RUN
55
SIP_CONVERT_TO_SUBCLASS_CODE
56
if
( qobject_cast<QgsGamepad3DMapController *>( sipCpp ) )
57
58
sipType = sipType_QgsGamepad3DMapController;
59
else
60
sipType =
nullptr
;
61
SIP_END
62
#endif
63
64
public
:
68
QgsGamepad3DMapController(
int
gamepadDeviceId, QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
69
70
QgsGamepad3DMapController *
clone
() const override
SIP_FACTORY
;
71
QString deviceId() const override;
72
73
// proxy QGamepad signals and properties here, as QGamepad isn't accessible from Python.
74
// Ideally we would share these with QgsGamepad3DMapController, but that would create a diamond
75
// inheritance
76
80
bool
isConnected() const;
81
85
QString name() const;
86
90
double
axisLeftX() const;
91
95
double
axisLeftY() const;
96
100
double
axisRightX() const;
101
105
double
axisRightY() const;
106
110
bool
buttonA() const;
111
115
bool
buttonB() const;
116
120
bool
buttonX() const;
121
125
bool
buttonY() const;
126
130
bool
buttonL1() const;
131
135
bool
buttonR1() const;
136
140
double
buttonL2() const;
141
145
double
buttonR2() const;
146
152
bool
buttonSelect() const;
153
159
bool
buttonStart() const;
160
166
bool
buttonL3() const;
167
173
bool
buttonR3() const;
174
178
bool
buttonUp() const;
179
183
bool
buttonDown() const;
184
188
bool
buttonLeft() const;
189
193
bool
buttonRight() const;
194
198
bool
buttonCenter() const;
199
205
bool
buttonGuide() const;
206
207
208
signals:
209
210
214
void
connectedChanged(
bool
value );
215
221
void
axisLeftXChanged(
double
value );
222
228
void
axisLeftYChanged(
double
value );
229
235
void
axisRightXChanged(
double
value );
236
242
void
axisRightYChanged(
double
value );
243
249
void
buttonAChanged(
bool
value );
250
256
void
buttonBChanged(
bool
value );
257
263
void
buttonXChanged(
bool
value );
264
270
void
buttonYChanged(
bool
value );
271
277
void
buttonL1Changed(
bool
value );
278
284
void
buttonR1Changed(
bool
value );
285
291
void
buttonL2Changed(
double
value );
292
298
void
buttonR2Changed(
double
value );
299
305
void
buttonSelectChanged(
bool
value );
306
312
void
buttonStartChanged(
bool
value );
313
319
void
buttonL3Changed(
bool
value );
320
326
void
buttonR3Changed(
bool
value );
327
333
void
buttonUpChanged(
bool
value );
334
340
void
buttonDownChanged(
bool
value );
341
347
void
buttonLeftChanged(
bool
value );
348
354
void
buttonRightChanged(
bool
value );
355
361
void
buttonCenterChanged(
bool
value );
362
368
void
buttonGuideChanged(
bool
value );
369
370
private:
371
int
mGamepadDeviceId = -1;
372
QPointer<QGamepad> mGamepad;
373
};
374
375
376
#endif
377
378
#endif
// QGS3DGAMEPADCONTROLLER_H
QgsAbstract3DMapController
Abstract base class for all 3D map controllers.
Definition
qgs3dmapcontroller.h:32
QgsAbstractInputController::clone
virtual QgsAbstractInputController * clone() const =0
Returns a new copy of the controller.
qgis.h
qgis_sip.h
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition
qgis_sip.h:203
SIP_IF_MODULE
#define SIP_IF_MODULE(condition)
Definition
qgis_sip.h:27
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
SIP_END
#define SIP_END
Definition
qgis_sip.h:220
qgs3dgamepadcontroller.h
qgs3dmapcontroller.h
Generated on
for QGIS API Documentation by
1.17.0