Jelajahi Sumber

Merge branch 'master' of http://dev.dp.sagacloud.cn:8886/r/Revit/SAGA.MBI

mengxiangge 6 tahun lalu
induk
melakukan
16a421d2c0

+ 2 - 4
MBI/SAGA.DotNetUtils/Data/EdgesArray/DBCollection.cs

@@ -1,16 +1,14 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace SAGA.DotNetUtils.Data
 {
     /// <summary>
     /// 点数据集合
     /// </summary>
-    /// <typeparam name="T"></typeparam>
+    /// <typeparam name="V"></typeparam>
+    /// <typeparam name="VD"></typeparam>
     public class VCollection<V,VD> : KeyedCollection<string, V> where V : EAVertex<VD>
     {
         protected override string GetKeyForItem(V item)

+ 0 - 6
MBI/SAGA.DotNetUtils/Data/EdgesArray/EAEdge.cs

@@ -1,9 +1,5 @@
 using System;
-using System.Collections.Generic;
 using System.ComponentModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace SAGA.DotNetUtils.Data
 {
@@ -42,12 +38,10 @@ namespace SAGA.DotNetUtils.Data
         /// 边类型
         /// </summary>
         public EAEdgeType EdgeType { get; set; }
-
         /// <summary>
         /// 开始点
         /// </summary>
         public string StartVertex { get; set; }
-
         /// <summary>
         /// 结束点
         /// </summary>

+ 8 - 13
MBI/SAGA.DotNetUtils/Data/EdgesArray/EAElement.cs

@@ -2,13 +2,11 @@
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace SAGA.DotNetUtils.Data
 {
     /// <summary>
-    /// 数组元素
+    /// 基础节点元素
     /// </summary>
     public class EAElement<T> where T : EAElement<T>
     {
@@ -97,13 +95,12 @@ namespace SAGA.DotNetUtils.Data
             return result;
         } 
         #endregion
-
         /// <summary>
         /// 有效的Id
         /// </summary>
         public bool ValidId
         {
-            get { return !string.IsNullOrEmpty(Id); }
+            get { return !string.IsNullOrWhiteSpace(Id); }
         }
         /// <summary>
         /// 两个对象是否匹配
@@ -121,11 +118,13 @@ namespace SAGA.DotNetUtils.Data
                 return true;
             }
             return this.Equals(ea);
-        }
-
-       
+        }       
     }
     #region 节点集合类
+    /// <summary>
+    /// 节点子项目集合类
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
     public class EAElementCollection<T> : ObservableCollection<T> where T : EAElement<T>
     {
         private T m_Parent;
@@ -171,7 +170,6 @@ namespace SAGA.DotNetUtils.Data
         {
             foreach (var item in items)
             {
-                //item.Parent = m_Parent;
                 this.Add(item);
             }
         }
@@ -179,10 +177,7 @@ namespace SAGA.DotNetUtils.Data
         public void Reverse()
         {
             var list = this.Items as List<T>;
-            if (list != null)
-            {
-                list.Reverse();
-            }
+            list?.Reverse();
         }
     }
     #endregion

+ 5 - 2
MBI/SAGA.DotNetUtils/Data/EdgesArray/EAVertex.cs

@@ -34,7 +34,10 @@ namespace SAGA.DotNetUtils.Data
             if (!flag)
             {
                 EAVertex<T> refV = ea as EAVertex<T>;
-                flag = DataEqual(refV.Data);
+                if (refV != null)
+                {
+                    flag = DataEqual(refV.Data);
+                }             
             }
             return flag;
         }
@@ -45,7 +48,7 @@ namespace SAGA.DotNetUtils.Data
         public virtual void Merge(EAElement<EAVertex<T>> ea)
         {
             /*
-             * 主要面Data为集合有交集的情况
+             * 将data信息重新进行整理
              */
         }
     }

+ 18 - 7
MBI/SAGA.DotNetUtils/Data/EdgesArray/EdgesArray.cs

@@ -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 相关公开方法

+ 1 - 1
MBI/SAGA.DotNetUtils/Data/EdgesArray/ForwardStar.cs

@@ -100,7 +100,7 @@ namespace SAGA.DotNetUtils.Data
         public List<E> GetEdges(string vId, bool isStart)
         {
             List<E> edges = new List<E>();
-            Dictionary<string, List<E>> dataSource = dataSource = isStart ? StartRelations : EndRelations;
+            Dictionary<string, List<E>> dataSource  = isStart ? StartRelations : EndRelations;
             bool flag = dataSource.TryGetValue(vId, out List<E> tempEdges);
             if (flag)
             {

+ 1 - 1
MBI/SAGA.GplotRelationComputerManage/RevitSystemParse/Handler/SystemParse.cs

@@ -72,7 +72,7 @@ namespace SAGA.GplotRelationComputerManage
         /// <returns></returns>
         public ElementEdgesArray GetOriginEdges(Element element)
         {
-            Element startElement = element;//获取到遍历的开始点,
+            Element startElement = element;
             ElementEdgesArray edges = new ElementEdgesArray();
 
             #region 构建初始边集合

+ 5 - 5
MBI/SAGA.GplotRelationComputerManage/RevitSystemParse/Handler/SystemParseSetting.cs

@@ -17,11 +17,11 @@ namespace SAGA.GplotRelationComputerManage
     /// </summary>
     public class SystemParseSetting
     {
-        public SystemParseSetting(GplotOptions options)
-        {
-            //GplotOptions = options;
-            //var relationType = RelationTypeManager.GetRelationTypeItem(options.);
-        }
+        //public SystemParseSetting(GplotOptions options)
+        //{
+        //    //GplotOptions = options;
+        //    //var relationType = RelationTypeManager.GetRelationTypeItem(options.);
+        //}
         public SystemParseSetting(RelationTypeShell relationShell)
         {
             RelationTypeShell = relationShell;

+ 2 - 4
MBI/SAGA.RevitUtils/Data/ElementsVertex.cs

@@ -1,12 +1,10 @@
-using Autodesk.Revit.DB;
+
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.ComponentModel;
 using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using SAGA.RevitUtils.MEP;
+using Autodesk.Revit.DB;
 
 namespace SAGA.RevitUtils
 {

+ 1 - 1
MBI/SAGA.RevitUtils/Data/GraphNode.cs

@@ -114,7 +114,7 @@ namespace SAGA.RevitUtils
         /// <summary>
         /// 获取关联对象
         /// </summary>
-        /// <typeparam name="T"></typeparam>
+        /// <typeparam name="V"></typeparam>
         /// <param name="key"></param>
         /// <returns></returns>
         public V GetRef<V>(string key)