|
|
@ -1283,7 +1283,10 @@ public class ViewportHelperPro |
|
|
|
/// <returns></returns> |
|
|
|
/// <returns></returns> |
|
|
|
public static List<LineGeometryModel3D> ShowMeshLines(List<Viewport3DTriangleEntity> entities, bool isCrown = true, double thickness = 1.0) |
|
|
|
public static List<LineGeometryModel3D> ShowMeshLines(List<Viewport3DTriangleEntity> entities, bool isCrown = true, double thickness = 1.0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
moveLines = new(); |
|
|
|
if (isCrown) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
moveLines = new(); |
|
|
|
|
|
|
|
} |
|
|
|
List<LineGeometryModel3D> lines = new(); |
|
|
|
List<LineGeometryModel3D> lines = new(); |
|
|
|
var Y = -0.01F; |
|
|
|
var Y = -0.01F; |
|
|
|
if (!isCrown) |
|
|
|
if (!isCrown) |
|
|
@ -1552,6 +1555,10 @@ public class ViewportHelperPro |
|
|
|
// 现在鼠标对于3d模型的位置 |
|
|
|
// 现在鼠标对于3d模型的位置 |
|
|
|
var mousePosition = ev.Position; |
|
|
|
var mousePosition = ev.Position; |
|
|
|
var Y = -0.01F; |
|
|
|
var Y = -0.01F; |
|
|
|
|
|
|
|
if (!IsCrown()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Y = ViewportManager.ModelBounds.Maximum.Y + 0.01F; |
|
|
|
|
|
|
|
} |
|
|
|
var center = ViewportManager.CenterVector; |
|
|
|
var center = ViewportManager.CenterVector; |
|
|
|
center.Y = Y; |
|
|
|
center.Y = Y; |
|
|
|
|
|
|
|
|
|
|
@ -1619,6 +1626,10 @@ public class ViewportHelperPro |
|
|
|
dragStartPoint = ev.Position; |
|
|
|
dragStartPoint = ev.Position; |
|
|
|
Point3D mouseWorldPosition = Get3DPointFromMouse(dragStartPoint); |
|
|
|
Point3D mouseWorldPosition = Get3DPointFromMouse(dragStartPoint); |
|
|
|
var Y = -0.01F; |
|
|
|
var Y = -0.01F; |
|
|
|
|
|
|
|
if(!IsCrown()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Y = ViewportManager.ModelBounds.Maximum.Y + 0.01F; |
|
|
|
|
|
|
|
} |
|
|
|
var center = ViewportManager.CenterVector; |
|
|
|
var center = ViewportManager.CenterVector; |
|
|
|
center.Y = Y; |
|
|
|
center.Y = Y; |
|
|
|
initDistance = CalculateDistance(mouseWorldPosition, center.ToPoint3D()); |
|
|
|
initDistance = CalculateDistance(mouseWorldPosition, center.ToPoint3D()); |
|
|
@ -1627,6 +1638,16 @@ public class ViewportHelperPro |
|
|
|
Viewport.CaptureMouse(); |
|
|
|
Viewport.CaptureMouse(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static bool IsCrown() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
bool isCrown = false; |
|
|
|
|
|
|
|
var camera = ViewportManager.GetViewport3D().Camera; |
|
|
|
|
|
|
|
if (camera.LookDirection.Y >= 0 && camera.UpDirection.Y <= 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
isCrown = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return isCrown; |
|
|
|
|
|
|
|
} |
|
|
|
#region 私有方法 |
|
|
|
#region 私有方法 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|