goog.structs.QuadTree |
minX
: number
Minimum x-value that can be held in tree.
|
minY
: number
Minimum y-value that can be held in tree.
|
maxX
: number
Maximum x-value that can be held in tree.
|
maxY
: number
Maximum y-value that can be held in tree.
|
![]()
Attempts to balance a node. A node will need balancing if all its children
are empty or it contains just one leaf.
Arguments:
|
code » | ||||
![]()
Removes all items from the tree.
|
code » | ||||
Clones the quad-tree and returns the new instance.
Returns: !goog.structs.QuadTree
A clone of the tree.
|
code » | ||||
Returns true if the point at (x, y) exists in the tree.
|
code » | ||||
Finds a leaf node with the same (x, y) coordinates as the target point, or
null if no point exists.
Arguments:
Returns: goog.structs.QuadTree.Node
The leaf node that matches the target,
or null if it doesn't exist.
|
code » | ||||
![]()
Traverses the tree and calls a function on each node.
Arguments:
|
code » | ||||
![]()
Gets the value of the point at (x, y) or null if the point is empty.
|
code » | ||||
No description.
Returns: number
The number of items in the tree.
|
code » | ||||
Returns an array containing the coordinates of each point stored in the tree.
|
code » | ||||
Returns the child quadrant within a node that contains the given (x, y)
coordinate.
Arguments:
Returns: goog.structs.QuadTree.Node
The child quadrant that contains the
point.
|
code » | ||||
Returns a reference to the tree's root node. Callers shouldn't modify nodes,
directly. This is a convenience for visualization and debugging purposes.
Returns: goog.structs.QuadTree.Node
The root node.
|
code » | ||||
Returns an array containing all values stored within the tree.
|
code » | ||||
Inserts a point into the tree, updating the tree's structure if necessary.
Arguments:
Returns: boolean
True if a new node was added to the tree; False if a node
already existed with the correpsonding coordinates and had its value
reset.
|
code » | ||||
No description.
Returns: boolean
Whether the tree is empty.
|
code » | ||||
![]()
Removes a point from (x, y) if it exists.
|
code » | ||||
![]()
Sets the value of an (x, y) point within the quad-tree.
|
code » | ||||
![]()
Sets the point for a node, as long as the node is a leaf or empty.
Arguments:
|
code » | ||||
![]()
Converts a leaf node to a pointer node and reinserts the node's point into
the correct child.
Arguments:
|
code » | ||||
![]()
Traverses the tree depth-first, with quadrants being traversed in clockwise
order (NE, SE, SW, NW). The provided function will be called for each
leaf node that is encountered.
Arguments:
|
code » |
![]()
Enumeration of node types.
Constants:
|
Code » |