processing.opengl

## Class LinePath

- java.lang.Object
- - processing.opengl.LinePath

-     public class LinePath
      extends Object

  The `LinePath` class allows to represent polygonal paths, potentially composed by several disjoint polygonal segments. It can be iterated by the `LinePath.PathIterator` class including all of its segment types and winding rules

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `LinePath.PathIterator`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `CAP_BUTT` Ends unclosed subpaths and dash segments with no added decoration.
    `static int` | `CAP_ROUND` Ends unclosed subpaths and dash segments with a round decoration that has a radius equal to half of the width of the pen.
    `static int` | `CAP_SQUARE` Ends unclosed subpaths and dash segments with a square projection that extends beyond the end of the segment to a distance equal to half of the line width.
    `static int` | `JOIN_BEVEL` Joins path segments by connecting the outer corners of their wide outlines with a straight segment.
    `static int` | `JOIN_MITER` Joins path segments by extending their outside edges until they meet.
    `static int` | `JOIN_ROUND` Joins path segments by rounding off the corner at a radius of half the line width.
    `static byte` | `SEG_CLOSE` Closes segment at current position.
    `static byte` | `SEG_LINETO` Extends segment by adding a line to a given position.
    `static byte` | `SEG_MOVETO` Starts segment at a given position.
    `static int` | `WIND_EVEN_ODD` The winding rule constant for specifying an even-odd rule for determining the interior of a path.
    `static int` | `WIND_NON_ZERO` The winding rule constant for specifying a non-zero rule for determining the interior of a path.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LinePath()` Constructs a new empty single precision `LinePath` object with a default winding rule of `WIND_NON_ZERO`.
    `LinePath(int rule)` Constructs a new empty single precision `LinePath` object with the specified winding rule to control operations that require the interior of the path to be defined.
    `LinePath(int rule, int initialCapacity)` Constructs a new `LinePath` object from the given specified initial values.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closePath()` Closes the current subpath by drawing a straight line back to the coordinates of the last `moveTo`.
    `static byte[]` | `copyOf(byte[] source, int length)`
    `static float[]` | `copyOf(float[] source, int length)`
    `static int[]` | `copyOf(int[] source, int length)`
    `static LinePath` | `createStrokedPath(LinePath src, float weight, int caps, int join)`
    `static LinePath` | `createStrokedPath(LinePath src, float weight, int caps, int join, float miterlimit)`
    `static LinePath` | `createStrokedPath(LinePath src, float weight, int caps, int join, float miterlimit, PMatrix2D transform)` Constructs a solid `LinePath` with the specified attributes.
    `LinePath.PathIterator` | `getPathIterator()` The iterator for this class is not multi-threaded safe, which means that the `LinePath` class does not guarantee that modifications to the geometry of this `LinePath` object do not affect any iterations of that geometry that are already in process.
    `int` | `getWindingRule()` Returns the fill style winding rule.
    `static double` | `hypot(double x, double y)`
    `static int` | `hypot(int x, int y)`
    `static long` | `hypot(long x, long y)`
    `static int` | `isqrt(int x)`
    `void` | `lineTo(float x, float y, int c)` Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in float precision.
    `static long` | `lsqrt(long x)`
    `void` | `moveTo(float x, float y, int c)` Adds a point to the path by moving to the specified coordinates specified in float precision.
    `void` | `reset()` Resets the path to empty.
    `void` | `setWindingRule(int rule)` Sets the winding rule for this path to the specified value.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### WIND_EVEN_ODD

          public static final int WIND_EVEN_ODD

      The winding rule constant for specifying an even-odd rule for determining the interior of a path. The even-odd rule specifies that a point lies inside the path if a ray drawn in any direction from that point to infinity is crossed by path segments an odd number of times.
      See Also:
        Constant Field Values

    - #### WIND_NON_ZERO

          public static final int WIND_NON_ZERO

      The winding rule constant for specifying a non-zero rule for determining the interior of a path. The non-zero rule specifies that a point lies inside the path if a ray drawn in any direction from that point to infinity is crossed by path segments a different number of times in the counter-clockwise direction than the clockwise direction.
      See Also:
        Constant Field Values

    - #### SEG_MOVETO

          public static final byte SEG_MOVETO

      Starts segment at a given position.
      See Also:
        Constant Field Values

    - #### SEG_LINETO

          public static final byte SEG_LINETO

      Extends segment by adding a line to a given position.
      See Also:
        Constant Field Values

    - #### SEG_CLOSE

          public static final byte SEG_CLOSE

      Closes segment at current position.
      See Also:
        Constant Field Values

    - #### JOIN_MITER

          public static final int JOIN_MITER

      Joins path segments by extending their outside edges until they meet.
      See Also:
        Constant Field Values

    - #### JOIN_ROUND

          public static final int JOIN_ROUND

      Joins path segments by rounding off the corner at a radius of half the line width.
      See Also:
        Constant Field Values

    - #### JOIN_BEVEL

          public static final int JOIN_BEVEL

      Joins path segments by connecting the outer corners of their wide outlines with a straight segment.
      See Also:
        Constant Field Values

    - #### CAP_BUTT

          public static final int CAP_BUTT

      Ends unclosed subpaths and dash segments with no added decoration.
      See Also:
        Constant Field Values

    - #### CAP_ROUND

          public static final int CAP_ROUND

      Ends unclosed subpaths and dash segments with a round decoration that has a radius equal to half of the width of the pen.
      See Also:
        Constant Field Values

    - #### CAP_SQUARE

          public static final int CAP_SQUARE

      Ends unclosed subpaths and dash segments with a square projection that extends beyond the end of the segment to a distance equal to half of the line width.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### LinePath

          public LinePath()

      Constructs a new empty single precision `LinePath` object with a default winding rule of `WIND_NON_ZERO`.

    - #### LinePath

          public LinePath(int rule)

      Constructs a new empty single precision `LinePath` object with the specified winding rule to control operations that require the interior of the path to be defined.
      Parameters:
        `rule` - the winding rule
      See Also:
        `WIND_EVEN_ODD`, `WIND_NON_ZERO`

    - #### LinePath

          public LinePath(int rule,
                  int initialCapacity)

      Constructs a new `LinePath` object from the given specified initial values. This method is only intended for internal use and should not be made public if the other constructors for this class are ever exposed.
      Parameters:
        `rule` - the winding rule
        `initialTypes` - the size to make the initial array to store the path segment types

  - ### Method Detail

    - #### moveTo

          public final void moveTo(float x,
                    float y,
                    int c)

      Adds a point to the path by moving to the specified coordinates specified in float precision.

      This method provides a single precision variant of the double precision `moveTo()` method on the base `LinePath` class.

      Parameters:
        `x` - the specified X coordinate
        `y` - the specified Y coordinate
      See Also:
        `moveTo(float, float, int)`

    - #### lineTo

          public final void lineTo(float x,
                    float y,
                    int c)

      Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in float precision.

      This method provides a single precision variant of the double precision `lineTo()` method on the base `LinePath` class.

      Parameters:
        `x` - the specified X coordinate
        `y` - the specified Y coordinate
      See Also:
        `lineTo(float, float, int)`

    - #### getPathIterator

          public LinePath.PathIterator getPathIterator()

      The iterator for this class is not multi-threaded safe, which means that the `LinePath` class does not guarantee that modifications to the geometry of this `LinePath` object do not affect any iterations of that geometry that are already in process.

    - #### closePath

          public final void closePath()

      Closes the current subpath by drawing a straight line back to the coordinates of the last `moveTo`. If the path is already closed then this method has no effect.

    - #### getWindingRule

          public final int getWindingRule()

      Returns the fill style winding rule.
      Returns:
        an integer representing the current winding rule.
      See Also:
        `WIND_EVEN_ODD`, `WIND_NON_ZERO`, `setWindingRule(int)`

    - #### setWindingRule

          public final void setWindingRule(int rule)

      Sets the winding rule for this path to the specified value.
      Parameters:
        `rule` - an integer representing the specified winding rule
      Throws:
        `IllegalArgumentException` - if `rule` is not either `WIND_EVEN_ODD` or `WIND_NON_ZERO`
      See Also:
        `getWindingRule()`

    - #### reset

          public final void reset()

      Resets the path to empty. The append position is set back to the beginning of the path and all coordinates and point types are forgotten.

    - #### createStrokedPath

          public static LinePath createStrokedPath(LinePath src,
                                   float weight,
                                   int caps,
                                   int join)

    - #### createStrokedPath

          public static LinePath createStrokedPath(LinePath src,
                                   float weight,
                                   int caps,
                                   int join,
                                   float miterlimit)

    - #### createStrokedPath

          public static LinePath createStrokedPath(LinePath src,
                                   float weight,
                                   int caps,
                                   int join,
                                   float miterlimit,
                                   PMatrix2D transform)

      Constructs a solid `LinePath` with the specified attributes.
      Parameters:
        `src` - the original path to be stroked
        `weight` - the weight of the stroked path
        `cap` - the decoration of the ends of the segments in the path
        `join` - the decoration applied where path segments meet
        `miterlimit` -
        `transform` -

    - #### copyOf

          public static float[] copyOf(float[] source,
                       int length)

    - #### copyOf

          public static byte[] copyOf(byte[] source,
                      int length)

    - #### copyOf

          public static int[] copyOf(int[] source,
                     int length)

    - #### isqrt

          public static int isqrt(int x)

    - #### lsqrt

          public static long lsqrt(long x)

    - #### hypot

          public static double hypot(double x,
                     double y)

    - #### hypot

          public static int hypot(int x,
                  int y)

    - #### hypot

          public static long hypot(long x,
                   long y)