Enum PolylineStage

java.lang.Object
java.lang.Enum<PolylineStage>
org.apache.sis.internal.processing.isoline.PolylineStage
All Implemented Interfaces:
Serializable, Comparable<PolylineStage>, java.lang.constant.Constable

@Debug enum PolylineStage extends Enum<PolylineStage>
Tells at which stage are the polylines represented by a Java2D Shape. A set of polylines way still be under construction in PolylineBuffer during iteration over pixel values, or the polylines may have been classified as incomplete after iteration over a row, or the polylines may be final result.

This is used only for debugging purposes because end users should see only the final result. This information allows StepsViewer (in test package) to use different colors for different stages.

Since:
1.3
Version:
1.3
  • Enum Constant Details

    • BUFFER

      public static final PolylineStage BUFFER
      The polylines are under construction in various PolylineBuffer instances. This is the first stage, which happens during iteration over pixel values.
    • FRAGMENT

      public static final PolylineStage FRAGMENT
      The polylines are no longer in the buffers filled by the iteration over pixel values, but are still incomplete. It happens when, after finishing iteration over a row, some polylines will not be continued by iteration on the next row and those polylines have not yet been closed as polygons. Those polyline fragments are moved to a "pending" list, as they may be closed later after more polylines fragments become available.
    • FINAL

      public static final PolylineStage FINAL
      The polylines are final result to be show to user.
  • Constructor Details

    • PolylineStage

      private PolylineStage()
  • Method Details

    • values

      public static PolylineStage[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static PolylineStage valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • destination

      private Path2D destination(Map<PolylineStage,Path2D> appendTo)
      Returns the destination where to write polylines for this stage.
      Parameters:
      appendTo - map of path for different stages.
      Returns:
      the path to use for writing polylines at this stage.
    • add

      final void add(Map<PolylineStage,Path2D> appendTo, double[] coordinates, int size)
      Adds coordinates to the specified map.
      Parameters:
      appendTo - where to append the coordinates.
      coordinates - (x,y) tuples to append, starting with the coordinate at index 0.
      size - number of coordinates to add (twice the number of tuples).
    • add

      final void add(Map<PolylineStage,Path2D> appendTo, Map<?,Fragments> partialPaths)
      Adds polylines in the values of the given map. Keys are ignored.
      Parameters:
      appendTo - where to append the coordinates.
      partialPaths - map of polylines to add.
    • add

      final void add(Map<PolylineStage,Path2D> appendTo, Shape polylines)
      Adds polylines to the specified map.
      Parameters:
      appendTo - where to append the polylines.
      polylines - the polylines to append to the map, or null if none.