using System.Collections.Generic;
using Autodesk.Navisworks.Api;

namespace NavisworksTransport
{
    /// <summary>
    /// 网格可视化类型（仅用于网格可视化，不用于数据模型）
    /// </summary>
    public enum GridVisualizationType
    {
        /// <summary>
        /// 可通行通道（绿色）
        /// </summary>
        Walkable,

        /// <summary>
        /// 障碍物（灰色）
        /// </summary>
        Obstacle,

        /// <summary>
        /// 未知区域（红色）
        /// </summary>
        Unknown,

        /// <summary>
        /// 门（半透明绿色）
        /// </summary>
        Door
    }

    /// <summary>
    /// 网格可视化标记点
    /// </summary>
    public class GridMarker
    {
        /// <summary>
        /// 3D 位置
        /// </summary>
        public Point3D Position { get; set; }

        /// <summary>
        /// 网格可视化类型（可通行性）
        /// </summary>
        public GridVisualizationType CellType { get; set; }

        /// <summary>
        /// 网格坐标 X
        /// </summary>
        public int GridX { get; set; }

        /// <summary>
        /// 网格坐标 Y
        /// </summary>
        public int GridY { get; set; }

        /// <summary>
        /// 高度层 Z 坐标
        /// </summary>
        public double LayerZ { get; set; }

        public GridMarker() { }

        public GridMarker(Point3D position, GridVisualizationType cellType, int gridX, int gridY, double layerZ)
        {
            Position = position;
            CellType = cellType;
            GridX = gridX;
            GridY = gridY;
            LayerZ = layerZ;
        }
    }

    /// <summary>
    /// 网格可视化集合
    /// </summary>
    public class GridVisualization
    {
        /// <summary>
        /// 可视化 ID
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 可通行的网格标记（绿色）
        /// </summary>
        public List<GridMarker> Walkable { get; } = new List<GridMarker>();

        /// <summary>
        /// 障碍物网格标记（灰色）
        /// </summary>
        public List<GridMarker> Obstacle { get; } = new List<GridMarker>();

        /// <summary>
        /// 未知区域网格标记（红色）
        /// </summary>
        public List<GridMarker> Unknown { get; } = new List<GridMarker>();

        /// <summary>
        /// 门网格标记（半透明绿色）
        /// </summary>
        public List<GridMarker> Door { get; } = new List<GridMarker>();

        public GridVisualization() { }

        public GridVisualization(string id)
        {
            Id = id;
        }
    }
}
