- java.lang.Object
-
- org.jgrapht.alg.drawing.FRQuadTree.Node
-
- Enclosing class:
- FRQuadTree
public class FRQuadTree.Node extends java.lang.ObjectThe Quad-Tree node.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Box2Dbox(package private) Point2Dcentroid(package private) FRQuadTree.Node[]children(package private) java.util.List<Point2D>points(package private) inttotalPoints
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Box2DgetBox()Get the area represented by this node.Point2DgetCentroid()Get the centroid of all points contained in this node.java.util.List<FRQuadTree.Node>getChildren()Get the children of this node as a list.intgetNumberOfPoints()Get the total number of points under this node.java.util.List<Point2D>getPoints()Get a list of all points contained in this node.booleanhasPoints()Check if the node contains any points.booleanisLeaf()Check if a node is a leaf.
-
-
-
Field Detail
-
box
Box2D box
-
totalPoints
int totalPoints
-
centroid
Point2D centroid
-
children
FRQuadTree.Node[] children
-
points
java.util.List<Point2D> points
-
-
Constructor Detail
-
Node
public Node(Box2D box)
Create a new node for a given area- Parameters:
box- the area
-
-
Method Detail
-
isLeaf
public boolean isLeaf()
Check if a node is a leaf.- Returns:
- true if leaf, false otherwise
-
getPoints
public java.util.List<Point2D> 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
public Box2D 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
public Point2D getCentroid()
Get the centroid of all points contained in this node.- Returns:
- the centroid of all points contained in this node
-
getChildren
public java.util.List<FRQuadTree.Node> getChildren()
Get the children of this node as a list.- Returns:
- a list containing the children of this node
-
-