QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
inputcontroller
qgsinputcontrollermanager.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsinputcontroller.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 QGSINPUTCONTROLLER_H
17
#define QGSINPUTCONTROLLER_H
18
19
#include "
qgis.h
"
20
#include "qgis_gui.h"
21
#include "
qgis_sip.h
"
22
23
#include <QMap>
24
#include <QObject>
25
26
class
QgsAbstract2DMapController
;
27
class
QgsAbstract3DMapController
;
28
39
class
GUI_EXPORT
QgsInputControllerManager
:
public
QObject
40
{
41
Q_OBJECT
42
43
public
:
50
QgsInputControllerManager
( QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
51
~QgsInputControllerManager
()
override
;
52
59
QStringList
available2DMapControllers
()
const
;
60
61
/*
62
* IMPORTANT: While it seems like /Factory/ would be the correct annotation here, that's not
63
* the case.
64
* As per Phil Thomson's advice on https://www.riverbankcomputing.com/pipermail/pyqt/2017-July/039450.html:
65
*
66
* "
67
* /Factory/ is used when the instance returned is guaranteed to be new to Python.
68
* In this case it isn't because it has already been seen when being returned by QgsProcessingAlgorithm::createInstance()
69
* (However for a different sub-class implemented in C++ then it would be the first time it was seen
70
* by Python so the /Factory/ on create() would be correct.)
71
*
72
* You might try using /TransferBack/ on create() instead - that might be the best compromise.
73
* "
74
*/
75
85
QgsAbstract2DMapController
*
create2DMapController
(
const
QString &deviceId )
const
SIP_TRANSFERBACK
;
86
97
bool
register2DMapController
(
QgsAbstract2DMapController
*controller
SIP_TRANSFER
);
98
105
QStringList
available3DMapControllers
()
const
;
106
107
/*
108
* IMPORTANT: While it seems like /Factory/ would be the correct annotation here, that's not
109
* the case.
110
* As per Phil Thomson's advice on https://www.riverbankcomputing.com/pipermail/pyqt/2017-July/039450.html:
111
*
112
* "
113
* /Factory/ is used when the instance returned is guaranteed to be new to Python.
114
* In this case it isn't because it has already been seen when being returned by QgsProcessingAlgorithm::createInstance()
115
* (However for a different sub-class implemented in C++ then it would be the first time it was seen
116
* by Python so the /Factory/ on create() would be correct.)
117
*
118
* You might try using /TransferBack/ on create() instead - that might be the best compromise.
119
* "
120
*/
121
131
QgsAbstract3DMapController
*
create3DMapController
(
const
QString &deviceId )
const
SIP_TRANSFERBACK
;
132
143
bool
register3DMapController
(
QgsAbstract3DMapController
*controller
SIP_TRANSFER
);
144
145
private
:
146
QMap<QString, QgsAbstract2DMapController *> m2DMapControllers;
147
QMap<QString, QgsAbstract3DMapController *> m3DMapControllers;
148
};
149
150
#endif
// QGSINPUTCONTROLLER_H
QgsAbstract2DMapController
Abstract base class for all 2D map controllers.
Definition
qgs2dmapcontroller.h:32
QgsAbstract3DMapController
Abstract base class for all 3D map controllers.
Definition
qgs3dmapcontroller.h:32
QgsInputControllerManager::available2DMapControllers
QStringList available2DMapControllers() const
Returns a list of the device IDs of available 2D map controllers.
Definition
qgsinputcontrollermanager.cpp:80
QgsInputControllerManager::available3DMapControllers
QStringList available3DMapControllers() const
Returns a list of the device IDs of available 3D map controllers.
Definition
qgsinputcontrollermanager.cpp:114
QgsInputControllerManager::register2DMapController
bool register2DMapController(QgsAbstract2DMapController *controller)
Registers a new 2D map controller.
Definition
qgsinputcontrollermanager.cpp:50
QgsInputControllerManager::create3DMapController
QgsAbstract3DMapController * create3DMapController(const QString &deviceId) const
Returns a new instance of the 3D map controller with the specified deviceId.
Definition
qgsinputcontrollermanager.cpp:129
QgsInputControllerManager::QgsInputControllerManager
QgsInputControllerManager(QObject *parent=nullptr)
Constructor for QgsInputControllerManager, with the specified parent object.
Definition
qgsinputcontrollermanager.cpp:40
QgsInputControllerManager::create2DMapController
QgsAbstract2DMapController * create2DMapController(const QString &deviceId) const
Returns a new instance of the 2D map controller with the specified deviceId.
Definition
qgsinputcontrollermanager.cpp:95
QgsInputControllerManager::register3DMapController
bool register3DMapController(QgsAbstract3DMapController *controller)
Registers a new 3D map controller.
Definition
qgsinputcontrollermanager.cpp:65
qgis.h
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_TRANSFER
#define SIP_TRANSFER
Definition
qgis_sip.h:35
SIP_TRANSFERBACK
#define SIP_TRANSFERBACK
Definition
qgis_sip.h:47
Generated on
for QGIS API Documentation by
1.17.0