Module org.dyn4j

Class SweepLineState


  • final class SweepLineState
    extends java.lang.Object
    Represents the current state of the SweepLine algorithm.

    The SweepLine algorithm maintains a DCEL to hold the triangulation, a binary tree for edge searching and the current sweepline intercept value.

    Since:
    3.2.0
    Version:
    3.2.0
    Author:
    William Bittle
    • Constructor Summary

      Constructors 
      Constructor Description
      SweepLineState()
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) SweepLineVertexType getType​(Vector2 point0, Vector2 point, Vector2 point1)
      Returns the vertex type given the previous and next points.
      (package private) java.util.PriorityQueue<SweepLineVertex> initialize​(Vector2[] points)
      Returns a priority queue of the points in the given array and initializes the Binary Tree and DCEL for the SweepLine algorithm.
      boolean isBelow​(Vector2 p, Vector2 q)
      Returns true if the given point p is below the given point q.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SweepLineState

        public SweepLineState()
        Default constructor.
    • Method Detail

      • initialize

        final java.util.PriorityQueue<SweepLineVertex> initialize​(Vector2[] points)
        Returns a priority queue of the points in the given array and initializes the Binary Tree and DCEL for the SweepLine algorithm.
        Parameters:
        points - the array of polygon points
        Returns:
        PriorityQueue<SweepLineVertex>
      • isBelow

        public boolean isBelow​(Vector2 p,
                               Vector2 q)
        Returns true if the given point p is below the given point q.

        If the point p and q form a horizontal line then p is considered below if its x coordinate is greater than q's x coordinate.

        Parameters:
        p - the point
        q - another point
        Returns:
        boolean true if p is below q; false if p is above q