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 class
BSPTreeVisitor.ClosestFirstVisitor<P extends Point<P>,
N extends BSPTree.Node<P, N>> BSPTreeVisitor
base class that orders tree nodes so that nodes closest to the target point are visited first.static class
BSPTreeVisitor.FarthestFirstVisitor<P extends Point<P>,
N extends BSPTree.Node<P, N>> BSPTreeVisitor
base class that orders tree nodes so that nodes farthest from the target point are traversed first.static enum
Enum used to specify the order in which visitors should visit the nodes in the tree.static enum
Enum representing the result of a BSP tree node visit operation.static class
BSPTreeVisitor.TargetPointVisitor<P extends Point<P>,
N extends BSPTree.Node<P, N>> Abstract class forBSPTreeVisitor
implementations that base their visit ordering on a target point. -
Method Summary
Modifier and TypeMethodDescriptionVisit a node in a BSP tree.default BSPTreeVisitor.Order
visitOrder
(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.NONE
from 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
-