示例#1
0
 public void Split()
 {
     child = new Tree4Child(depth + 1, border, brother);
     while (objs.Count > 0)
     {
         child.Add(objs[0]);
         //AddChild(objs[0]);
         DisLink(objs[0]);
     }
     //Debug.Log(1);
 }
示例#2
0
 public void Add(NetData obj)
 {
     if (!IsIn(obj))
     {
         return;
     }
     if (objs.Contains(obj))
     {
         return;
     }
     if (child == null)
     {
         Link(obj);
         if (objs.Count > SplitSize && depth <= MaxDepth)
         {
             Split();
         }
     }
     else
     {
         child.Add(obj);
     }
 }
示例#3
0
 public bool Add(NetData obj)
 {
     if (!IsIn(obj.Shap))
     {
         return(false);
     }
     if (objs.Contains(obj))
     {
         return(true);
     }
     if (child == null)
     {
         Link(obj);
         if (objs.Count > SplitSize && depth <= MaxDepth)
         {
             Split();
         }
         return(true);
     }
     else
     {
         return(child.Add(obj));
     }
 }