|
@@ -1,14 +1,9 @@
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
-using System.Collections.ObjectModel;
|
|
|
using System.Linq;
|
|
|
-using System.Text;
|
|
|
-using System.Threading.Tasks;
|
|
|
-
|
|
|
namespace SAGA.DotNetUtils.Data
|
|
|
{
|
|
|
#region 概述
|
|
|
-
|
|
|
/*
|
|
|
* 有向图,和无向图,部分方法不同;
|
|
|
*
|
|
@@ -59,7 +54,7 @@ namespace SAGA.DotNetUtils.Data
|
|
|
public virtual V AddVertex(V vertex)
|
|
|
{
|
|
|
if (vertex == null)
|
|
|
- return vertex;
|
|
|
+ return null;
|
|
|
V result = vertex;
|
|
|
var useVertex = FindVertex(vertex);
|
|
|
if (useVertex == null)
|
|
@@ -82,7 +77,7 @@ namespace SAGA.DotNetUtils.Data
|
|
|
/// <returns></returns>
|
|
|
public virtual V FindVertex(string vertexId)
|
|
|
{
|
|
|
- if (string.IsNullOrEmpty(vertexId))
|
|
|
+ if (string.IsNullOrWhiteSpace(vertexId))
|
|
|
{
|
|
|
return null;
|
|
|
}
|
|
@@ -123,7 +118,14 @@ namespace SAGA.DotNetUtils.Data
|
|
|
}
|
|
|
return realRemove;
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 隐藏点
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="vertexId"></param>
|
|
|
+ public virtual void HideVertex(string vertexId)
|
|
|
+ {
|
|
|
|
|
|
+ }
|
|
|
/// <summary>
|
|
|
/// 合并关联的点
|
|
|
/// </summary>
|
|
@@ -186,6 +188,15 @@ namespace SAGA.DotNetUtils.Data
|
|
|
this.m_Edges.Add(edge);
|
|
|
return edge;
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 移除边信息
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="edgeId"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public virtual bool RemoveEdge(string edgeId)
|
|
|
+ {
|
|
|
+ return this.m_Edges.Remove(edgeId); ;
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
#region 相关公开方法
|