2017-06-07 16:16:21 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsmaptooladvanceddigitizing.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-11 09:10:35 +02:00
|
|
|
class QgsMapToolAdvancedDigitizing : QgsMapToolEdit
|
|
|
|
{
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
|
|
|
The QgsMapToolAdvancedDigitizing class is a QgsMapTool which gives event directly in map coordinates and allows filtering its events.
|
|
|
|
Events from QgsMapTool are caught and their QMouseEvent are transformed into QgsMapMouseEvent (with map coordinates).
|
|
|
|
Events are then forwarded to corresponding virtual methods which can be reimplemented in subclasses.
|
|
|
|
.. seealso:: QgsMapToolMapEventFilter).
|
|
|
|
.. seealso:: QgsCadDocWidget).
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
the event filter definition is not exposed in Python API to avoid any unexpected behavior.
|
|
|
|
%End
|
|
|
|
|
2015-09-11 09:10:35 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsmaptooladvanceddigitizing.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
enum CaptureMode
|
|
|
|
{
|
2017-06-07 16:16:21 +02:00
|
|
|
CaptureNone,
|
|
|
|
CapturePoint,
|
|
|
|
CaptureSegment,
|
|
|
|
CaptureLine,
|
|
|
|
CapturePolygon
|
2015-09-11 09:10:35 +02:00
|
|
|
};
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
explicit QgsMapToolAdvancedDigitizing( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget );
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
|
|
|
Creates an advanced digitizing maptool
|
|
|
|
\param canvas The map canvas on which the tool works
|
|
|
|
\param cadDockWidget The cad dock widget which will be used to adjust mouse events
|
|
|
|
%End
|
2015-09-11 09:10:35 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void canvasPressEvent( QgsMapMouseEvent *e );
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
|
|
|
Catch the mouse press event, filters it, transforms it to map coordinates and send it to virtual method
|
|
|
|
%End
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void canvasReleaseEvent( QgsMapMouseEvent *e );
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
|
|
|
Catch the mouse release event, filters it, transforms it to map coordinates and send it to virtual method
|
|
|
|
%End
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void canvasMoveEvent( QgsMapMouseEvent *e );
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
|
|
|
Catch the mouse move event, filters it, transforms it to map coordinates and send it to virtual method
|
|
|
|
%End
|
2015-09-11 09:10:35 +02:00
|
|
|
|
|
|
|
CaptureMode mode() const;
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
|
|
|
The capture mode
|
|
|
|
|
|
|
|
:return: Capture mode
|
|
|
|
:rtype: CaptureMode
|
|
|
|
%End
|
2015-09-11 09:10:35 +02:00
|
|
|
|
2015-10-20 20:41:47 +02:00
|
|
|
void setMode( CaptureMode mode );
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
|
|
|
Set capture mode. This should correspond to the layer on which the digitizing
|
|
|
|
happens.
|
|
|
|
|
|
|
|
\param mode Capture Mode
|
|
|
|
%End
|
2015-10-20 20:41:47 +02:00
|
|
|
|
|
|
|
virtual void activate();
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
|
|
|
Registers this maptool with the cad dock widget
|
|
|
|
%End
|
2015-09-11 09:10:35 +02:00
|
|
|
|
2015-10-20 20:41:47 +02:00
|
|
|
virtual void deactivate();
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
|
|
|
Unregisters this maptool from the cad dock widget
|
|
|
|
%End
|
2015-09-11 09:10:35 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
QgsAdvancedDigitizingDockWidget *cadDockWidget() const;
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
|
|
|
:rtype: QgsAdvancedDigitizingDockWidget
|
|
|
|
%End
|
|
|
|
|
2015-09-11 09:10:35 +02:00
|
|
|
|
|
|
|
protected:
|
2017-06-07 16:16:21 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void cadCanvasPressEvent( QgsMapMouseEvent *e );
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
|
|
|
Override this method when subclassing this class.
|
|
|
|
This will receive adapted events from the cad system whenever a
|
|
|
|
canvasPressEvent is triggered and it's not hidden by the cad's
|
|
|
|
construction mode.
|
|
|
|
|
|
|
|
\param e Mouse events prepared by the cad system
|
|
|
|
%End
|
2015-09-11 09:10:35 +02:00
|
|
|
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void cadCanvasReleaseEvent( QgsMapMouseEvent *e );
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
|
|
|
Override this method when subclassing this class.
|
|
|
|
This will receive adapted events from the cad system whenever a
|
|
|
|
canvasReleaseEvent is triggered and it's not hidden by the cad's
|
|
|
|
construction mode.
|
|
|
|
|
|
|
|
\param e Mouse events prepared by the cad system
|
|
|
|
%End
|
2015-09-11 09:10:35 +02:00
|
|
|
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual void cadCanvasMoveEvent( QgsMapMouseEvent *e );
|
2017-06-07 16:16:21 +02:00
|
|
|
%Docstring
|
|
|
|
Override this method when subclassing this class.
|
|
|
|
This will receive adapted events from the cad system whenever a
|
|
|
|
canvasMoveEvent is triggered and it's not hidden by the cad's
|
|
|
|
construction mode.
|
|
|
|
|
|
|
|
\param e Mouse events prepared by the cad system
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
2015-09-11 09:10:35 +02:00
|
|
|
};
|
2017-06-07 16:16:21 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsmaptooladvanceddigitizing.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|