sec_interp.gui package
- class sec_interp.gui.PreviewRenderer(canvas: QgsMapCanvas | None = None)[source]
Bases:
objectRenders 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)[source]
Initialize preview renderer.
- Parameters:
canvas – QgsMapCanvas instance (optional)
- property active_units
Expose active units from factory for legend compatibility.
- draw_legend(painter: qgis.PyQt.QtGui.QPainter, rect: qgis.PyQt.QtCore.QRectF)[source]
Draw legend on the given painter. Delegates to PreviewLegendRenderer.
- export_to_image(layers: list, extent, width: int, height: int, output_path: str, dpi: int = 300, show_legend: bool = True) bool[source]
Export preview to image file. Maintains same logic but orchestrated.
- 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, show_legend: bool = True, **kwargs) tuple[QgsMapCanvas | None, list][source]
Render preview with all data layers.
- class sec_interp.gui.SecInterpDialog(*args: Any, **kwargs: Any)[source]
Bases:
SecInterpMainWindowDialog 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
- messagebar
The message bar widget for notifications.
- Type:
QgsMessageBar
- get_preview_options()[source]
Return the state of preview layer checkboxes.
- Returns:
Keys ‘show_topo’, ‘show_geol’, ‘show_struct’ with boolean values.
- Return type:
dict
- get_selected_values()[source]
Get the selected values from the dialog.
- Returns:
Dictionary with all dialog values in legacy flat format
- handle_error(error: Exception, title: str = 'Error')[source]
Centralized error handling for the dialog.
- Parameters:
error – The exception to handle.
title – Title for the error message box.
- property interpretations
Proxy to interpretations in the manager for backward compatibility.
- on_interpretation_finished(interpretation: InterpretationPolygon) None[source]
Handle finalized interpretation polygon.
- preview_profile_handler()[source]
Generate a quick preview with topographic, geological, and structural data.
This method delegates to PreviewManager for preview generation.
- toggle_interpretation_tool(checked: bool) None[source]
Toggle interpretation tool via tool_manager.
- update_measurement_display(metrics: dict[str, Any]) None[source]
Display measurement results from multi-point tool via tool_manager.
- update_preview_from_checkboxes()[source]
Update preview when checkboxes change.
This method delegates to PreviewManager for preview updates.
Subpackages
Submodules
- sec_interp.gui.legend_widget module
- sec_interp.gui.main_dialog module
SecInterpDialogSecInterpDialog.ifaceSecInterpDialog.plugin_instanceSecInterpDialog.messagebarSecInterpDialog.__init__()SecInterpDialog.accept_handler()SecInterpDialog.clear_cache_handler()SecInterpDialog.closeEvent()SecInterpDialog.export_preview()SecInterpDialog.getThemeIcon()SecInterpDialog.get_layer_names_by_geometry()SecInterpDialog.get_layer_names_by_type()SecInterpDialog.get_preview_options()SecInterpDialog.get_selected_values()SecInterpDialog.handle_error()SecInterpDialog.interpretationsSecInterpDialog.on_interpretation_finished()SecInterpDialog.open_help()SecInterpDialog.preview_profile_handler()SecInterpDialog.reject_handler()SecInterpDialog.reset_defaults_handler()SecInterpDialog.toggle_interpretation_tool()SecInterpDialog.toggle_measure_tool()SecInterpDialog.update_button_state()SecInterpDialog.update_measurement_display()SecInterpDialog.update_preview_checkbox_states()SecInterpDialog.update_preview_from_checkboxes()SecInterpDialog.validate_inputs()SecInterpDialog.wheelEvent()
- sec_interp.gui.main_dialog_cache_handler module
- sec_interp.gui.main_dialog_config module
DialogConfigDialogConfig.ALLOW_EMPTY_GEOLOGYDialogConfig.ALLOW_EMPTY_STRUCTURESDialogConfig.AUTO_REFRESH_PREVIEWDialogConfig.AUTO_SAVE_SETTINGSDialogConfig.CACHE_EXPIRY_SECONDSDialogConfig.ENABLE_CACHEDialogConfig.ENABLE_LODDialogConfig.ENABLE_PERFORMANCE_METRICSDialogConfig.ENABLE_TOOLTIPSDialogConfig.ENABLE_ZOOMDialogConfig.LOG_DETAILED_METRICSDialogConfig.LOG_PERFORMANCEDialogConfig.MAX_PREVIEW_POINTSDialogConfig.SHOW_HELP_ON_STARTDialogConfig.SHOW_LEGENDDialogConfig.SHOW_METRICS_IN_RESULTSDialogConfig.STRICT_VALIDATIONDialogConfig.VERBOSE_LOGGING
DialogDefaultsDialogDefaults.BACKGROUND_COLORDialogDefaults.BUFFER_DISTANCEDialogDefaults.DEFAULT_BANDDialogDefaults.DIP_SCALEDialogDefaults.DIP_SCALE_FACTORDialogDefaults.DPIDialogDefaults.EXPORT_QUALITYDialogDefaults.GRID_COLORDialogDefaults.PREVIEW_HEIGHTDialogDefaults.PREVIEW_WIDTHDialogDefaults.SAMPLING_INTERVALDialogDefaults.SCALEDialogDefaults.SUPPORTED_DOCUMENT_FORMATSDialogDefaults.SUPPORTED_IMAGE_FORMATSDialogDefaults.SUPPORTED_VECTOR_FORMATSDialogDefaults.VERTICAL_EXAGGERATION
UIConstantsUIConstants.ICON_CLEARUIConstants.ICON_EXPORTUIConstants.ICON_HELPUIConstants.ICON_REFRESHUIConstants.MAX_PREVIEW_HEIGHTUIConstants.MAX_PREVIEW_WIDTHUIConstants.MIN_PREVIEW_HEIGHTUIConstants.MIN_PREVIEW_WIDTHUIConstants.REQUIRED_COLORUIConstants.REQUIRED_INDICATORUIConstants.STATUS_ERRORUIConstants.STATUS_OKUIConstants.STATUS_WARNING
ValidationMessagesValidationMessages.EMPTY_LAYERValidationMessages.INVALID_FIELD_TYPEValidationMessages.INVALID_GEOMETRYValidationMessages.INVALID_OUTPUT_PATHValidationMessages.INVALID_RASTERValidationMessages.INVALID_SECTION_LINEValidationMessages.MISSING_DIP_FIELDValidationMessages.MISSING_FIELDValidationMessages.MISSING_OUTCROP_FIELDValidationMessages.MISSING_OUTCROP_LAYERValidationMessages.MISSING_OUTPUT_PATHValidationMessages.MISSING_RASTERValidationMessages.MISSING_SECTION_LINEValidationMessages.MISSING_STRIKE_FIELDValidationMessages.MISSING_STRUCTURAL_LAYERValidationMessages.UNKNOWN_ERRORValidationMessages.VALIDATION_FAILEDValidationMessages.WRONG_GEOMETRY_TYPE
- sec_interp.gui.main_dialog_data module
- sec_interp.gui.main_dialog_export module
- sec_interp.gui.main_dialog_interpretation module
- sec_interp.gui.main_dialog_messages module
- sec_interp.gui.main_dialog_preview module
- sec_interp.gui.main_dialog_settings module
- sec_interp.gui.main_dialog_signals module
- sec_interp.gui.main_dialog_status module
- sec_interp.gui.main_dialog_tools module
- sec_interp.gui.main_dialog_utils module
- sec_interp.gui.main_dialog_validation_manager module
- sec_interp.gui.preview_axes_manager module
- sec_interp.gui.preview_layer_factory module
PreviewLayerFactoryPreviewLayerFactory.GEOLOGY_COLORSPreviewLayerFactory.__init__()PreviewLayerFactory.create_drillhole_interval_layer()PreviewLayerFactory.create_drillhole_trace_layer()PreviewLayerFactory.create_geol_layer()PreviewLayerFactory.create_memory_layer()PreviewLayerFactory.create_struct_layer()PreviewLayerFactory.create_topo_fill_layer()PreviewLayerFactory.create_topo_layer()PreviewLayerFactory.get_color_for_unit()PreviewLayerFactory.interpolate_elevation()
- sec_interp.gui.preview_legend_renderer module
- sec_interp.gui.preview_renderer module
- sec_interp.gui.preview_reporter module
- sec_interp.gui.utils module