# sec_interp.sec_interp_plugin module

Main Plugin Module.

Orchestrates the lifecycle of the SecInterp QGIS plugin.

class sec_interp.sec_interp_plugin.SecInterp(iface)

  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.

  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.

  __init__(iface)

    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.

  tr(message: str) → str

    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

  add_action(icon_path, text, callback, enabled_flag=True, add_to_menu=True, add_to_toolbar=True, status_tip=None, whats_this=None, parent=None)

    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

  initGui()

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

  unload()

    Remove the plugin menu item and icon from QGIS GUI.

  run()

    Run method that performs all the real work.

  process_data(inputs: dict | None = None) → tuple | None

    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

  save_profile_line()

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

  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

    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)