Class FRQuadTree

java.lang.Object
org.jgrapht.alg.drawing.FRQuadTree

class FRQuadTree extends Object
A simple QuadTree for indexing during force calculations in the Fruchterman and Reingold Force-Directed Placement Algorithm.

See the following paper for the definition of a QuadTree.

  • Raphael Finkel and J.L. Bentley. Quad Trees: A Data Structure for Retrieval on Composite Keys. Acta Informatica, 4(1):1--9, 1974.

The tree supports adding points one by one and maintains the centroid and total number of points on each tree node.

  • Field Details

  • Constructor Details

    • FRQuadTree

      public FRQuadTree(Box2D box)
      Create a new tree for a certain area.
      Parameters:
      box - the area
  • Method Details

    • insert

      public void insert(Point2D p)
      Insert a new point.
      Parameters:
      p - the new point
    • getRoot

      public FRQuadTree.Node getRoot()
      Get the root node of the tree.
      Returns:
      the root