sec_interp.core.services.preview_service module
Service for managing preview generation and rendering.
This module provides a service to orchestrate the synchronous generation of topography and structure preview components. Drillholes are generated asynchronously via the GUI task orchestrator. It remains decoupled from the GUI layer.
- class sec_interp.core.services.preview_service.PreviewService(controller: Any)
Bases:
objectOrchestrates preview data generation.
- __init__(controller: Any) None
Initialize with plugin controller to access other services.
- Parameters:
controller – The SecInterpController instance.
- static calculate_max_points(canvas_width: int, manual_max: int = 1000, auto_lod: bool = True, ratio: float = 1.0) int
Calculate the optimal number of points for rendering.
- Parameters:
canvas_width – Current width of the preview canvas in pixels.
manual_max – User-specified maximum points for plotting.
auto_lod – Whether to use automatic level of detail (LOD).
ratio – Current zoom ratio (full_extent / current_extent).
- Returns:
The optimal number of points to use for 2D rendering.
- property drillhole_service: Any
Expose drillhole service from controller.
- generate_all(params: PreviewParams, transform_context: Any) PreviewResult
Generate all preview components in a consolidated result.
- Parameters:
params – Validated parameters for preview generation.
transform_context – QgsCoordinateTransformContext for CRS operations.
- Returns:
A consolidated object containing all generated preview data.
- property geology_service: Any
Expose geology service from controller.
- property structure_service: Any
Expose structure service from controller.