Class: QgsMapToolCaptureLayerGeometry¶
Base class for map tools digitizing layer geometries.
This map tool subclass automatically handles intersection avoidance with other layers in the active project whenever a geometry is digitized by the user.
Added in version 3.26.
Class Hierarchy¶
Base classes¶
Base class for map tools capable of capturing point, lines and polygons. |
|
A |
|
Base class for map tools that edit vector geometry. |
|
Abstract base class for all map tools. |
|
Subclasses¶
This tool digitizes geometry of new point/line/polygon features on already existing vector layers. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsMapToolCaptureLayerGeometry. See the FAQ for more details.
Called when the geometry is captured. |
|
Called when a line is captured. |
|
Called when a point is captured. |
|
Called when a polygon is captured. |
- class qgis.gui.QgsMapToolCaptureLayerGeometry[source]¶
Bases:
QgsMapToolCapture
- __init__(canvas: QgsMapCanvas | None, cadDockWidget: QgsAdvancedDigitizingDockWidget | None, mode: QgsMapToolCapture.CaptureMode)
Constructor
- Parameters:
canvas (Optional[QgsMapCanvas])
cadDockWidget (Optional[QgsAdvancedDigitizingDockWidget])
- virtual layerGeometryCaptured(self, geometry: QgsGeometry)[source]¶
Called when the geometry is captured.
A more specific handler is also called afterwards (
layerPointCaptured()
,layerLineCaptured()
orlayerPolygonCaptured()
).- Parameters:
geometry (QgsGeometry)
- virtual layerLineCaptured(self, line: QgsCurve | None)[source]¶
Called when a line is captured.
The generic
layerGeometryCaptured()
method will be called immediately before this line-specific method.- Parameters:
line (Optional[QgsCurve])
- virtual layerPointCaptured(self, point: QgsPoint)[source]¶
Called when a point is captured.
The generic
layerGeometryCaptured()
method will be called immediately before this point-specific method.- Parameters:
point (QgsPoint)
- virtual layerPolygonCaptured(self, polygon: QgsCurvePolygon | None)[source]¶
Called when a polygon is captured.
The generic
layerGeometryCaptured()
method will be called immediately before this polygon-specific method.- Parameters:
polygon (Optional[QgsCurvePolygon])