Class BSPTreeVisitor.FarthestFirstVisitor<P extends Point<P>,N extends BSPTree.Node<P,N>>
java.lang.Object
org.apache.commons.geometry.core.partitioning.bsp.BSPTreeVisitor.TargetPointVisitor<P,N>
org.apache.commons.geometry.core.partitioning.bsp.BSPTreeVisitor.FarthestFirstVisitor<P,N>
- Type Parameters:
P
- Point implementation typeN
- BSP tree node implementation type
- All Implemented Interfaces:
BSPTreeVisitor<P,
N>
- Enclosing interface:
BSPTreeVisitor<P extends Point<P>,
N extends BSPTree.Node<P, N>>
public abstract static class BSPTreeVisitor.FarthestFirstVisitor<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 farthest from the target point
are traversed first. This is done by choosing BSPTreeVisitor.Order.PLUS_NODE_MINUS
when the target point lies on the minus side of the node's cut hyperplane and BSPTreeVisitor.Order.MINUS_NODE_PLUS
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.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.commons.geometry.core.partitioning.bsp.BSPTreeVisitor
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>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvisitOrder
(N node) Determine the visit order for the given internal node.Methods inherited from class org.apache.commons.geometry.core.partitioning.bsp.BSPTreeVisitor.TargetPointVisitor
getTarget
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.commons.geometry.core.partitioning.bsp.BSPTreeVisitor
visit
-
Constructor Details
-
FarthestFirstVisitor
Simple constructor.- Parameters:
target
- the point serving as the target for the traversal
-
-
Method Details
-
visitOrder
Determine the visit order for the given internal node. This is called for each internal node beforeBSPTreeVisitor.visit(BSPTree.Node)
is called. Returning null orBSPTreeVisitor.Order.NONE
from this method skips the subtree rooted at the given node. This method is not called on leaf nodes.- Parameters:
node
- the internal node to determine the visit order for- Returns:
- the order that the subtree rooted at the given node should be visited
-