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); }
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); } }
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)); } }