Class InteriorAngleGreatArcConnector

Direct Known Subclasses:
InteriorAngleGreatArcConnector.Maximize, InteriorAngleGreatArcConnector.Minimize

public abstract class InteriorAngleGreatArcConnector extends AbstractGreatArcConnector
Great arc connector that selects between multiple connection options based on the resulting interior angle. An interior angle in this case is the angle created between an incoming arc and an outgoing arc as measured on the minus (interior) side of the incoming arc. If looking along the direction of the incoming arc, smaller interior angles point more to the left and larger ones point more to the right.

This class provides two concrete implementations: InteriorAngleGreatArcConnector.Maximize and InteriorAngleGreatArcConnector.Minimize, which choose connections with the largest or smallest interior angles respectively.

  • Constructor Details

    • InteriorAngleGreatArcConnector

      public InteriorAngleGreatArcConnector()
  • Method Details

    • selectConnection

      Method called to select a connection to use for a given segment when multiple non-length-zero connections are available. In this case, the selection of the outgoing connection depends only on the desired characteristics of the connected path.
      Specified by:
      selectConnection in class AbstractPathConnector<AbstractGreatArcConnector.ConnectableGreatArc>
      Parameters:
      incoming - the incoming segment
      outgoing - list of available outgoing connections; will always contain at least two elements
      Returns:
      the connection to use
    • isBetterAngle

      protected abstract boolean isBetterAngle(double newAngle, double previousAngle)
      Return true if newAngle represents a better interior angle than previousAngle.
      Parameters:
      newAngle - the new angle under consideration
      previousAngle - the previous best angle
      Returns:
      true if newAngle represents a better interior angle than previousAngle
    • connectMaximized

      public static List<GreatArcPath> connectMaximized(Collection<GreatArc> arcs)
      Convenience method for connecting a set of arcs with interior angles maximized when possible. This method is equivalent to new Maximize().connect(segments).
      Parameters:
      arcs - arcs to connect
      Returns:
      a list of connected arc paths
      See Also:
    • connectMinimized

      public static List<GreatArcPath> connectMinimized(Collection<GreatArc> arcs)
      Convenience method for connecting a set of line segments with interior angles minimized when possible. This method is equivalent to new Minimize().connect(segments).
      Parameters:
      arcs - arcs to connect
      Returns:
      a list of connected arc paths
      See Also: