"""Domain models — GPS, Camera, Geometry."""

from __future__ import annotations

from pydantic import BaseModel, Field


class GPSPoint(BaseModel):
    """WGS-84 coordinate."""

    lat: float = Field(..., ge=-90, le=90, description="Latitude")
    lon: float = Field(..., ge=-180, le=180, description="Longitude")


class CameraParameters(BaseModel):
    """Intrinsic camera parameters."""

    focal_length: float = Field(..., gt=0, description="Focal length in mm")
    sensor_width: float = Field(..., gt=0, description="Sensor width in mm")
    sensor_height: float = Field(..., gt=0, description="Sensor height in mm")
    resolution_width: int = Field(..., gt=0, description="Image width in pixels")
    resolution_height: int = Field(..., gt=0, description="Image height in pixels")
    principal_point: tuple[float, float] | None = None
    distortion_coefficients: list[float] | None = None


class Polygon(BaseModel):
    """Bounding box defined by NW and SE corners."""

    north_west: GPSPoint
    south_east: GPSPoint


class Geofences(BaseModel):
    """Collection of geofence polygons."""

    polygons: list[Polygon] = Field(default_factory=list)


from gps_denied.schemas.eskf import (  # noqa: E402, I001
    ConfidenceTier as ConfidenceTier,
    ESKFConfig as ESKFConfig,
    ESKFState as ESKFState,
    IMUMeasurement as IMUMeasurement,
)
