sec_interp.gui.tools.interpretation_tool module

Interpretation tool for Profile View.

This module provides the ProfileInterpretationTool for drawing interpretation polygons in the profile preview window.

class sec_interp.gui.tools.interpretation_tool.ProfileInterpretationTool(*args: Any, **kwargs: Any)

Bases: QgsMapToolEmitPoint

Tool for drawing interpretation polygons on the profile canvas.

  • Left Click: Add vertex

  • Move: Update preview rubber band

  • Right Click: Remove last vertex

  • Enter/Double Click: Finalize polygon

  • Escape: Cancel

__init__(canvas: qgis.gui.QgsMapCanvas) None

Initialize the profile interpretation tool.

Parameters:

canvas – The map canvas where interpretation is drawn.

activate() None

Activate the interpretation tool.

canvasDoubleClickEvent(event: Any) None

Finalize polygon on double click.

Parameters:

event – Map tool event from QGIS

canvasMoveEvent(event: Any) None

Handle mouse move for rubber band update.

Parameters:

event – Map tool event from QGIS

canvasReleaseEvent(event: Any) None

Handle mouse click release.

Parameters:

event – Map tool event from QGIS

deactivate() None

Deactivate the interpretation tool.

finalize_polygon() None

Finalize the polygon and emit signal.

keyPressEvent(event: Any) None

Handle keyboard events.

Parameters:

event – Key event from QGIS

polygonFinished

alias of InterpretationPolygon

reset() None

Reset the tool state safely.

class sec_interp.gui.tools.interpretation_tool.ProfileSnapper(canvas: qgis.gui.QgsMapCanvas)

Bases: object

Helper class to handle point snapping functionality.

Duplicates logic from ProfileMeasureTool to avoid tight coupling.

__init__(canvas: qgis.gui.QgsMapCanvas) None

Initialize the profile snapper.

Parameters:

canvas – The map canvas to snap on.

snap(mouse_pos: qgis.PyQt.QtCore.QPoint) qgis.core.QgsPointXY

Find the nearest vertex or edge to the mouse position.