Constructor and Description |
---|
Node(Vector center,
Vector width,
scala.collection.Seq<QuadTree.Node> children) |
Modifier and Type | Method and Description |
---|---|
scala.collection.Seq<QuadTree.Node> |
children() |
boolean |
contains(Vector queryPoint)
Tests whether the queryPoint is in the node, or a child of that node
|
scala.Tuple2<Vector,Vector> |
getCenterWidth()
for testing purposes only; used in QuadTreeSuite.scala
|
boolean |
isNear(Vector queryPoint,
double radius)
Tests if queryPoint is near a node
|
void |
makeChildren()
Makes children nodes by partitioning the box into equal sub-boxes
and adding a node for each sub-box
|
double |
minDist(Vector queryPoint)
minDist is defined so that every point in the box has distance to queryPoint greater
than minDist (minDist adopted from "Nearest Neighbors Queries" by N.
|
scala.collection.mutable.ListBuffer<Vector> |
nodeElements() |
boolean |
overlap(Vector queryPoint,
double radius)
Tests if queryPoint is within a radius of the node
|
scala.collection.Seq<Vector> |
partitionBox(Vector center,
Vector width)
Recursive function that partitions a n-dim box by taking the (n-1) dimensional
plane through the center of the box keeping the n-th coordinate fixed,
then shifting it in the n-th direction up and down
and recursively applying partitionBox to the two shifted (n-1) dimensional planes.
|
int |
whichChild(Vector queryPoint)
Finds which child queryPoint lies in.
|
public Node(Vector center, Vector width, scala.collection.Seq<QuadTree.Node> children)
public scala.collection.Seq<QuadTree.Node> children()
public scala.collection.mutable.ListBuffer<Vector> nodeElements()
public scala.Tuple2<Vector,Vector> getCenterWidth()
public boolean contains(Vector queryPoint)
queryPoint
- a point to testpublic boolean overlap(Vector queryPoint, double radius)
queryPoint
- a point to testradius
- radius of test areapublic boolean isNear(Vector queryPoint, double radius)
queryPoint
- a point to testradius
- radius of covered areapublic double minDist(Vector queryPoint)
queryPoint
- public int whichChild(Vector queryPoint)
whichChild
finds the appropriate index of that Seq.
queryPoint
- public void makeChildren()
public scala.collection.Seq<Vector> partitionBox(Vector center, Vector width)
center
- the center of the boxwidth
- a vector of lengths of each dimension of the boxCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.