using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WIDESEAWCS_Common { /// /// 表示单个木块的实体类 /// public class Block { 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坐标(底部高度) } /// /// 吸盘操作信息(使用中心点坐标) /// 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; } } /// /// 放置结果输出参数 /// public class PlacementResult { public List VertexCoordinates { get; set; } // 8个顶点坐标(顺序:底面四角+顶面四角) public int[] Center { get; set; } // 中心点坐标(x,y,z) public SuctionInfo SuctionInfo { get; set; } // 吸盘操作参数 } // 辅助类定义区------------------------------------------ /// /// 二维坐标点(用于位置查找) /// public struct Point { public int X { get; } public int Y { get; } public Point(int x, int y) { X = x; Y = y; } } /// /// 支撑面描述(用于分层放置) /// 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轴方向) } /// /// 矩形区域(用于碰撞检测) /// 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; } /// /// 矩形相交检测(考虑间距约束) /// public bool IntersectsWith(Rectangle other) { return !(Right < other.Left || Left > other.Right || Bottom < other.Top || Top > other.Bottom); } } }