Esempio n. 1
0
 public QuadTree(RectangleF bounds)
 {
     rootNode = new QTNode(bounds, 0);
 }
Esempio n. 2
0
 public QuadTree(RectangleD bounds)
 {
     rootNode = new QTNode(bounds, 0);
 }
Esempio n. 3
0
 private void CreateChildren()
 {
     children = new QTNode[4];
     children[TL] = new QTNode(RectangleF.FromLTRB(_bounds.Left, _bounds.Top, 0.5f * (_bounds.Left + _bounds.Right), 0.5f * (_bounds.Top + _bounds.Bottom)), Level + 1);
     children[TR] = new QTNode(RectangleF.FromLTRB(0.5f * (_bounds.Left + _bounds.Right),_bounds.Top,_bounds.Right, 0.5f * (_bounds.Top + _bounds.Bottom)), Level + 1);
     children[BL] = new QTNode(RectangleF.FromLTRB(_bounds.Left, 0.5f * (_bounds.Top + _bounds.Bottom), 0.5f * (_bounds.Left + _bounds.Right), _bounds.Bottom), Level + 1);
     children[BR] = new QTNode(RectangleF.FromLTRB(0.5f * (_bounds.Left + _bounds.Right), 0.5f * (_bounds.Top + _bounds.Bottom), _bounds.Right, _bounds.Bottom), Level + 1);
 }