2017-05-23 14:49:24 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsmapmouseevent.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-16 16:26:01 +02:00
|
|
|
class QgsMapMouseEvent : QMouseEvent
|
|
|
|
{
|
2017-05-23 14:49:24 +02:00
|
|
|
%Docstring
|
|
|
|
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
|
|
|
|
It is sent whenever the user moves, clicks, releases or double clicks the mouse.
|
|
|
|
In addition to the coordiantes in pixel space it also knows the coordinates in the mapcanvas' CRS
|
|
|
|
as well as it knows the concept of snapping.
|
|
|
|
%End
|
|
|
|
|
2015-08-16 16:26:01 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsmapmouseevent.h"
|
|
|
|
%End
|
2015-10-20 18:09:33 +02:00
|
|
|
|
|
|
|
%ConvertToSubClassCode
|
2017-05-23 14:49:24 +02:00
|
|
|
if ( dynamic_cast<QgsMapMouseEvent *>( sipCpp ) )
|
|
|
|
sipType = sipType_QgsMapMouseEvent;
|
|
|
|
else
|
|
|
|
sipType = 0;
|
2015-10-20 18:09:33 +02:00
|
|
|
%End
|
2015-08-16 16:26:01 +02:00
|
|
|
public:
|
|
|
|
|
|
|
|
enum SnappingMode
|
|
|
|
{
|
|
|
|
NoSnapping,
|
2017-05-23 14:49:24 +02:00
|
|
|
SnapProjectConfig,
|
|
|
|
SnapAllLayers,
|
2015-08-16 16:26:01 +02:00
|
|
|
};
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
QgsMapMouseEvent( QgsMapCanvas *mapCanvas, QMouseEvent *event );
|
2017-05-23 14:49:24 +02:00
|
|
|
%Docstring
|
|
|
|
Creates a new QgsMapMouseEvent. Should only be required to be called from the QgsMapCanvas.
|
|
|
|
|
|
|
|
\param mapCanvas The map canvas on which the event occurred
|
|
|
|
\param event The original mouse event
|
|
|
|
%End
|
|
|
|
|
|
|
|
QgsMapMouseEvent( QgsMapCanvas *mapCanvas, QEvent::Type type, QPoint pos, Qt::MouseButton button = Qt::NoButton,
|
|
|
|
Qt::MouseButtons buttons = Qt::NoButton, Qt::KeyboardModifiers modifiers = Qt::NoModifier );
|
|
|
|
%Docstring
|
|
|
|
Creates a new QgsMapMouseEvent. Should only be required to be called from the QgsMapCanvas.
|
|
|
|
|
|
|
|
\param mapCanvas The map canvas on which the event occurred
|
|
|
|
\param type The type of the event
|
|
|
|
\param pos The pixel position of the mouse
|
|
|
|
\param button The pressed button
|
|
|
|
\param buttons Further buttons that are pressed
|
|
|
|
\param modifiers Keyboard modifiers
|
|
|
|
%End
|
2015-08-16 16:26:01 +02:00
|
|
|
|
|
|
|
QgsPoint snapPoint( SnappingMode snappingMode );
|
2017-05-23 14:49:24 +02:00
|
|
|
%Docstring
|
|
|
|
snapPoint will snap the points using the map canvas snapping utils configuration
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
if snapping did not succeeded, the map point will be reset to its original position
|
|
|
|
:rtype: QgsPoint
|
|
|
|
%End
|
2015-08-16 16:26:01 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
QList<QgsPoint> snapSegment( SnappingMode snappingMode, bool *snapped = 0, bool allLayers = false ) const;
|
2017-05-23 14:49:24 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the first snapped segment. If the cached snapped match is a segment, it will simply return it.
|
|
|
|
Otherwise it will try to snap a segment according to the event's snapping mode. In this case the cache
|
|
|
|
will not be overwritten.
|
|
|
|
\param snappingMode Specify if the default project settings or all layers should be used for snapping
|
|
|
|
\param snapped if given, determines if a segment has been snapped
|
|
|
|
\param allLayers if true, override snapping mode
|
|
|
|
:rtype: list of QgsPoint
|
|
|
|
%End
|
2015-08-16 16:26:01 +02:00
|
|
|
|
|
|
|
bool isSnapped() const;
|
2017-05-23 14:49:24 +02:00
|
|
|
%Docstring
|
|
|
|
Returns true if there is a snapped point cached.
|
|
|
|
Will only be useful after snapPoint has previously been called.
|
|
|
|
|
|
|
|
:return: True if there is a snapped point cached.
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2015-08-16 16:26:01 +02:00
|
|
|
|
|
|
|
QgsPoint mapPoint() const;
|
2017-05-23 14:49:24 +02:00
|
|
|
%Docstring
|
|
|
|
mapPoint returns the point in coordinates
|
|
|
|
:return: the point in map coordinates, after snapping if requested in the event.
|
|
|
|
:rtype: QgsPoint
|
|
|
|
%End
|
2015-08-16 16:26:01 +02:00
|
|
|
|
2016-01-27 23:39:17 +01:00
|
|
|
QgsPointLocator::Match mapPointMatch() const;
|
2017-05-23 14:49:24 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the matching data from the most recently snapped point.
|
|
|
|
:return: the snapping data structure
|
|
|
|
.. versionadded:: 2.14
|
|
|
|
:rtype: QgsPointLocator.Match
|
|
|
|
%End
|
2016-01-27 23:39:17 +01:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void setMapPoint( const QgsPoint &point );
|
2017-05-23 14:49:24 +02:00
|
|
|
%Docstring
|
|
|
|
Set the (snapped) point this event points to in map coordinates.
|
|
|
|
The point in pixel coordinates will be calculated accordingly.
|
|
|
|
|
|
|
|
\param point The point in map coordinates
|
|
|
|
%End
|
2016-01-04 22:51:18 +11:00
|
|
|
|
2015-08-16 16:26:01 +02:00
|
|
|
QgsPoint originalMapPoint() const;
|
2017-05-23 14:49:24 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the original, unmodified map point of the mouse cursor.
|
|
|
|
|
|
|
|
:return: The cursor position in map coordinates.
|
|
|
|
:rtype: QgsPoint
|
|
|
|
%End
|
2015-08-16 16:26:01 +02:00
|
|
|
|
|
|
|
QPoint pixelPoint() const;
|
2017-05-23 14:49:24 +02:00
|
|
|
%Docstring
|
|
|
|
The snapped mouse cursor in pixel coordinates.
|
|
|
|
|
|
|
|
:return: The snapped mouse cursor position in pixel coordinates.
|
|
|
|
:rtype: QPoint
|
|
|
|
%End
|
2015-08-16 16:26:01 +02:00
|
|
|
|
|
|
|
QPoint originalPixelPoint() const;
|
2017-05-23 14:49:24 +02:00
|
|
|
%Docstring
|
|
|
|
The unsnapped, real mouse cursor position in pixel coordinates.
|
|
|
|
Alias to pos()
|
|
|
|
|
|
|
|
:return: Mouse position in pixel coordinates
|
|
|
|
:rtype: QPoint
|
|
|
|
%End
|
|
|
|
|
2015-08-16 16:26:01 +02:00
|
|
|
};
|
2017-05-23 14:49:24 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsmapmouseevent.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|