public QuadTree(Rectangle aBounds) { bounds = aBounds; root = new QuadTreeNode(bounds, 0); }
/// <summary> /// /// </summary> /// <param name="rectangle"></param> public QuadTree(RectangleF rectangle) { m_rectangle = rectangle; m_root = new QuadTreeNode <T>(m_rectangle, this); }
/// <summary> /// When the QuadTree is made a root node is created with the area of the input. /// </summary> /// <param name="widthOfArea">The quad tree will cover an area of this width.</param> /// <param name="heightOfArea">The quad tree will cover an area of this height.</param> public QuadTree(float widthOfArea, float heightOfArea) { // Since the root spans the entire area it starts at origo(Left upper corner of screen). this.Root = new QuadTreeNode(0, 0, widthOfArea, heightOfArea); }
private bool IsInRectangle(float x, float y, QuadTreeNode aNode) { return(IsInRectangle(x, y, aNode.nodeX, aNode.nodeX + aNode.nodeWidth, aNode.nodeY, aNode.nodeY + aNode.nodeHeight)); }
private void MenuItem_Click_DrawArrow(object sender, RoutedEventArgs e) { _selectedNode = QuadTreeNode.Arrow; }
private void MenuItem_Click_DrawGrayNode(object sender, RoutedEventArgs e) { _selectedNode = QuadTreeNode.Gray; }
private void MenuItem_Click_DrawBlackNode(object sender, RoutedEventArgs e) { _selectedNode = QuadTreeNode.Black; }