修改切点样式为锥体
This commit is contained in:
parent
13e08faa8a
commit
0702cc879a
@ -108,7 +108,12 @@ namespace NavisworksTransport
|
||||
/// <summary>
|
||||
/// 网格未知区域样式(深橙色)
|
||||
/// </summary>
|
||||
GridUnknown
|
||||
GridUnknown,
|
||||
|
||||
/// <summary>
|
||||
/// 切点样式(深红色)
|
||||
/// </summary>
|
||||
TangentPoint
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -1058,8 +1063,9 @@ namespace NavisworksTransport
|
||||
{
|
||||
if (edge.Trajectory == null) return;
|
||||
|
||||
// 切点颜色与路径点相同
|
||||
var tangentColor = GetRenderStyle(RenderStyleName.WayPoint).Color;
|
||||
// 使用统一样式
|
||||
var tangentStyle = GetRenderStyle(RenderStyleName.TangentPoint);
|
||||
var tangentColor = tangentStyle.Color;
|
||||
|
||||
// 路径宽度基准值(柱状和带状都是 GetLineRadius() * 2)
|
||||
var pathWidth = GetLineRadius() * 2;
|
||||
@ -1280,6 +1286,9 @@ namespace NavisworksTransport
|
||||
case RenderStyleName.GridUnknown:
|
||||
return new RenderStyle(Color.FromByteRGB(255, 112, 67), 0.8); // Material Deep Orange网格未知区域,20%透明
|
||||
|
||||
case RenderStyleName.TangentPoint:
|
||||
return new RenderStyle(Color.FromByteRGB(244, 67, 54), 0.8); // Material Red切点,20%透明
|
||||
|
||||
default:
|
||||
return new RenderStyle(Color.White, 1.0); // 默认白色,完全不透明
|
||||
}
|
||||
@ -1968,7 +1977,7 @@ namespace NavisworksTransport
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 渲染方块标记(切点)- 使用圆柱体
|
||||
/// 渲染方块标记(切点)- 使用圆锥体
|
||||
/// </summary>
|
||||
/// <param name="graphics">图形上下文</param>
|
||||
/// <param name="marker">方块标记</param>
|
||||
@ -1976,13 +1985,13 @@ namespace NavisworksTransport
|
||||
{
|
||||
try
|
||||
{
|
||||
// 计算圆柱体半径
|
||||
// 计算圆锥体半径(底部半径)
|
||||
var radius = marker.Size / 2.0;
|
||||
|
||||
// 计算圆柱体高度
|
||||
// 计算圆锥体高度
|
||||
var height = marker.Height;
|
||||
|
||||
// 计算圆柱体起点和终点(底面放在通道上)
|
||||
// 计算圆锥体起点和终点(底面放在通道上)
|
||||
var startPoint = new Point3D(
|
||||
marker.Center.X,
|
||||
marker.Center.Y,
|
||||
@ -1995,11 +2004,12 @@ namespace NavisworksTransport
|
||||
marker.Center.Z + height // 顶面Z坐标 = 中心Z坐标 + 高度
|
||||
);
|
||||
|
||||
// 设置颜色和透明度
|
||||
graphics.Color(marker.Color, marker.Alpha);
|
||||
// 使用统一样式
|
||||
var style = GetRenderStyle(RenderStyleName.TangentPoint);
|
||||
graphics.Color(style.Color, marker.Alpha);
|
||||
|
||||
// 使用Cylinder API渲染圆柱体
|
||||
graphics.Cylinder(startPoint, endPoint, radius);
|
||||
// 使用Cone API渲染圆锥体(底部半径 = radius,顶部半径 = 0)
|
||||
graphics.Cone(startPoint, endPoint, radius, 0);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user