Class BSPTreeVisitor.ClosestFirstVisitor<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.ClosestFirstVisitor<P,N>
-
- Type Parameters:
P
- Point implementation typeN
- BSP tree node implementation type
- All Implemented Interfaces:
BSPTreeVisitor<P,N>
- Direct Known Subclasses:
AbstractRegionBSPTree.BoundaryProjector
- Enclosing interface:
- BSPTreeVisitor<P extends Point<P>,N extends BSPTree.Node<P,N>>
public 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 choosingBSPTreeVisitor.Order.MINUS_NODE_PLUS
when the target point lies on the minus side of the node's cut hyperplane andBSPTreeVisitor.Order.PLUS_NODE_MINUS
when it lies on the plus side. The orderBSPTreeVisitor.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 Modifier Constructor Description protected
ClosestFirstVisitor(P target)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BSPTreeVisitor.Order
visitOrder(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 Detail
-
ClosestFirstVisitor
protected ClosestFirstVisitor(P target)
Simple constructor.- Parameters:
target
- the point serving as the target for the traversal
-
-
Method Detail
-
visitOrder
public BSPTreeVisitor.Order visitOrder(N node)
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
-
-