QuadTree$Node class final
A node in the QuadTree that represents a region in the 2D space.
Properties
- boundary → Rect
-
Boundary of the QuadTree node.
final
-
children
→ List<
QuadTree$Node> -
Get all the child nodes of this node.
Returns an empty list if this node has not been subdivided.
Better to use directly: northWest, northEast, southWest, southEast
no setter
- depth → int
-
The depth of this node in the QuadTree.
The root node has a depth of 0.
The depth increases by 1 for each level of the QuadTree.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → int
-
The unique identifier of this node.
final
-
ids
→ Iterable<
int> -
Unordered set of object identifiers stored in this node.
no setter
- isEmpty → bool
-
Whether this node is empty.
Returns true if the node has no objects stored in it or its children.
no setter
- isNotEmpty → bool
-
Whether this node is not empty.
Returns true if the node has objects stored in it or its children.
no setter
- leaf → bool
-
Whether this node is a leaf node.
A leaf node is a node that has not been subdivided and can store objects.
no setter
- length → int
-
Number of objects directly stored in this (for leaf node)
or all nested nodes (for subdivided node).
no setter
- northEast → QuadTree$Node?
-
The North-East child node (quadrant) of this node.
no setter
- northWest → QuadTree$Node?
-
The North-West child node (quadrant) of this node.
no setter
- parent → QuadTree$Node?
-
The parent node of this node.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- southEast → QuadTree$Node?
-
The South-East child node (quadrant) of this node.
no setter
- southWest → QuadTree$Node?
-
The South-West child node (quadrant) of this node.
no setter
- subdivided → bool
-
Whether this node has been subdivided.
A subdivided node has four child nodes (quadrants)
and can not directly store objects.
no setter
- tree → QuadTree
-
The QuadTree this node belongs to.
final
Methods
-
forEach(
bool cb(int id, double left, double top, double width, double height)) → void - Visit all objects in this node and its children. The walk stops when it iterates over all objects or when the callback returns false.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
visit(
bool visitor(QuadTree$Node node)) → void - Visit nodes in the QuadTree. The walk stops when it iterates over all nodes or when the callback returns false.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override