You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.3 KiB
58 lines
1.3 KiB
|
1 month ago
|
using AuroraDesk.Core.Entities;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using System.Collections.ObjectModel;
|
||
|
|
|
||
|
|
namespace AuroraDesk.Core.Interfaces;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 节点画布服务接口
|
||
|
|
/// </summary>
|
||
|
|
public interface INodeCanvasService
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 节点集合
|
||
|
|
/// </summary>
|
||
|
|
ObservableCollection<Node> Nodes { get; }
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 连接集合
|
||
|
|
/// </summary>
|
||
|
|
ObservableCollection<Connection> Connections { get; }
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 添加节点到画布
|
||
|
|
/// </summary>
|
||
|
|
void AddNode(Node node);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 移除节点(同时移除相关连接)
|
||
|
|
/// </summary>
|
||
|
|
void RemoveNode(Node node);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 更新节点位置
|
||
|
|
/// </summary>
|
||
|
|
void UpdateNodePosition(Node node, double x, double y);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 创建连接
|
||
|
|
/// </summary>
|
||
|
|
bool CreateConnection(ConnectionPoint sourcePoint, ConnectionPoint targetPoint);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 移除连接
|
||
|
|
/// </summary>
|
||
|
|
void RemoveConnection(Connection connection);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 获取节点的所有连接
|
||
|
|
/// </summary>
|
||
|
|
IEnumerable<Connection> GetNodeConnections(Node node);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 清除所有节点和连接
|
||
|
|
/// </summary>
|
||
|
|
void Clear();
|
||
|
|
}
|
||
|
|
|