P
- Point implementation typeN
- BSP tree node implementation typepublic abstract static class BSPTreeVisitor.ClosestFirstVisitor<P extends Point<P>,N extends BSPTree.Node<P,N>> extends BSPTreeVisitor.TargetPointVisitor<P,N>
BSPTreeVisitor
base class that orders tree nodes so that nodes closest to the target point are
visited first. This is done by choosing BSPTreeVisitor.Order.MINUS_NODE_PLUS
when the target point lies on the minus side of the node's cut hyperplane and BSPTreeVisitor.Order.PLUS_NODE_MINUS
when it lies on the plus side. The order BSPTreeVisitor.Order.MINUS_NODE_PLUS
order is used when
the target point lies directly on the node's cut hyerplane and no child node is closer than the other.BSPTreeVisitor.ClosestFirstVisitor<P extends Point<P>,N extends BSPTree.Node<P,N>>, BSPTreeVisitor.FarthestFirstVisitor<P extends Point<P>,N extends BSPTree.Node<P,N>>, BSPTreeVisitor.Order, BSPTreeVisitor.Result, BSPTreeVisitor.TargetPointVisitor<P extends Point<P>,N extends BSPTree.Node<P,N>>
Modifier | Constructor and Description |
---|---|
protected |
ClosestFirstVisitor(P target)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
BSPTreeVisitor.Order |
visitOrder(N node)
Determine the visit order for the given internal node.
|
getTarget
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
visit
protected ClosestFirstVisitor(P target)
target
- the point serving as the target for the traversalpublic BSPTreeVisitor.Order visitOrder(N node)
BSPTreeVisitor.visit(BSPTree.Node)
is called. Returning null
or BSPTreeVisitor.Order.NONE
from this method skips the subtree rooted at the given node.
This method is not called on leaf nodes.node
- the internal node to determine the visit order forCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.