java.lang.Object
org.jgrapht.alg.drawing.FRQuadTree
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 -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRoot()
Get the root node of the tree.void
Insert a new point.
-
Field Details
-
NW
private static final int NW- See Also:
-
NE
private static final int NE- See Also:
-
SW
private static final int SW- See Also:
-
SE
private static final int SE- See Also:
-
root
-
-
Constructor Details
-
FRQuadTree
Create a new tree for a certain area.- Parameters:
box
- the area
-
-
Method Details
-
insert
Insert a new point.- Parameters:
p
- the new point
-
getRoot
Get the root node of the tree.- Returns:
- the root
-