growTree method

  1. @protected
RTreeNode<T> growTree(
  1. Iterable<RTreeNode<T>> nodes
)

Grows the R-Tree by creating a new root node, with the given nodes as children.

Implementation

@protected
RTreeNode<T> growTree(Iterable<RTreeNode<T>> nodes) {
  root = RTreeNode<T>(this, isLeaf: false);
  root.entries
      .addAll(nodes.map((node) => RTreeEntry<T>(node.bounds, child: node)));
  for (final node in nodes) {
    node.parent = root;
  }
  return root;
}