using Autodesk.Navisworks.Api;

namespace NavisworksTransport.Utils.CoordinateSystem
{
    /// <summary>
    /// 坐标系接口 - 抽象不同坐标系的差异
    /// </summary>
    public interface ICoordinateSystem
    {
        /// <summary>
        /// 坐标系类型
        /// </summary>
        CoordinateSystemType Type { get; }
        
        /// <summary>
        /// 获取向上向量
        /// </summary>
        Vector3D UpVector { get; }
        
        /// <summary>
        /// 获取向上轴的索引 (0=X, 1=Y, 2=Z)
        /// </summary>
        int UpAxisIndex { get; }
        
        /// <summary>
        /// 获取垂直扫描方向（用于障碍物检测，通常是 -UpVector）
        /// </summary>
        Vector3D VerticalScanDirection { get; }
        
        /// <summary>
        /// 获取点的高度值（统一抽象）
        /// </summary>
        double GetElevation(Point3D point);
        
        /// <summary>
        /// 设置点的高度值，返回新点
        /// </summary>
        Point3D SetElevation(Point3D point, double elevation);
        
        /// <summary>
        /// 获取水平面坐标（返回X和另一个水平轴）
        /// </summary>
        (double h1, double h2) GetHorizontalCoords(Point3D point);
        
        /// <summary>
        /// 从水平面坐标和高度构建3D点
        /// </summary>
        Point3D CreatePoint(double h1, double h2, double elevation);
        
        /// <summary>
        /// 获取包围盒的高度范围
        /// </summary>
        (double min, double max) GetHeightRange(BoundingBox3D bounds);
        
        /// <summary>
        /// 获取包围盒的水平范围
        /// </summary>
        (double min1, double max1, double min2, double max2) GetHorizontalRange(BoundingBox3D bounds);
    }
}
