java.lang.Object
org.jgrapht.alg.drawing.FRQuadTree.Node
- Enclosing class:
FRQuadTree
The Quad-Tree node.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Box2D
(package private) Point2D
(package private) FRQuadTree.Node[]
(package private) int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBox()
Get the area represented by this node.Get the centroid of all points contained in this node.Get the children of this node as a list.int
Get the total number of points under this node.Get a list of all points contained in this node.boolean
Check if the node contains any points.boolean
isLeaf()
Check if a node is a leaf.
-
Field Details
-
box
Box2D box -
totalPoints
int totalPoints -
centroid
Point2D centroid -
children
FRQuadTree.Node[] children -
points
-
-
Constructor Details
-
Node
Create a new node for a given area- Parameters:
box
- the area
-
-
Method Details
-
isLeaf
public boolean isLeaf()Check if a node is a leaf.- Returns:
- true if leaf, false otherwise
-
getPoints
Get a list of all points contained in this node.- Returns:
- a list of points
-
hasPoints
public boolean hasPoints()Check if the node contains any points.- Returns:
- true if the node contains points, false otherwise
-
getBox
Get the area represented by this node.- Returns:
- the area of the node
-
getNumberOfPoints
public int getNumberOfPoints()Get the total number of points under this node.- Returns:
- the total number of points
-
getCentroid
Get the centroid of all points contained in this node.- Returns:
- the centroid of all points contained in this node
-
getChildren
Get the children of this node as a list.- Returns:
- a list containing the children of this node
-