Example #1
0
 /// <summary>
 /// Creates a new <code>QuadTree</code> with the given parameters.
 /// </summary>
 /// <param name="divisionThreshold">One QuadNode is subdivided, if it contains at least this count of objects.</param>
 /// <param name="combineThreshold">If fewer objects are contained in the four children of a QuadNode, they are recombined.</param>
 /// <param name="x1">The lower bound of the x-values belonging to this sector.</param>
 /// <param name="x2">The upper bound of the x-values belonging to this sector.</param>
 /// <param name="y1">The lower bound of the y-values belonging to this sector.</param>
 /// <param name="y2">The upper bound of the y-values belonging to this sector.</param>
 public QuadTree(int divisionThreshold, int combineThreshold, double x1, double x2, double y1, double y2)
 {
     _rootNode = new QuadNode <T>(divisionThreshold, combineThreshold, x1, x2, y1, y2);
 }
Example #2
0
 /// <summary>
 /// Creates a new <code>QuadTree</code> of the given size.
 /// </summary>
 /// <param name="length">The width of the area to manage.</param>
 /// <param name="width">The height of the area to manage.</param>
 public QuadTree(double length, double width)
 {
     _rootNode = new QuadNode <T>(DivisionThreshold, CombineThreshold, 0, length, 0, width);
 }