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 type
N - 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 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.
  • Constructor Details

    • ClosestFirstVisitor

      protected ClosestFirstVisitor(P target)
      Simple constructor.
      Parameters:
      target - the point serving as the target for the traversal
  • Method Details

    • visitOrder

      public BSPTreeVisitor.Order visitOrder(N node)
      Determine the visit order for the given internal node. This is called for each internal node before BSPTreeVisitor.visit(BSPTree.Node) is called. Returning null or BSPTreeVisitor.Order.NONEfrom 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