1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/maptools/qgsmaptooladvanceddigitizing.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsMapToolAdvancedDigitizing : QgsMapToolEdit
{
%Docstring(signature="appended")
The :py:class:`QgsMapToolAdvancedDigitizing` class is a
:py:class:`QgsMapTool` which gives event directly in map coordinates and
allows filtering its events. Events from :py:class:`QgsMapTool` are
caught and their QMouseEvent are transformed into
:py:class:`QgsMapMouseEvent` (with map coordinates). Events are then
forwarded to corresponding virtual methods which can be reimplemented in
subclasses. An event filter can be set on the map tool to filter and
modify the events in map coordinates
(:py:class:`QgsMapToolMapEventFilter`).
.. note::
at the moment, the event filter is used by the CAD tools (:py:class:`QgsCadDocWidget`).
.. note::
the event filter definition is not exposed in Python API to avoid any unexpected behavior.
%End
%TypeHeaderCode
#include "qgsmaptooladvanceddigitizing.h"
%End
public:
explicit QgsMapToolAdvancedDigitizing( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget );
%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
~QgsMapToolAdvancedDigitizing();
virtual void canvasPressEvent( QgsMapMouseEvent *e );
%Docstring
Catch the mouse press event, filters it, transforms it to map
coordinates and send it to virtual method
%End
virtual void canvasReleaseEvent( QgsMapMouseEvent *e );
%Docstring
Catch the mouse release event, filters it, transforms it to map
coordinates and send it to virtual method
%End
virtual void canvasMoveEvent( QgsMapMouseEvent *e );
%Docstring
Catch the mouse move event, filters it, transforms it to map coordinates
and send it to virtual method
%End
virtual void activate();
%Docstring
Registers this maptool with the cad dock widget
%End
virtual void deactivate();
%Docstring
Unregisters this maptool from the cad dock widget
%End
QgsAdvancedDigitizingDockWidget *cadDockWidget() const;
virtual QgsMapLayer *layer() const;
%Docstring
Returns the layer associated with the map tool.
By default this returns the map canvas'
:py:func:`QgsMapCanvas.currentLayer()`.
.. versionadded:: 3.22
%End
bool isAdvancedDigitizingAllowed() const;
%Docstring
Returns whether functionality of advanced digitizing dock widget is
currently allowed.
Tools may decide to switch this support on/off based on the current
state of the map tool. For example, in vertex tool before user picks a
vertex to move, advanced digitizing dock widget should be disabled and
only enabled once a vertex is being moved. Other map tools may keep
advanced digitizing allowed all the time.
If ``True`` is returned, that does not mean that advanced digitizing is
actually active, because it is up to the user to enable/disable it when
it is allowed.
The default is that advanced digitizing is allowed.
.. seealso:: :py:func:`setAdvancedDigitizingAllowed`
%End
bool isAutoSnapEnabled() const;
%Docstring
Returns whether mouse events (press/move/release) should automatically
try to snap mouse position (according to the snapping configuration of
map canvas) before passing the mouse coordinates to the tool. This may
be desirable default behavior for some map tools, but not for other map
tools. It is therefore possible to configure the behavior by the map
tool.
The default is that auto snapping is enabled.
.. seealso:: :py:func:`isAutoSnapEnabled`
%End
bool useSnappingIndicator() const;
%Docstring
Returns whether the snapping indicator should automatically be used.
The default is that a snap indicator is not used.
.. seealso:: :py:func:`setUseSnappingIndicator`
.. versionadded:: 3.40
%End
protected:
void setAdvancedDigitizingAllowed( bool allowed );
%Docstring
Sets whether functionality of advanced digitizing dock widget is
currently allowed. This method is protected because it should be a
decision of the map tool and not from elsewhere.
The default is that advanced digitizing is allowed.
.. seealso:: :py:func:`isAdvancedDigitizingAllowed`
%End
void setAutoSnapEnabled( bool enabled );
%Docstring
Sets whether mouse events (press/move/release) should automatically try
to snap mouse position This method is protected because it should be a
decision of the map tool and not from elsewhere.
The default is that auto snapping is enabled.
.. seealso:: :py:func:`isAutoSnapEnabled`
%End
void setUseSnappingIndicator( bool enabled );
%Docstring
Sets whether a snapping indicator should automatically be used.
The default is that a snap indicator is not used.
.. seealso:: :py:func:`useSnappingIndicator`
.. versionadded:: 3.40
%End
public:
virtual void cadCanvasPressEvent( QgsMapMouseEvent *e );
%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
virtual void cadCanvasReleaseEvent( QgsMapMouseEvent *e );
%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
virtual void cadCanvasMoveEvent( QgsMapMouseEvent *e );
%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
bool snapToLayerGridEnabled() const;
%Docstring
Enables or disables snap to grid of mouse events. The snapping will
occur in the layer's CRS.
.. versionadded:: 3.4
%End
void setSnapToLayerGridEnabled( bool snapToLayerGridEnabled );
%Docstring
Enables or disables snap to grid of mouse events. The snapping will
occur in the layer's CRS.
.. versionadded:: 3.4
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/maptools/qgsmaptooladvanceddigitizing.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|