This commit is contained in:
Denis Rouzaud 2022-01-13 16:05:51 +01:00
parent 7c905091a0
commit e37e985b58
4 changed files with 133 additions and 62 deletions

View File

@ -672,69 +672,133 @@ Returns the Hide Deselected Layers action.
virtual QAction *actionCheckQgisVersion() = 0;
virtual QAction *actionAbout() = 0;
virtual QAction *actionCircle2Points() = 0;
virtual QAction *actionCircle2Points() /Deprecated/;
%Docstring
Returns the native add circle from 2 points action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionCircle3Points() = 0;
virtual QAction *actionCircle3Points() /Deprecated/;
%Docstring
Returns the native add circle from 3 points action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionCircle3Tangents() = 0;
virtual QAction *actionCircle3Tangents() /Deprecated/;
%Docstring
Returns the native add circle from 3 tangents action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionCircle2TangentsPoint() = 0;
virtual QAction *actionCircle2TangentsPoint() /Deprecated/;
%Docstring
Returns the native add circle from 2 tangents and a point action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionCircleCenterPoint() = 0;
virtual QAction *actionCircleCenterPoint() /Deprecated/;
%Docstring
Returns the native add circle from center action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionEllipseCenter2Points() = 0;
virtual QAction *actionEllipseCenter2Points() /Deprecated/;
%Docstring
Returns the native add ellipse from center and 2 points action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionEllipseCenterPoint() = 0;
virtual QAction *actionEllipseCenterPoint() /Deprecated/;
%Docstring
Returns the native add ellipse from center and a point action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionEllipseExtent() = 0;
virtual QAction *actionEllipseExtent() /Deprecated/;
%Docstring
Returns the native add ellipse from an extent action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionEllipseFoci() = 0;
virtual QAction *actionEllipseFoci() /Deprecated/;
%Docstring
Returns the native add ellipse from foci action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionRectangleCenterPoint() = 0;
virtual QAction *actionRectangleCenterPoint() /Deprecated/;
%Docstring
Returns the native add rectangle from center and a point action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionRectangleExtent() = 0;
virtual QAction *actionRectangleExtent() /Deprecated/;
%Docstring
Returns the native add rectangle from extent action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionRectangle3PointsDistance() = 0;
virtual QAction *actionRectangle3PointsDistance() /Deprecated/;
%Docstring
Returns the native add rectangle from 3 points (distance from 2nd and 3rd points) action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionRectangle3PointsProjected() = 0;
virtual QAction *actionRectangle3PointsProjected() /Deprecated/;
%Docstring
Returns the native add rectangle from 3 points (distance from projected 3rd point on segment p1 and p2) action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionRegularPolygon2Points() = 0;
virtual QAction *actionRegularPolygon2Points() /Deprecated/;
%Docstring
Returns the native add regular polygon from 2 points action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionRegularPolygonCenterPoint() = 0;
virtual QAction *actionRegularPolygonCenterPoint() /Deprecated/;
%Docstring
Returns the native add regular polygon from center and a point action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QAction *actionRegularPolygonCenterCorner() = 0;
virtual QAction *actionRegularPolygonCenterCorner() /Deprecated/;
%Docstring
Returns the native add regular polygon from center and a corner action. Call :py:func:`~QgisInterface.trigger` on it to set the map tool.
.. deprecated:: QGIS 3.24
shape digitizing is now part of the add feature tool
%End
virtual QgsVectorLayerTools *vectorLayerTools() = 0;

View File

@ -261,6 +261,11 @@ The default implementation does nothing and returns false.
is present in :py:func:`~QgsMapTool.flags`.
.. versionadded:: 3.18
%End
QgsPointXY toMapCoordinates( QPoint point );
%Docstring
Transforms a ``point`` from screen coordinates to map coordinates.
%End
signals:
@ -289,11 +294,6 @@ signal emitted once the map tool is deactivated
QgsMapTool( QgsMapCanvas *canvas /TransferThis/ );
%Docstring
Constructor takes a map canvas as a parameter.
%End
QgsPointXY toMapCoordinates( QPoint point );
%Docstring
Transforms a ``point`` from screen coordinates to map coordinates.
%End
QgsPoint toLayerCoordinates( const QgsMapLayer *layer, const QgsPoint &point ) /PyName=toLayerCoordinatesV2/;

View File

@ -11,7 +11,6 @@
class QgsMapToolCapture : QgsMapToolAdvancedDigitizing
{
%Docstring(signature="appended")
@ -71,6 +70,14 @@ Returns ``True`` if the tool supports the specified capture ``technique``.
.. versionadded:: 3.20
%End
void setCurrentCaptureTechnique( CaptureTechnique technique );
%Docstring
Sets the current capture if it is supported by the map tool
.. versionadded:: 3.24
%End
virtual void activate();
virtual void deactivate();
@ -111,6 +118,8 @@ Returns a list of matches for each point on the captureCurve.
virtual void cadCanvasMoveEvent( QgsMapMouseEvent *e );
virtual void cadCanvasReleaseEvent( QgsMapMouseEvent *e );
virtual void keyPressEvent( QKeyEvent *e );
@ -139,6 +148,34 @@ transfers ownership to the caller.
.. 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 took from the snapped point.
:param e: A mouse event
:return: a point with ZM support if necessary
.. versionadded:: 3.0
%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
.. versionadded:: 3.0
%End
public slots:
void setCircularDigitizingEnabled( bool enable ) /Deprecated/;
@ -159,13 +196,6 @@ Toggles the stream digitizing mode.
use :py:func:`~QgsMapToolCapture.setCurrentCaptureTechnique` instead
%End
void setCurrentCaptureTechnique( CaptureTechnique technique );
%Docstring
Sets the current capture if it is supported by the map tool
.. versionadded:: 3.24
%End
protected:
@ -208,34 +238,6 @@ CRS as the current layer.
.. versionadded:: 2.14
%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 took from the snapped point.
:param e: A mouse event
:return: a point with ZM support if necessary
.. versionadded:: 3.0
%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
.. versionadded:: 3.0
%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)
@ -360,9 +362,6 @@ geometryCaptured is called just before
.. versionadded:: 3.24
%End
public:
virtual void cadCanvasReleaseEvent( QgsMapMouseEvent *e );
};
QFlags<QgsMapToolCapture::Capability> operator|(QgsMapToolCapture::Capability f1, QFlags<QgsMapToolCapture::Capability> f2);

View File

@ -35,6 +35,16 @@ Returns default M value.
Used for setting M coordinate to new vertex.
.. versionadded:: 3.20
%End
QgsGeometryRubberBand *createGeometryRubberBand( QgsWkbTypes::GeometryType geometryType = QgsWkbTypes::LineGeometry, bool alternativeBand = false ) const /Factory/;
%Docstring
Creates a geometry rubber band with the color/line width from
the QGIS settings. The caller takes ownership of the
returned object
:param geometryType:
:param alternativeBand: if ``True``, rubber band will be set with more transparency and a dash pattern. default is ``False``.
%End
protected:
@ -62,8 +72,6 @@ returned object
:param alternativeBand: if ``True``, rubber band will be set with more transparency and a dash pattern. default is ``False``.
%End
QgsGeometryRubberBand *createGeometryRubberBand( QgsWkbTypes::GeometryType geometryType = QgsWkbTypes::LineGeometry, bool alternativeBand = false ) const /Factory/;
QgsVectorLayer *currentVectorLayer();
%Docstring
Returns the current vector layer of the map canvas or 0