Class RegionBSPTree2D.LinecastVisitor

    • Field Detail

      • linecastSubset

        private final LineConvexSubset linecastSubset
        The line subset to intersect with the boundaries of the BSP tree.
      • firstOnly

        private final boolean firstOnly
        If true, the visitor will stop visiting the tree once the first linecast point is determined.
      • minAbscissa

        private double minAbscissa
        The minimum abscissa found during the search.
      • results

        private final java.util.List<LinecastPoint2D> results
        List of results from the linecast operation.
    • Constructor Detail

      • LinecastVisitor

        LinecastVisitor​(LineConvexSubset linecastSubset,
                        boolean firstOnly)
        Create a new instance with the given intersecting line subset.
        Parameters:
        linecastSubset - line subset to intersect with the BSP tree region boundary
        firstOnly - if true, the visitor will stop visiting the tree once the first linecast point is determined
    • Method Detail

      • getFirstResult

        public LinecastPoint2D getFirstResult()
        Get the first LinecastPoint2D resulting from the linecast operation.
        Returns:
        the first linecast result point
      • getResults

        public java.util.List<LinecastPoint2D> getResults()
        Get a list containing the results of the linecast operation. The list is sorted and filtered.
        Returns:
        list of sorted and filtered results from the linecast operation
      • computeLinecastPoint

        private LinecastPoint2D computeLinecastPoint​(Vector2D pt,
                                                     RegionBSPTree2D.RegionNode2D node)
        Compute the linecast point for the given intersection point and tree node, returning null if the point does not actually lie on the region boundary.
        Parameters:
        pt - intersection point
        node - node containing the cut that the linecast line intersected with
        Returns:
        a new linecast point instance or null if the intersection point does not lie on the region boundary