sec_interp.gui package

GUI module for SecInterp plugin.

Contains dialogs, widgets, and rendering components.

class sec_interp.gui.PreviewRenderer(canvas: QgsMapCanvas | None = None)

Bases: object

Renders interactive preview using native PyQGIS resources.

Acts as an orchestrator for several specialized modules: - PreviewLayerFactory: Handles layer creation and symbology. - PreviewAxesManager: Handles grid lines and axes labels. - PreviewOptimizer: Handles geometric simplification (LOD). - PreviewLegendRenderer: Handles legend drawing.

__init__(canvas: QgsMapCanvas | None = None) → None

Initialize preview renderer.

Parameters:

canvas – QgsMapCanvas instance (optional)

property active_units: dict[str, Any]

Expose active units from factory for legend compatibility.

cleanup() → None

Remove transient layers from the project and release resources.

Idempotent; safe to call on dialog close and plugin unload to avoid leaking temporary (memory) layers that trigger QGIS’s “scratch layers” warning on exit.

draw_legend(painter: qgis.PyQt.QtGui.QPainter, rect: qgis.PyQt.QtCore.QRectF) → None

Draw legend on the given painter honoring the configured layout.

legend_units() → list[tuple[str, str, Any, bool, str]]

Return (name, label, color, hidden, source) for known units, ordered.

source is "geology" or "drillholes"; a unit present in both is attributed to geology.

render(topo_data: ProfileData, geol_data: GeologyData | None = None, struct_data: StructureData | None = None, vert_exag: float = 1.0, dip_line_length: float | None = None, max_points: int = 1000, preserve_extent: bool = False, use_adaptive_sampling: bool = False, drillhole_data: list | None = None, interp_data: list[InterpretationPolygon] | None = None, topo_color_mode: str = 'gradient', topo_ramp_name: str | None = None, topo_single_color: str | None = None, topo_smooth_data: ProfileData | None = None, layer_styles: dict | None = None, hidden_interp_ids: set[str] | None = None) → tuple[QgsMapCanvas | None, list]

Render preview with all data layers.

class sec_interp.gui.SecInterpDialog(*args: Any, **kwargs: Any)

Bases: DialogLifecycleMixin, DialogMessageMixin, DialogFacadeMixin, SecInterpMainWindow

Dialog for the SecInterp QGIS plugin.

This dialog provides the user interface and helper methods to populate combo boxes with layers from the current QGIS project (raster and vector layers filtered by geometry type). It also exposes the interface and plugin instance for interaction with the host application.

iface

The QGIS interface instance.

Type:

QgsInterface

plugin_instance

The plugin instance that created this dialog.

Type:

SecInterp

messagebar

The message bar widget for notifications.

Type:

QgsMessageBar

__init__(iface=None, plugin_instance=None, parent=None) → None

Initialize the dialog.

open_help() → None

Open the help file in the default browser based on user locale.

show_dialog(title: str, message: str, level: str = 'info') → Any

Show a message box dialog.

Parameters:
  • title – Dialog title.

  • message – Dialog content.

  • level – Message level (“info”, “warning”, “critical”, “question”).

validate_inputs() → bool

Validate the inputs from the dialog via DialogInputManager.

Subpackages

Submodules