# sec_interp.gui.preview_layer_factory module

Factory for creating and styling QGIS memory layers for the preview.

class sec_interp.gui.preview_layer_factory.PreviewLayerFactory

  Bases: `object`

  Factory for creating and styling QGIS memory layers for the preview.

  __init__() → None

    Initialize the layer factory with specialized renderers.

  property active_units: dict[str, Any]

    Compatibility property for active geological units.

  create_drillhole_interval_layer(drillhole_data: list, vert_exag: float = 1.0) → QgsVectorLayer | None

    Create temporary layer for drillhole intervals.

  create_drillhole_trace_layer(drillhole_data: list, vert_exag: float = 1.0) → QgsVectorLayer | None

    Create temporary layer for drillhole traces.

  create_geol_layer(geol_data: GeologyData, vert_exag: float = 1.0, max_points: int = 1000) → QgsVectorLayer | None

    Create temporary layer for geological profile.

  create_interp_layer(interp_data: list[InterpretationPolygon], vert_exag: float = 1.0) → QgsVectorLayer | None

    Create a memory layer for interpretation polygons.

  create_memory_layer(geometry_type: str, name: str, fields: str | None = None) → tuple[QgsVectorLayer | None, QgsVectorDataProvider | None]

    Create a memory layer with project CRS.

    Parameters:

      - geometry_type – Geometry type (e.g., “Point”, “LineString”).

      - name – Display name for the layer.

      - fields – Optional field definition URI string.

    Returns:

      Tuple of (Layer, DataProvider).

  create_struct_layer(struct_data: StructureData, reference_data: ProfileData, vert_exag: float = 1.0, dip_line_length: float | None = None) → QgsVectorLayer | None

    Create temporary layer for structural dips.

  create_topo_fill_layer(topo_data: ProfileData, vert_exag: float = 1.0, max_points: int = 1000, base_elevation: float | None = None) → QgsVectorLayer | None

    Create a solid ‘curtain’ fill layer under the topography for depth.

  create_topo_layer(topo_data: ProfileData, vert_exag: float = 1.0, max_points: int = 1000, use_adaptive_sampling: bool = False) → QgsVectorLayer | None

    Create temporary layer for topographic profile with polychromatic elevation styling.

  get_color_for_unit(name: str) → qgis.PyQt.QtGui.QColor

    Get a consistent color for a geological unit based on its name.

  interpolate_elevation(reference_data: list[tuple[float, float]], target_dist: float) → float

    Interpolate elevation at a given distance.