sec_interp.gui package¶
Subpackages¶
Submodules¶
- sec_interp.gui.legend_widget module
- sec_interp.gui.main_dialog module
SecInterpDialogSecInterpDialog.ifaceSecInterpDialog.plugin_instanceSecInterpDialog.messagebarSecInterpDialog.__init__()SecInterpDialog.wheelEvent()SecInterpDialog.open_help()SecInterpDialog.toggle_measure_tool()SecInterpDialog.update_measurement_display()SecInterpDialog.update_preview_checkbox_states()SecInterpDialog.update_button_state()SecInterpDialog.get_selected_values()SecInterpDialog.get_preview_options()SecInterpDialog.update_preview_from_checkboxes()SecInterpDialog.preview_profile_handler()SecInterpDialog.export_preview()SecInterpDialog.accept_handler()SecInterpDialog.reject_handler()SecInterpDialog.validate_inputs()SecInterpDialog.clear_cache_handler()SecInterpDialog.get_layer_names_by_type()SecInterpDialog.get_layer_names_by_geometry()SecInterpDialog.getThemeIcon()
- sec_interp.gui.main_dialog_cache_handler module
- sec_interp.gui.main_dialog_config module
DialogDefaultsDialogDefaults.SCALEDialogDefaults.VERTICAL_EXAGGERATIONDialogDefaults.DIP_SCALEDialogDefaults.DIP_SCALE_FACTORDialogDefaults.BUFFER_DISTANCEDialogDefaults.SAMPLING_INTERVALDialogDefaults.DPIDialogDefaults.PREVIEW_WIDTHDialogDefaults.PREVIEW_HEIGHTDialogDefaults.EXPORT_QUALITYDialogDefaults.BACKGROUND_COLORDialogDefaults.GRID_COLORDialogDefaults.DEFAULT_BANDDialogDefaults.SUPPORTED_IMAGE_FORMATSDialogDefaults.SUPPORTED_VECTOR_FORMATSDialogDefaults.SUPPORTED_DOCUMENT_FORMATS
DialogConfigDialogConfig.ENABLE_CACHEDialogConfig.CACHE_EXPIRY_SECONDSDialogConfig.ENABLE_PERFORMANCE_METRICSDialogConfig.SHOW_METRICS_IN_RESULTSDialogConfig.LOG_DETAILED_METRICSDialogConfig.AUTO_SAVE_SETTINGSDialogConfig.SHOW_HELP_ON_STARTDialogConfig.ENABLE_TOOLTIPSDialogConfig.STRICT_VALIDATIONDialogConfig.ALLOW_EMPTY_GEOLOGYDialogConfig.ALLOW_EMPTY_STRUCTURESDialogConfig.AUTO_REFRESH_PREVIEWDialogConfig.SHOW_LEGENDDialogConfig.ENABLE_ZOOMDialogConfig.MAX_PREVIEW_POINTSDialogConfig.ENABLE_LODDialogConfig.VERBOSE_LOGGINGDialogConfig.LOG_PERFORMANCE
ValidationMessagesValidationMessages.MISSING_RASTERValidationMessages.MISSING_SECTION_LINEValidationMessages.MISSING_OUTPUT_PATHValidationMessages.INVALID_RASTERValidationMessages.INVALID_SECTION_LINEValidationMessages.INVALID_OUTPUT_PATHValidationMessages.WRONG_GEOMETRY_TYPEValidationMessages.EMPTY_LAYERValidationMessages.INVALID_GEOMETRYValidationMessages.MISSING_FIELDValidationMessages.INVALID_FIELD_TYPEValidationMessages.MISSING_OUTCROP_LAYERValidationMessages.MISSING_OUTCROP_FIELDValidationMessages.MISSING_STRUCTURAL_LAYERValidationMessages.MISSING_DIP_FIELDValidationMessages.MISSING_STRIKE_FIELDValidationMessages.VALIDATION_FAILEDValidationMessages.UNKNOWN_ERROR
UIConstantsUIConstants.MIN_PREVIEW_WIDTHUIConstants.MIN_PREVIEW_HEIGHTUIConstants.MAX_PREVIEW_WIDTHUIConstants.MAX_PREVIEW_HEIGHTUIConstants.ICON_HELPUIConstants.ICON_REFRESHUIConstants.ICON_EXPORTUIConstants.ICON_CLEARUIConstants.STATUS_OKUIConstants.STATUS_ERRORUIConstants.STATUS_WARNINGUIConstants.REQUIRED_INDICATORUIConstants.REQUIRED_COLOR
- sec_interp.gui.main_dialog_data module
- sec_interp.gui.main_dialog_export 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_utils module
- sec_interp.gui.main_dialog_validation module
- sec_interp.gui.parallel_geology module
- sec_interp.gui.preview_axes_manager module
- sec_interp.gui.preview_layer_factory module
PreviewLayerFactoryPreviewLayerFactory.GEOLOGY_COLORSPreviewLayerFactory.__init__()PreviewLayerFactory.get_color_for_unit()PreviewLayerFactory.create_memory_layer()PreviewLayerFactory.create_topo_layer()PreviewLayerFactory.create_geol_layer()PreviewLayerFactory.create_struct_layer()PreviewLayerFactory.create_drillhole_trace_layer()PreviewLayerFactory.create_drillhole_interval_layer()PreviewLayerFactory.interpolate_elevation()
- sec_interp.gui.preview_legend_renderer module
- sec_interp.gui.preview_optimizer module
- sec_interp.gui.preview_renderer module
- sec_interp.gui.utils module
Module contents¶
GUI module for SecInterp plugin.
Contains dialogs, widgets, and rendering components.
- class sec_interp.gui.PreviewRenderer(canvas: qgis.gui.QgsMapCanvas | None = None)¶
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.
Initialize preview renderer.
- Parameters:
canvas – QgsMapCanvas instance (optional)
- __init__(canvas: qgis.gui.QgsMapCanvas | None = None)¶
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)¶
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) bool¶
Export preview to image file. Maintains same logic but orchestrated.
- render(topo_data: list[tuple[float, float]], geol_data: list[GeologySegment] | None = None, struct_data: list[StructureMeasurement] | 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, **kwargs) Tuple[qgis.gui.QgsMapCanvas | None, List]¶
Render preview with all data layers.
- class sec_interp.gui.SecInterpDialog(*args: Any, **kwargs: Any)¶
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
Constructor.
- __init__(iface=None, plugin_instance=None, parent=None)¶
Constructor.
- accept_handler()¶
Handle the accept button click event.
- clear_cache_handler()¶
Clear cached data and notify user.
- export_preview()¶
Export the current preview to a file using ExportManager.
- getThemeIcon(name)¶
Get a theme icon via DialogEntityManager.
- get_layer_names_by_geometry(geometry_type) list[str]¶
Get layer names by geometry.
- get_layer_names_by_type(layer_type) list[str]¶
Get layer names by type.
- get_preview_options()¶
Return the state of preview layer checkboxes.
- Returns:
Keys ‘show_topo’, ‘show_geol’, ‘show_struct’ with boolean values.
- Return type:
dict
- get_selected_values()¶
Get the selected values from the dialog.
- Returns:
Dictionary with all dialog values in legacy flat format
- open_help()¶
Open the help file in the default browser.
- preview_profile_handler()¶
Generate a quick preview with topographic, geological, and structural data.
This method delegates to PreviewManager for preview generation.
- reject_handler()¶
Handle the reject button click event.
- toggle_measure_tool(checked)¶
Toggle measurement tool.
- update_button_state()¶
Enable or disable buttons via status_manager.
- update_measurement_display(dx, dy, dist, slope)¶
Display measurement results.
- update_preview_checkbox_states()¶
Enable or disable preview checkboxes via status_manager.
- update_preview_from_checkboxes()¶
Update preview when checkboxes change.
This method delegates to PreviewManager for preview updates.
- validate_inputs()¶
Validate the inputs from the dialog.
This method delegates to DialogValidator for input validation.
- wheelEvent(event)¶
Handle mouse wheel for zooming in preview.