1
z8018
2025-05-05 b6837f097e9cdb2645368aed4ddb03f580c331e4
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/AreaInfo.cs
@@ -6,10 +6,97 @@
namespace WIDESEAWCS_Common
{
    public enum AreaInfo
    /// <summary>
    /// è¡¨ç¤ºå•个木块的实体类
    /// </summary>
    public class Block
    {
        CLOutAreaA,
        CLOutAreaB,
        CLOutAreaC
        public int L { get; set; } // é•¿åº¦ï¼ˆæ²¿X轴)
        public int W { get; set; } // å®½åº¦ï¼ˆæ²¿Y轴)
        public int H { get; set; } // é«˜åº¦ï¼ˆæ²¿Z轴)
        public int X { get; set; } // X坐标(左下角)
        public int Y { get; set; } // Y坐标(左下角)
        public int Z { get; set; } // Z坐标(底部高度)
    }
    /// <summary>
    /// å¸ç›˜æ“ä½œä¿¡æ¯ï¼ˆä½¿ç”¨ä¸­å¿ƒç‚¹åæ ‡ï¼‰
    /// </summary>
    public class SuctionInfo
    {
        public int[] PickCenter { get; set; } // æŠ“取中心点[x,y,z]
        public int[] PlaceCenter { get; set; } // æ”¾ç½®ä¸­å¿ƒç‚¹[x,y,z]
        public int Rotation { get; set; }         // å®žé™…旋转角度
        public Point Point { get; set; }
    }
    /// <summary>
    /// æ”¾ç½®ç»“果输出参数
    /// </summary>
    public class PlacementResult
    {
        public List<int> VertexCoordinates { get; set; } // 8个顶点坐标(顺序:底面四角+顶面四角)
        public int[] Center { get; set; }               // ä¸­å¿ƒç‚¹åæ ‡(x,y,z)
        public SuctionInfo SuctionInfo { get; set; }       // å¸ç›˜æ“ä½œå‚æ•°
    }
    // è¾…助类定义区------------------------------------------
    /// <summary>
    /// äºŒç»´åæ ‡ç‚¹ï¼ˆç”¨äºŽä½ç½®æŸ¥æ‰¾ï¼‰
    /// </summary>
    public struct Point
    {
        public int X { get; }
        public int Y { get; }
        public Point(int x, int y)
        {
            X = x;
            Y = y;
        }
    }
    /// <summary>
    /// æ”¯æ’‘面描述(用于分层放置)
    /// </summary>
    public class SupportSurface
    {
        public int X { get; set; }           // æ”¯æ’‘面起始X坐标
        public int Y { get; set; }           // æ”¯æ’‘面起始Y坐标
        public int Z { get; set; }           // æ”¯æ’‘面高度
        public int AvailableLength { get; set; } // å¯ç”¨é•¿åº¦ï¼ˆX轴方向)
        public int AvailableWidth { get; set; }  // å¯ç”¨å®½åº¦ï¼ˆY轴方向)
    }
    /// <summary>
    /// çŸ©å½¢åŒºåŸŸï¼ˆç”¨äºŽç¢°æ’žæ£€æµ‹ï¼‰
    /// </summary>
    public class Rectangle
    {
        public int Left { get; }
        public int Top { get; }
        public int Right { get; }
        public int Bottom { get; }
        public Rectangle(int left, int top, int right, int bottom)
        {
            Left = left;
            Top = top;
            Right = right;
            Bottom = bottom;
        }
        /// <summary>
        /// çŸ©å½¢ç›¸äº¤æ£€æµ‹ï¼ˆè€ƒè™‘间距约束)
        /// </summary>
        public bool IntersectsWith(Rectangle other)
        {
            return !(Right < other.Left ||
                   Left > other.Right ||
                   Bottom < other.Top ||
                   Top > other.Bottom);
        }
    }
}