예제 #1
0
 public void UpdateElements(Quadtree <T> root)
 {
     if (this._A != null)
     {
         this._A.UpdateElements(root);
         this._B.UpdateElements(root);
         this._C.UpdateElements(root);
         this._D.UpdateElements(root);
     }
     if (this._Elements != null)
     {
         for (int i = 0; i < this._Elements.Length; i++)
         {
             T t = this._Elements[i];
             if (t != null && !this._MarginRect.Contains(t.Position))
             {
                 this.RemoveElementAt(i);
                 root.AddElement(t);
             }
         }
     }
 }
예제 #2
0
 private Quadtree(Quadtree <T> root, Rect rect, int maxElementsPerNode) : this(rect, maxElementsPerNode, 0)
 {
     this._Root = root;
 }