Class AbstractRegionBSPTree.BoundaryProjector<P extends Point<P>,​N extends AbstractRegionBSPTree.AbstractRegionNode<P,​N>>

    • Field Detail

      • projected

        private P extends Point<P> projected
        The projected point.
      • minDist

        private double minDist
        The current closest distance to the boundary found.
    • Constructor Detail

      • BoundaryProjector

        public BoundaryProjector​(P point)
        Simple constructor.
        Parameters:
        point - the point to project onto the region's boundary
    • Method Detail

      • visit

        public BSPTreeVisitor.Result visit​(N node)
        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
      • isPossibleClosestCut

        protected boolean isPossibleClosestCut​(HyperplaneSubset<P> cut,
                                               P target,
                                               double currentMinDist)
        Return true if the given node cut is a possible candidate for containing the closest region boundary point to the target.
        Parameters:
        cut - the node cut to test
        target - the target point being projected
        currentMinDist - the smallest distance found so far to a region boundary; this value is guaranteed to be non-negative
        Returns:
        true if the cut is a possible candidate for containing the closest region boundary point to the target
      • disambiguateClosestPoint

        protected P disambiguateClosestPoint​(P target,
                                             P a,
                                             P b)
        Method used to determine which of points a and b should be considered as the "closest" point to target when the points are exactly equidistant.
        Parameters:
        target - the target point
        a - first point to consider
        b - second point to consider
        Returns:
        which of a or b should be considered as the one closest to target
      • getProjected

        public P getProjected()
        Get the projected point on the region's boundary, or null if no point could be found.
        Returns:
        the projected point on the region's boundary