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 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/maptools/qgsmaptoolcapture.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsMapToolCapture : QgsMapToolAdvancedDigitizing
{
%Docstring(signature="appended")
:py:class:`QgsMapToolCapture` is a base class capable of capturing
point, lines and polygons. The tool supports different techniques:
straight segments, curves, streaming and shapes Once the the geometry is
captured the virtual private handler geometryCaptured is called as well
as a more specific handler (pointCaptured, lineCaptured or
polygonCaptured)
%End
%TypeHeaderCode
#include "qgsmaptoolcapture.h"
%End
public:
enum CaptureMode /BaseType=IntEnum/
{
CaptureNone,
CapturePoint,
CaptureLine,
CapturePolygon
};
enum Capability /BaseType=IntEnum/
{
NoCapabilities,
SupportsCurves,
ValidateGeometries,
};
typedef QFlags<QgsMapToolCapture::Capability> Capabilities;
QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode );
%Docstring
constructor
%End
~QgsMapToolCapture();
virtual QgsMapToolCapture::Capabilities capabilities() const;
%Docstring
Returns flags containing the supported capabilities
%End
virtual bool supportsTechnique( Qgis::CaptureTechnique technique ) const;
%Docstring
Returns ``True`` if the tool supports the specified capture
``technique``.
.. versionadded:: 3.20
%End
void setCurrentCaptureTechnique( Qgis::CaptureTechnique technique );
%Docstring
Sets the current capture if it is supported by the map tool
.. versionadded:: 3.26
%End
Qgis::CaptureTechnique currentCaptureTechnique() const;
%Docstring
Returns the active capture technique
.. versionadded:: 3.32
%End
virtual void activate();
virtual void deactivate();
CaptureMode mode() const;
%Docstring
The capture mode
:return: Capture mode
%End
int addCurve( QgsCurve *c );
%Docstring
Adds a whole curve (e.g. circularstring) to the captured geometry. Curve
must be in map CRS
%End
void clearCurve();
%Docstring
Clear capture curve.
%End
const QgsCompoundCurve *captureCurve() const;
%Docstring
Gets the capture curve
:return: Capture curve
%End
QList<QgsPointLocator::Match> snappingMatches() const;
%Docstring
Returns a list of matches for each point on the captureCurve.
%End
virtual void cadCanvasMoveEvent( QgsMapMouseEvent *e );
virtual void cadCanvasReleaseEvent( QgsMapMouseEvent *e );
virtual void keyPressEvent( QKeyEvent *e );
%Docstring
Intercept key events like Esc or Del to delete the last point
:param e: key event
%End
void deleteTempRubberBand();
%Docstring
Clean a temporary rubberband
%End
virtual void clean();
%Docstring
convenient method to clean members
%End
QgsRubberBand *takeRubberBand() /Factory/;
%Docstring
Returns the rubberBand currently owned by this map tool and transfers
ownership to the caller.
May be ``None``.
.. versionadded:: 3.8
%End
QgsPoint mapPoint( const QgsMapMouseEvent &e ) const;
%Docstring
Creates a :py:class:`QgsPoint` with ZM support if necessary (according
to the WkbType of the current layer). If the point is snapped, then the
Z value is derived from the snapped point.
:param e: A mouse event
:return: a point with ZM support if necessary
%End
QgsPoint mapPoint( const QgsPointXY &point ) const;
%Docstring
Creates a :py:class:`QgsPoint` with ZM support if necessary (according
to the WkbType of the current layer).
:param point: A point in 2D
:return: a point with ZM support if necessary
%End
public slots:
void setCircularDigitizingEnabled( bool enable ) /Deprecated/;
%Docstring
Enable the digitizing with curve
.. deprecated:: 3.26
Use :py:func:`~QgsMapToolCapture.setCurrentCaptureTechnique` instead.
%End
void setStreamDigitizingEnabled( bool enable ) /Deprecated/;
%Docstring
Toggles the stream digitizing mode.
.. versionadded:: 3.20
.. deprecated:: 3.26
Use :py:func:`~QgsMapToolCapture.setCurrentCaptureTechnique` instead.
%End
protected:
int nextPoint( const QgsPoint &mapPoint, QgsPoint &layerPoint );
%Docstring
Converts a map point to layer coordinates
:param mapPoint: the point in map coordinates
:param layerPoint: the point in layer coordinates
:return: 0 in case of success 1 if the current layer is ``None`` 2 if
the transformation failed
%End
int nextPoint( QPoint p, QgsPoint &layerPoint, QgsPoint &mapPoint );
%Docstring
Converts a point to map coordinates and layer coordinates
:param p: the input point
:param layerPoint: the point in layer coordinates
:param mapPoint: the point in map coordinates
:return: 0 in case of success 1 if the current layer is ``None`` or not
a vector layer 2 if the transformation failed
%End
int fetchLayerPoint( const QgsPointLocator::Match &match, QgsPoint &layerPoint );
%Docstring
Fetches the original point from the source layer if it has the same CRS
as the current layer. If topological editing is activated, the points
are projected to the current layer CRS.
:return: 0 in case of success 1 if not applicable (CRS mismatch /
invalid layer) 2 in case of failure
%End
int addVertex( const QgsPointXY &point );
%Docstring
Adds a point to the rubber band (in map coordinates) and to the capture
list (in layer coordinates)
:return: 0 in case of success, 2 if coordinate transformation failed
%End
int addVertex( const QgsPointXY &mapPoint, const QgsPointLocator::Match &match );
%Docstring
Variant to supply more information in the case of snapping
:param mapPoint: The vertex to add in map coordinates
:param match: Data about the snapping match. Can be an invalid match, if
point not snapped.
%End
void undo( bool isAutoRepeat = false );
%Docstring
Removes the last vertex from mRubberBand and mCaptureList.
Since QGIS 3.20, if ``isAutoRepeat`` is set to ``True`` then the undo
operation will be treated as a auto repeated undo as if the user has
held down the undo key for an extended period of time.
%End
void startCapturing();
%Docstring
Start capturing
%End
bool isCapturing() const;
%Docstring
Are we currently capturing?
:return: Is the tool in capture mode?
%End
int size();
%Docstring
Number of points digitized
:return: Number of points
%End
QVector<QgsPointXY> points() const /Deprecated/;
%Docstring
List of digitized points
:return: List of points
.. deprecated:: 3.12
Will be removed in QGIS 4.0. Use the variant returns :py:class:`QgsPoint` objects instead of :py:class:`QgsPointXY`.
%End
QgsPointSequence pointsZM() const;
%Docstring
List of digitized points
:return: List of points
.. versionadded:: 3.12
%End
void setPoints( const QVector<QgsPointXY> &pointList ) /Deprecated/;
%Docstring
Set the points on which to work
:param pointList: A list of points
.. deprecated:: 3.12
Will be removed in QGIS 4.0. Use the variant which accepts :py:class:`QgsPoint` objects instead of :py:class:`QgsPointXY`.
%End
void setPoints( const QgsPointSequence &pointList );
%Docstring
Set the points on which to work
:param pointList: A list of points
.. versionadded:: 3.12
%End
void closePolygon();
%Docstring
Close an open polygon
%End
virtual void geometryCaptured( const QgsGeometry &geometry );
%Docstring
Called when the geometry is captured.
A more specific handler is also called afterwards
(:py:func:`~QgsMapToolCapture.pointCaptured`,
:py:func:`~QgsMapToolCapture.lineCaptured` or
:py:func:`~QgsMapToolCapture.polygonCaptured`).
.. versionadded:: 3.26
%End
virtual void pointCaptured( const QgsPoint &point );
%Docstring
Called when a point is captured.
The generic :py:func:`~QgsMapToolCapture.geometryCaptured` method will
be called immediately before this point-specific method.
.. versionadded:: 3.26
%End
virtual void lineCaptured( const QgsCurve *line );
%Docstring
Called when a line is captured
The generic :py:func:`~QgsMapToolCapture.geometryCaptured` method will
be called immediately before this line-specific method.
.. versionadded:: 3.26
%End
virtual void polygonCaptured( const QgsCurvePolygon *polygon );
%Docstring
Called when a polygon is captured.
The generic :py:func:`~QgsMapToolCapture.geometryCaptured` method will
be called immediately before this polygon-specific method.
.. versionadded:: 3.26
%End
protected slots:
void stopCapturing();
%Docstring
Stop capturing
%End
};
QFlags<QgsMapToolCapture::Capability> operator|(QgsMapToolCapture::Capability f1, QFlags<QgsMapToolCapture::Capability> f2);
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/maptools/qgsmaptoolcapture.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|