- java.lang.Object
-
- org.jgrapht.alg.drawing.FRQuadTree
-
class FRQuadTree extends java.lang.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
FRQuadTree.Node
The Quad-Tree node.
-
Constructor Summary
Constructors Constructor Description FRQuadTree(Box2D box)
Create a new tree for a certain area.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FRQuadTree.Node
getRoot()
Get the root node of the tree.void
insert(Point2D p)
Insert a new point.
-
-
-
Field Detail
-
NW
private static final int NW
- See Also:
- Constant Field Values
-
NE
private static final int NE
- See Also:
- Constant Field Values
-
SW
private static final int SW
- See Also:
- Constant Field Values
-
SE
private static final int SE
- See Also:
- Constant Field Values
-
root
private FRQuadTree.Node root
-
-
Constructor Detail
-
FRQuadTree
public FRQuadTree(Box2D box)
Create a new tree for a certain area.- Parameters:
box
- the area
-
-
Method Detail
-
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
-
-