# sec_interp.core.types module

Core data types and enums for SecInterp.

class sec_interp.core.types.FieldType(*values)

  Bases: `IntEnum`

  Core-safe field types mapping to QVariant.Type values.

  This allows the core module to perform type validation WITHOUT direct dependencies on PyQt components.

  NULL = 0
  BOOL = 1
  INT = 2
  DOUBLE = 6
  STRING = 10
  LONG_LONG = 4
  DATE = 14
  DATE_TIME = 16

sec_interp.core.types.LayerDict

  Dictionary mapping layer names to QgsVectorLayer objects.

  alias of `dict`[`str`, `QgsVectorLayer`]

sec_interp.core.types.SettingsDict

  Dictionary of plugin settings and configuration values.

  alias of `dict`[`str`, `Any`]

sec_interp.core.types.ExportSettings

  Dictionary of export configuration parameters.

  alias of `dict`[`str`, `Any`]

sec_interp.core.types.ValidationResult

  Tuple of (is_valid, error_message) from validation functions.

  alias of `tuple`[`bool`, `str`]

sec_interp.core.types.PointList

  List of QgsPointXY objects.

  alias of `list`[`QgsPointXY`]

class sec_interp.core.types.StructureMeasurement(distance: float, elevation: float, apparent_dip: float, original_dip: float, original_strike: float, attributes: dict[str, Any])

  Bases: `object`

  Represents a projected structural measurement on the section plane.

  distance

    Horizontal distance from the start of the profile.

    Type:

      float

  elevation

    Elevation (Z) at the projected point.

    Type:

      float

  apparent_dip

    Dip angle relative to the section plane.

    Type:

      float

  original_dip

    True dip measured in the field.

    Type:

      float

  original_strike

    True strike (azimuth) measured in the field.

    Type:

      float

  attributes

    Dictionary containing original feature attributes.

    Type:

      dict[str, Any]

  distance: float
  elevation: float
  apparent_dip: float
  original_dip: float
  original_strike: float
  attributes: dict[str, Any]

class sec_interp.core.types.GeologySegment(unit_name: str, geometry: qgis.core.QgsGeometry, attributes: dict[str, Any], points: list[tuple[float, float]])

  Bases: `object`

  Represents a geological unit segment along the profile.

  unit_name

    Name of the geological unit.

    Type:

      str

  geometry

    QGIS geometry of the segment.

    Type:

      qgis.core.QgsGeometry

  attributes

    Dictionary containing original feature attributes.

    Type:

      dict[str, Any]

  points

    Sampled points (distance, elevation) representing the segment boundary.

    Type:

      list[tuple[float, float]]

  unit_name: str
  geometry: qgis.core.QgsGeometry
  attributes: dict[str, Any]
  points: list[tuple[float, float]]

class sec_interp.core.types.InterpretationPolygon(id: str, name: str, type: str, vertices_2d: list[tuple[float, float]], attributes: dict[str, ~typing.Any] = <factory>, color: str = '#FF0000', created_at: str = '')

  Bases: `object`

  Represents a 2D digitized interpretation polygon on the section profile.

  id

    Unique identifier for the polygon.

    Type:

      str

  name

    User-defined name for the interpreted unit/feature.

    Type:

      str

  type

    Classification (e.g., ‘lithology’, ‘fault’, ‘alteration’).

    Type:

      str

  vertices_2d

    List of (distance, elevation) points defining the polygon.

    Type:

      list[tuple[float, float]]

  attributes

    Metadata for the interpretation.

    Type:

      dict[str, Any]

  color

    Visual representation color (HEX).

    Type:

      str

  created_at

    ISO timestamp of creation.

    Type:

      str

  id: str
  name: str
  type: str
  vertices_2d: list[tuple[float, float]]
  attributes: dict[str, Any]
  color: str = '#FF0000'
  created_at: str = ''

class sec_interp.core.types.InterpretationPolygon25D(id: str, name: str, type: str, geometry: qgis.core.QgsGeometry, attributes: dict[str, Any], crs: Any)

  Bases: `object`

  Represents a georeferenced 2.5D interpretation geometry (with M coordinates).

  id

    Inherited identifier.

    Type:

      str

  name

    Inherited name.

    Type:

      str

  type

    Inherited type.

    Type:

      str

  geometry

    QGIS Geometry (PolygonM or LineStringM).

    Type:

      qgis.core.QgsGeometry

  attributes

    Inherited and calculated attributes.

    Type:

      dict[str, Any]

  crs

    Coordinate Reference System of the geometry.

    Type:

      Any

  id: str
  name: str
  type: str
  geometry: qgis.core.QgsGeometry
  attributes: dict[str, Any]
  crs: Any

class sec_interp.core.types.PreviewParams(raster_layer: QgsRasterLayer, line_layer: QgsVectorLayer, band_num: int, buffer_dist: float = 100.0, outcrop_layer: QgsVectorLayer | None = None, outcrop_name_field: str | None = None, struct_layer: QgsVectorLayer | None = None, dip_field: str | None = None, strike_field: str | None = None, dip_scale_factor: float = 1.0, collar_layer: QgsVectorLayer | None = None, collar_id_field: str | None = None, collar_use_geometry: bool = True, collar_x_field: str | None = None, collar_y_field: str | None = None, collar_z_field: str | None = None, collar_depth_field: str | None = None, survey_layer: QgsVectorLayer | None = None, survey_id_field: str | None = None, survey_depth_field: str | None = None, survey_azim_field: str | None = None, survey_incl_field: str | None = None, interval_layer: QgsVectorLayer | None = None, interval_id_field: str | None = None, interval_from_field: str | None = None, interval_to_field: str | None = None, interval_lith_field: str | None = None, max_points: int = 1000, canvas_width: int = 800, auto_lod: bool = True)

  Bases: `object`

  Consolidated parameters for profile generation and preview.

  raster_layer

    QGIS raster layer for DEM sampling.

    Type:

      QgsRasterLayer

  line_layer

    QGIS vector layer for the section orientation.

    Type:

      QgsVectorLayer

  band_num

    Raster band number to use for elevation.

    Type:

      int

  buffer_dist

    Search buffer for projecting data onto the section.

    Type:

      float

  outcrop_layer

    Optional vector layer with geological outcrops.

    Type:

      QgsVectorLayer | None

  outcrop_name_field

    Field name for geological unit names.

    Type:

      str | None

  struct_layer

    Optional vector layer with structural measurements.

    Type:

      QgsVectorLayer | None

  dip_field

    Field name for dip values.

    Type:

      str | None

  strike_field

    Field name for strike/azimuth values.

    Type:

      str | None

  dip_scale_factor

    Visual scale factor for dip lines.

    Type:

      float

  collar_layer

    Optional vector layer with drillhole collars.

    Type:

      QgsVectorLayer | None

  collar_id_field

    Field name for drillhole IDs in collar layer.

    Type:

      str | None

  collar_use_geometry

    Whether to use layer geometry for collar coordinates.

    Type:

      bool

  collar_x_field

    Field name for X coordinate.

    Type:

      str | None

  collar_y_field

    Field name for Y coordinate.

    Type:

      str | None

  collar_z_field

    Field name for Z coordinate.

    Type:

      str | None

  collar_depth_field

    Field name for total hole depth.

    Type:

      str | None

  survey_layer

    Optional vector layer with drillhole surveys.

    Type:

      QgsVectorLayer | None

  survey_id_field

    Field name for drillhole IDs in survey layer.

    Type:

      str | None

  survey_depth_field

    Field name for downhole depth in survey.

    Type:

      str | None

  survey_azim_field

    Field name for azimuth in survey.

    Type:

      str | None

  survey_incl_field

    Field name for inclination in survey.

    Type:

      str | None

  interval_layer

    Optional vector layer with drillhole intervals.

    Type:

      QgsVectorLayer | None

  interval_id_field

    Field name for drillhole IDs in interval layer.

    Type:

      str | None

  interval_from_field

    Field name for ‘from’ depth.

    Type:

      str | None

  interval_to_field

    Field name for ‘to’ depth.

    Type:

      str | None

  interval_lith_field

    Field name for lithology code/name.

    Type:

      str | None

  max_points

    Max number of points for simplified preview (LOD).

    Type:

      int

  canvas_width

    Width of the preview canvas in pixels.

    Type:

      int

  auto_lod

    Whether to automatically adjust LOD based on canvas width.

    Type:

      bool

  raster_layer: QgsRasterLayer
  line_layer: QgsVectorLayer
  band_num: int
  buffer_dist: float = 100.0
  outcrop_layer: QgsVectorLayer | None = None
  outcrop_name_field: str | None = None
  struct_layer: QgsVectorLayer | None = None
  dip_field: str | None = None
  strike_field: str | None = None
  dip_scale_factor: float = 1.0
  collar_layer: QgsVectorLayer | None = None
  collar_id_field: str | None = None
  collar_use_geometry: bool = True
  collar_x_field: str | None = None
  collar_y_field: str | None = None
  collar_z_field: str | None = None
  collar_depth_field: str | None = None
  survey_layer: QgsVectorLayer | None = None
  survey_id_field: str | None = None
  survey_depth_field: str | None = None
  survey_azim_field: str | None = None
  survey_incl_field: str | None = None
  interval_layer: QgsVectorLayer | None = None
  interval_id_field: str | None = None
  interval_from_field: str | None = None
  interval_to_field: str | None = None
  interval_lith_field: str | None = None
  max_points: int = 1000
  canvas_width: int = 800
  auto_lod: bool = True
  validate() → None

    Perform native validation of parameters.

    Raises:

      ValidationError – If critical parameters are missing or invalid.

class sec_interp.core.types.PreviewResult(topo: list[tuple[float, float]] | None = None, geol: list[~sec_interp.core.types.GeologySegment] | None = None, struct: list[~sec_interp.core.types.StructureMeasurement] | None = None, drillhole: ~typing.Any | None = None, metrics: ~sec_interp.core.performance_metrics.MetricsCollector = <factory>, buffer_dist: float = 0.0)

  Bases: `object`

  Consolidated result set from profile generation.

  topo

    Sampled topographic profile data.

    Type:

      list[tuple[float, float]] | None

  geol

    List of geological unit segments.

    Type:

      list[sec_interp.core.types.GeologySegment] | None

  struct

    List of projected structural measurements.

    Type:

      list[sec_interp.core.types.StructureMeasurement] | None

  drillhole

    Processed drillhole projection data.

    Type:

      Any | None

  metrics

    Performance metrics collector for the generation cycle.

    Type:

      sec_interp.core.performance_metrics.MetricsCollector

  buffer_dist

    Buffer distance used for this result.

    Type:

      float

  topo: list[tuple[float, float]] | None = None
  geol: list[GeologySegment] | None = None
  struct: list[StructureMeasurement] | None = None
  drillhole: Any | None = None
  metrics: MetricsCollector
  buffer_dist: float = 0.0
  get_elevation_range() → tuple[float, float]

    Calculate the global minimum and maximum elevation across all layers.

    Returns:

      A tuple containing (min_elevation, max_elevation).

  get_distance_range() → tuple[float, float]

    Calculate the horizontal distance range based on topography.

    Returns:

      A tuple containing (min_distance, max_distance).