Interface BSPTreeVisitor<P extends Point<P>, N extends BSPTree.Node<P,N>>
- Type Parameters:
P- Point implementation typeN- BSP tree node implementation type
- All Known Implementing Classes:
AbstractRegionBSPTree.BoundaryProjector, BSPTreePrinter, BSPTreeVisitor.ClosestFirstVisitor, BSPTreeVisitor.FarthestFirstVisitor, BSPTreeVisitor.TargetPointVisitor, RegionBSPTree1D.BoundaryProjector1D, RegionBSPTree1S.BoundaryProjector1S, RegionBSPTree2D.BoundaryProjector2D, RegionBSPTree2D.LinecastVisitor, RegionBSPTree2S.BoundaryProjector2S, RegionBSPTree3D.BoundaryProjector3D, RegionBSPTree3D.LinecastVisitor, RegionBSPTree3D.RegionSizePropertiesVisitor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface BSPTreeVisitor<P extends Point<P>, N extends BSPTree.Node<P,N>>
Interface for visiting the nodes in a
BSPTree or BSPSubtree.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBSPTreeVisitor.ClosestFirstVisitor<P extends Point<P>, N extends BSPTree.Node<P,N>> BSPTreeVisitorbase class that orders tree nodes so that nodes closest to the target point are visited first.static classBSPTreeVisitor.FarthestFirstVisitor<P extends Point<P>, N extends BSPTree.Node<P,N>> BSPTreeVisitorbase class that orders tree nodes so that nodes farthest from the target point are traversed first.static enumEnum used to specify the order in which visitors should visit the nodes in the tree.static enumEnum representing the result of a BSP tree node visit operation.static classBSPTreeVisitor.TargetPointVisitor<P extends Point<P>, N extends BSPTree.Node<P,N>> Abstract class forBSPTreeVisitorimplementations that base their visit ordering on a target point. -
Method Summary
Modifier and TypeMethodDescriptionVisit a node in a BSP tree.default BSPTreeVisitor.OrdervisitOrder(N internalNode) Determine the visit order for the given internal node.
-
Method Details
-
visit
Visit a node in a BSP tree. This method is called for both internal nodes and leaf nodes.- Parameters:
node- the node being visited- Returns:
- the result of the visit operation
-
visitOrder
Determine the visit order for the given internal node. This is called for each internal node beforevisit(BSPTree.Node)is called. Returning null orBSPTreeVisitor.Order.NONEfrom this method skips the subtree rooted at the given node. This method is not called on leaf nodes.- Parameters:
internalNode- the internal node to determine the visit order for- Returns:
- the order that the subtree rooted at the given node should be visited
-