sec_interp.sec_interp_plugin module

class sec_interp.sec_interp_plugin.SecInterp(iface: Any)[source]

Bases: object

QGIS Plugin Implementation for Geological Data Extraction.

This class implements the main logic of the SecInterp plugin, handling initialization, UI integration, and orchestration of data processing tasks. It connects the QGIS interface with the plugin’s dialog and processing algorithms.

__init__(iface: Any) None[source]

Initialize the plugin.

Parameters:

iface (QgsInterface) – An interface instance that will be passed to this class which provides the hook by which you can manipulate the QGIS application at run time.

add_action(icon_path: str, text: str, callback: Any, enabled_flag: bool = True, add_to_menu: bool = True, add_to_toolbar: bool = True, status_tip: str | None = None, whats_this: str | None = None, parent: Any = None) qgis.PyQt.QtWidgets.QAction[source]

Add a toolbar icon to the toolbar.

Parameters:
  • icon_path (str) – Path to the icon for this action.

  • text (str) – Text that should be shown in menu items for this action.

  • callback (function) – Function to be called when the action is triggered.

  • enabled_flag (bool) – A flag indicating if the action should be enabled by default. Defaults to True.

  • add_to_menu (bool) – Flag indicating whether the action should also be added to the menu. Defaults to True.

  • add_to_toolbar (bool) – Flag indicating whether the action should also be added to the toolbar. Defaults to True.

  • status_tip (str) – Optional text to show in a popup when mouse pointer hovers over the action.

  • whats_this (str) – Optional text to show in the status bar when the mouse pointer hovers over the action.

  • parent (QWidget) – Parent widget for the new action. Defaults None.

Returns:

The action that was created. Note that the action is also

added to self.actions list.

Return type:

QAction

draw_preview(topo_data: list, geol_data: list | None = None, struct_data: list | None = None, drillhole_data: list | None = None, max_points: int = 1000, **kwargs) None[source]

Draw enhanced interactive preview using native PyQGIS renderer.

Parameters:
  • topo_data – List of (dist, elev) tuples for topographic profile

  • geol_data – Optional list of (dist, elev, geology_name) tuples

  • struct_data – Optional list of (dist, app_dip) tuples

  • drillhole_data – Optional list of (hole_id, traces, segments) tuples

  • max_points (int) – Maximum number of points for simplified preview (LOD)

  • **kwargs – Additional arguments passed to renderer (e.g. preserve_extent)

initGui() None[source]

Create the menu entries and toolbar icons inside the QGIS GUI.

process_data(inputs: dict[str, Any] | None = None) tuple[Any, Any, Any] | None[source]

Process profile data by delegating to the dialog’s preview manager.

Parameters:

inputs – Pre-validated inputs (optional)

Returns:

Tuple of (profile_data, geol_data, struct_data) or None

run() None[source]

Run method that performs all the real work.

save_profile_line() None[source]

Save profile data by delegating to the dialog’s export manager.

tr(message: str) str[source]

Get the translation for a string using Qt translation API.

We implement this ourselves since we do not inherit QObject.

Parameters:

message (str) – String for translation.

Returns:

Translated string (or original if no translation found).

Return type:

str

unload() None[source]

Remove the plugin menu item and icon from QGIS GUI.