using System.Collections.Generic;

namespace MainShell.Vision
{
    /// <summary>
    /// 单个模板匹配结果。
    /// </summary>
    public class FindTemplateResult
    {
        public FindTemplateResult()
        {
            Circles = new List<FindTemplateCircleResult>();
            Lines = new List<FindTemplateLineResult>();
            Rectangles = new List<FindTemplateRectangleResult>();
        }

        /// <summary>
        /// 匹配中心 X 坐标。
        /// </summary>
        public double CenterX { get; set; }

        /// <summary>
        /// 匹配中心 Y 坐标。
        /// </summary>
        public double CenterY { get; set; }

        /// <summary>
        /// 匹配分数。
        /// </summary>
        public double Score { get; set; }

        /// <summary>
        /// 可选的扩展匹配结果。
        /// </summary>
        public VisionMatchResult Match { get; set; }

        /// <summary>
        /// 匹配轮廓。
        /// </summary>
        public FindTemplateContourResult Contour { get; set; }

        /// <summary>
        /// 圆形识别结果。
        /// </summary>
        public IList<FindTemplateCircleResult> Circles { get; private set; }

        /// <summary>
        /// 直线识别结果。
        /// </summary>
        public IList<FindTemplateLineResult> Lines { get; private set; }

        /// <summary>
        /// 矩形识别结果。
        /// </summary>
        public IList<FindTemplateRectangleResult> Rectangles { get; private set; }
    }

    public class FindTemplateContourResult
    {
        public double StartX { get; set; }

        public double StartY { get; set; }

        public double EndX { get; set; }

        public double EndY { get; set; }
    }

    public class FindTemplateCircleResult
    {
        public double CenterX { get; set; }

        public double CenterY { get; set; }

        public double Radius { get; set; }
    }

    public class FindTemplateLineResult
    {
        public double StartX { get; set; }

        public double StartY { get; set; }

        public double EndX { get; set; }

        public double EndY { get; set; }
    }

    public class FindTemplateRectangleResult
    {
        public double StartX { get; set; }

        public double StartY { get; set; }

        public double Width { get; set; }

        public double Height { get; set; }

        public double Angle { get; set; }
    }
}
