goog.structs.QuadTree
Classgoog.structs.QuadTree(minX, minY, maxX, maxY)
Constructs a new quad tree.
minX
{number
}
minY
{number
}
maxX
{number
}
maxY
{number
}
goog.structs.QuadTree.Node
ClassConstructs a new quad tree node. … more
goog.structs.QuadTree.NodeType
EnumEnumeration of node types. … more
goog.structs.QuadTree.Point
ClassCreates a new point object. … more
.clear()
Removes all items from the tree.
.clone()
Clones the quad-tree and returns the new instance.
goog.structs.QuadTree
}
.contains(x, y)
Returns true if the point at (x, y) exists in the tree.
x
{number
}
y
{number
}
boolean
}
.forEach(fn, opt_obj)
Traverses the tree and calls a function on each node.
fn
{function
(?, goog.math.Coordinate
, goog.structs.QuadTree
)}
opt_obj
{Object
=}
.get(x, y, opt_default)
Gets the value of the point at (x, y) or null if the point is empty.
x
{number
}
y
{number
}
opt_default
{*=}
.getCount()
number
}
.getKeys()
Returns an array containing the coordinates of each point stored in the tree.
Array
.<goog.math.Coordinate
?>}
.getRootNode()
Returns a reference to the tree's root node. Callers shouldn't modify nodes, directly. This is a convenience for visualization and debugging purposes.
goog.structs.QuadTree.Node
}
.getValues()
Returns an array containing all values stored within the tree.
Array
.<Object
>}
.isEmpty()
boolean
}
.remove(x, y)
Removes a point from (x, y) if it exists.
x
{number
}
y
{number
}
.set(x, y, value)
Sets the value of an (x, y) point within the quad-tree.
x
{number
}
y
{number
}
value
{*}