using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace WIDESEAWCS_Common
|
{
|
/// <summary>
|
/// 表示单个木块的实体类
|
/// </summary>
|
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坐标(底部高度)
|
}
|
|
/// <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);
|
}
|
}
|
}
|