sec_interp.core.services.preview_service module

class sec_interp.core.services.preview_service.PreviewService(controller: Any)[source]

Bases: object

Orchestrates preview data generation.

__init__(controller: Any)[source]

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[source]

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.

generate_all(params: PreviewParams, transform_context: Any, skip_drillholes: bool = False) PreviewResult[source]

Generate all preview components in a consolidated result.

Parameters:
  • params – Validated parameters for preview generation.

  • transform_context – QgsCoordinateTransformContext for CRS operations.

  • skip_drillholes – If True, skips synchronous drillhole generation.

Returns:

A consolidated object containing all generated preview data.