Class Path2DInfo.Entry

java.lang.Object
org.bzdev.geom.Path2DInfo.Entry
Enclosing class:
Path2DInfo

public static class Path2DInfo.Entry extends Object
Class defining a list entry describing a path segment. The list is returned by calling getEntries.
See Also:
  • Method Details

    • getIndex

      public int getIndex()
      Get an index indicating the segment's position along a path.
      Returns:
      the index
    • getStart

      public Point2D getStart()
      Get the starting point for the segment
      Returns:
      the starting point for the segment
    • getEnd

      public Point2D getEnd()
      Get the ending point for the segment.
      Returns:
      the ending point
    • getSegmentLength

      public double getSegmentLength()
      Get the length of a segment.
      Returns:
      the length of the segment
    • getSegmentLengthFunction

      public RealValuedFunctOps getSegmentLengthFunction()
      Get a function that will compute the length of a subsegment from the start of of the segment to a point specified by the segment's path parameter.

      In some unsual cases, a function is not available due to numerical accuracy issues, in which case numerical integration may be used.

      Returns:
      a function that computes the subsegment length given a path parameter provided as the function's argument; null if a function is not available.
    • getCoords

      public double[] getCoords()
      Get the coordinate array for the segment. This will include intermediate control points and the end point but not the starting point of the segment. The coordinate array that is returned must not be modified.
      Returns:
      the coordinate array for the segment
    • getData

      public Path2DInfo.SegmentData getData()
      Get the segment data associated with this segment.
      Returns:
      the segment data for this entry
    • getType

      public int getType()
      Get the type of the segment
      Returns:
      the segment type (PathIterator.SEG_MOVETO, PathIterator.SEG_LINETO, PathIterator.SEG_QUADTO, PathIterator.SEG_CUBICTO and PathIterator.SEG_CLOSE)
    • getTypeString

      public String getTypeString()
      Get the type of the segment, formatted as a string
      Returns:
      a string describing the segment type