Package snap.geom

Class PathIter

java.lang.Object
snap.geom.PathIter
Direct Known Subclasses:
Polygon3D.PointArrayPathIter2D

public abstract class PathIter extends Object
A class to iterate over segments in a shape, providing specific coordinate information.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Transform
     
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new PathIter.
    Creates a new PathIter for given transform.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final Seg
    arcTo(double lx, double ly, double cx, double cy, double x, double y, double[] coords)
    Returns a CubicTo for start, corner and end points.
    protected final Seg
    Returns a close.
    protected final Seg
    cubicTo(double aCPX0, double aCPY0, double aCPX1, double aCPY1, double aX, double aY, double[] coords)
    Returns a CubicTo for given coords.
    static double
    Returns total length of segments for given PathIter.
    static Rect
    getBounds(PathIter aPathIter)
    Returns bounds rect for given PathIter.
    abstract Seg
    getNext(double[] coords)
    Returns the next segment.
    getNext(float[] coords)
    Returns the next segment (float coords).
    static PathIter
    Returns a combined PathIter for given array of PathIter.
    Returns the Transform associated with this PathIter.
    int
    Returns the winding - how a path determines what to fill when segments intersect.
    abstract boolean
    Returns whether has next segment.
    protected final Seg
    lineTo(double aX, double aY, double[] coords)
    Returns a LineTo for given coords.
    protected final Seg
    moveTo(double aX, double aY, double[] coords)
    Returns a MoveTo for given coords.
    protected final Seg
    quadTo(double aCPX, double aCPY, double aX, double aY, double[] coords)
    Returns a QuadTo for given coords.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • PathIter

      public PathIter()
      Creates a new PathIter.
    • PathIter

      public PathIter(Transform aTrans)
      Creates a new PathIter for given transform.
  • Method Details

    • getTransform

      public Transform getTransform()
      Returns the Transform associated with this PathIter.
    • getWinding

      public int getWinding()
      Returns the winding - how a path determines what to fill when segments intersect.
    • getNext

      public abstract Seg getNext(double[] coords)
      Returns the next segment.
    • getNext

      public Seg getNext(float[] coords)
      Returns the next segment (float coords).
    • hasNext

      public abstract boolean hasNext()
      Returns whether has next segment.
    • moveTo

      protected final Seg moveTo(double aX, double aY, double[] coords)
      Returns a MoveTo for given coords.
    • lineTo

      protected final Seg lineTo(double aX, double aY, double[] coords)
      Returns a LineTo for given coords.
    • quadTo

      protected final Seg quadTo(double aCPX, double aCPY, double aX, double aY, double[] coords)
      Returns a QuadTo for given coords.
    • cubicTo

      protected final Seg cubicTo(double aCPX0, double aCPY0, double aCPX1, double aCPY1, double aX, double aY, double[] coords)
      Returns a CubicTo for given coords.
    • arcTo

      protected final Seg arcTo(double lx, double ly, double cx, double cy, double x, double y, double[] coords)
      Returns a CubicTo for start, corner and end points.
    • close

      protected final Seg close()
      Returns a close.
    • getBounds

      public static Rect getBounds(PathIter aPathIter)
      Returns bounds rect for given PathIter.
    • getArcLength

      public static double getArcLength(PathIter aPathIter)
      Returns total length of segments for given PathIter.
    • getPathIterForPathIterArray

      public static PathIter getPathIterForPathIterArray(PathIter[] pathIters)
      Returns a combined PathIter for given array of PathIter.