forked from lbartoletti/QGIS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add framework for handling non-keyboard/mouse map controllers
This is the base API interface classes for creation of custom 2d or 3d map controllers, and registering them in a common QgsInputControllerManager singleton class.
- Loading branch information
1 parent
3c99f36
commit eca6b7a
Showing
21 changed files
with
826 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
python/gui/auto_generated/inputcontroller/qgs2dmapcontroller.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/inputcontroller/qgs2dmapcontroller.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
class QgsAbstract2DMapController : QgsAbstractInputController | ||
{ | ||
%Docstring(signature="appended") | ||
Abstract base class for all 2D map controllers. | ||
|
||
.. versionadded:: 3.32 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgs2dmapcontroller.h" | ||
%End | ||
public: | ||
|
||
QgsAbstract2DMapController( QObject *parent /TransferThis/ = 0 ); | ||
%Docstring | ||
Constructor for QgsAbstract2DMapController, with the specified ``parent`` object. | ||
%End | ||
|
||
virtual Qgis::InputControllerType type() const; | ||
|
||
|
||
signals: | ||
|
||
|
||
void zoomMap( double factor ); | ||
%Docstring | ||
Emitted when the controller should change the scale of a map by the given ``factor``. | ||
%End | ||
|
||
|
||
}; | ||
|
||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/inputcontroller/qgs2dmapcontroller.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
49 changes: 49 additions & 0 deletions
49
python/gui/auto_generated/inputcontroller/qgs3dmapcontroller.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/inputcontroller/qgs3dmapcontroller.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
class QgsAbstract3DMapController : QgsAbstractInputController | ||
{ | ||
%Docstring(signature="appended") | ||
Abstract base class for all 3D map controllers. | ||
|
||
.. versionadded:: 3.32 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgs3dmapcontroller.h" | ||
%End | ||
public: | ||
|
||
QgsAbstract3DMapController( QObject *parent /TransferThis/ = 0 ); | ||
%Docstring | ||
Constructor for QgsAbstract3DMapController, with the specified ``parent`` object. | ||
%End | ||
|
||
virtual Qgis::InputControllerType type() const; | ||
|
||
|
||
signals: | ||
|
||
|
||
void changeCameraAngleByDelta( double delta ); | ||
%Docstring | ||
Emitted when the controller needs to change the 3d camera angle by the specified ``delta``. | ||
%End | ||
|
||
}; | ||
|
||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/inputcontroller/qgs3dmapcontroller.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
64 changes: 64 additions & 0 deletions
64
python/gui/auto_generated/inputcontroller/qgsabstractinputcontroller.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/inputcontroller/qgsabstractinputcontroller.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
class QgsAbstractInputController : QObject | ||
{ | ||
%Docstring(signature="appended") | ||
Abstract base class for all input controllers. | ||
|
||
.. versionadded:: 3.32 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsabstractinputcontroller.h" | ||
#include "qgs2dmapcontroller.h" | ||
#include "qgs3dmapcontroller.h" | ||
%ConvertToSubClassCode | ||
if ( qobject_cast< QgsAbstract2DMapController * >( sipCpp ) ) | ||
sipType = sipType_QgsAbstract2DMapController; | ||
else if ( qobject_cast< QgsAbstract3DMapController * >( sipCpp ) ) | ||
sipType = sipType_QgsAbstract3DMapController; | ||
else | ||
sipType = nullptr; | ||
%End | ||
%End | ||
public: | ||
|
||
QgsAbstractInputController( QObject *parent /TransferThis/ = 0 ); | ||
%Docstring | ||
Constructor for QgsAbstractInputController, with the specified ``parent`` object. | ||
%End | ||
|
||
virtual QgsAbstractInputController *clone() const = 0 /Factory/; | ||
%Docstring | ||
Returns a new copy of the controller. | ||
%End | ||
|
||
virtual QString deviceId() const = 0; | ||
%Docstring | ||
Returns a string uniquely identifying the device. | ||
%End | ||
|
||
virtual Qgis::InputControllerType type() const = 0; | ||
%Docstring | ||
Returns the input controller type. | ||
%End | ||
|
||
}; | ||
|
||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/inputcontroller/qgsabstractinputcontroller.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
112 changes: 112 additions & 0 deletions
112
python/gui/auto_generated/inputcontroller/qgsinputcontrollermanager.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/inputcontroller/qgsinputcontrollermanager.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
class QgsInputControllerManager : QObject | ||
{ | ||
%Docstring(signature="appended") | ||
Manages input control devices. | ||
|
||
:py:class:`QgsInputControllerManager` is not usually directly created, but rather accessed through | ||
:py:func:`QgsGui.inputControllerManager()`. | ||
|
||
.. versionadded:: 3.32 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsinputcontrollermanager.h" | ||
%End | ||
public: | ||
|
||
QgsInputControllerManager( QObject *parent /TransferThis/ = 0 ); | ||
%Docstring | ||
Constructor for QgsInputControllerManager, with the specified ``parent`` object. | ||
|
||
.. note:: | ||
|
||
QgsInputControllerManager is not usually directly created, but rather accessed through | ||
:py:func:`QgsGui.inputControllerManager()`. | ||
%End | ||
~QgsInputControllerManager(); | ||
|
||
QStringList available2DMapControllers() const; | ||
%Docstring | ||
Returns a list of the device IDs of available 2D map controllers. | ||
|
||
.. seealso:: :py:func:`create2DMapController` | ||
|
||
.. seealso:: :py:func:`register2DMapController` | ||
%End | ||
|
||
QgsAbstract2DMapController *create2DMapController( const QString &deviceId ) const /Factory/; | ||
%Docstring | ||
Returns a new instance of the 2D map controller with the specified ``deviceId``. | ||
|
||
The caller takes ownership of the returned object. | ||
|
||
Will return ``None`` if no matching controller is found. | ||
|
||
.. seealso:: :py:func:`available2DMapControllers` | ||
%End | ||
|
||
bool register2DMapController( QgsAbstract2DMapController *controller /Transfer/ ); | ||
%Docstring | ||
Registers a new 2D map ``controller``. | ||
|
||
Ownership of ``controller`` is transferred to the manager. | ||
|
||
Returns ``True`` if the controller was successfully registered, or ``False`` if it could | ||
not be registered (e.g. if a controller with matching deviceId has already been registered). | ||
|
||
.. seealso:: :py:func:`available2DMapControllers` | ||
%End | ||
|
||
QStringList available3DMapControllers() const; | ||
%Docstring | ||
Returns a list of the device IDs of available 3D map controllers. | ||
|
||
.. seealso:: :py:func:`create3DMapController` | ||
|
||
.. seealso:: :py:func:`register3DMapController` | ||
%End | ||
|
||
QgsAbstract3DMapController *create3DMapController( const QString &deviceId ) const /Factory/; | ||
%Docstring | ||
Returns a new instance of the 3D map controller with the specified ``deviceId``. | ||
|
||
The caller takes ownership of the returned object. | ||
|
||
Will return ``None`` if no matching controller is found. | ||
|
||
.. seealso:: :py:func:`available3DMapControllers` | ||
%End | ||
|
||
bool register3DMapController( QgsAbstract3DMapController *controller /Transfer/ ); | ||
%Docstring | ||
Registers a new 3D map ``controller``. | ||
|
||
Ownership of ``controller`` is transferred to the manager. | ||
|
||
Returns ``True`` if the controller was successfully registered, or ``False`` if it could | ||
not be registered (e.g. if a controller with matching deviceId has already been registered). | ||
|
||
.. seealso:: :py:func:`available3DMapControllers` | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/inputcontroller/qgsinputcontrollermanager.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.