sec_interp.gui.dialog_tool_manager module
Map tool management module for SecInterp main dialog.
This module handles the initialization and orchestration of map tools (pan, measure) used in the preview canvas.
Bases:
objectHandles navigation events (zooming) for the preview canvas.
Initialize navigation manager.
- Parameters:
canvas – The preview map canvas to navigate.
Handle mouse wheel for zooming in preview canvas.
- Parameters:
event – The mouse wheel event.
- Returns:
True if event was handled, False otherwise.
- Return type:
bool
- class sec_interp.gui.dialog_tool_manager.ToolManager(canvas: Any, preview_widget: Any, translate: Callable[[str], str], on_interpretation_finished: Callable[[Any], None], update_measurement_display: Callable[[dict], None], pan_tool: QgsMapTool | None = None, measure_tool: ProfileMeasureTool | None = None, interpretation_tool: ProfileInterpretationTool | None = None)
Bases:
objectManages map tools and related event handling for the preview canvas.
- __init__(canvas: Any, preview_widget: Any, translate: Callable[[str], str], on_interpretation_finished: Callable[[Any], None], update_measurement_display: Callable[[dict], None], pan_tool: QgsMapTool | None = None, measure_tool: ProfileMeasureTool | None = None, interpretation_tool: ProfileInterpretationTool | None = None) None
Initialize tool manager with its collaborators.
- Parameters:
canvas – The preview map canvas the tools operate on.
preview_widget – The preview widget (buttons, results area).
translate – Translation function (dialog
tr).on_interpretation_finished – Callback for finished polygons.
update_measurement_display – Callback to display measurements.
pan_tool – Optional pan tool for injection.
measure_tool – Optional measure tool for injection.
interpretation_tool – Optional interpretation tool for injection.
- activate_default_tool() None
Set the default (pan) tool.
- connect_signals() None
Connect map tool signals idempotently.
- disconnect_signals() None
Disconnect all signals to prevent memory leaks.
- initialize_tools() None
Create and configure map tools if not already provided.
- toggle_interpretation_tool(checked: bool) None
Toggle between interpretation and pan tools.
- Parameters:
checked – True to activate interpretation tool, False for pan tool.
- toggle_measure_tool(checked: bool) None
Toggle between measurement and pan tools.
- Parameters:
checked – True to activate measure tool, False for pan tool.
- update_measurement_display(metrics: dict[str, Any]) None
Display measurement results from multi-point tool.
- Parameters:
metrics – Dictionary containing measurement data.