Class ParametricPathIterator

  • All Implemented Interfaces:
    PathIterator
    Direct Known Subclasses:
    Spiral2DPathIterator


    public abstract class ParametricPathIterator
    extends Object
    implements PathIterator
    This iterates over a path defined by a parametric equation. To subclass it you need to be able to evaluate x(t), y(t), dx(t) and dy(t).

    Also subclasses are responsible for knowing how much to increment t by for each path segment.

    This object will translate the parametric function into cubic bezier curves.

    • Constructor Detail

      • ParametricPathIterator

        public ParametricPathIterator(AffineTransform transform)
        Create a new ParametricPathIterator with a WIND_NON_ZERO winding rule.
        Parameters:
        transform - an optional transform to pass these segments through.
      • ParametricPathIterator

        public ParametricPathIterator(int windingRule,
                                      AffineTransform transform)
        Create a new ParametricPathIterator.
        Parameters:
        windingRule - the winding rule. This must be WIND_EVEN_ODD or WIND_NON_ZERO
        transform - an optional transform to pass these segments through.
    • Method Detail

      • currentSegment

        public final int currentSegment(float[] coords)
      • getX

        protected abstract double getX(double t)
      • getY

        protected abstract double getY(double t)
      • getDX

        protected abstract double getDX(double t)
      • getDY

        protected abstract double getDY(double t)
      • currentSegment

        public final int currentSegment(double[] coords)
      • getWindingRule

        public final int getWindingRule()
      • isDone

        public final boolean isDone()
      • next

        public final void next()
        Iterates to the next segment. This will consult getNextT() and getMaxT()
      • getMaxT

        protected abstract double getMaxT()
        The highest value for t.
        Returns:
        the max value for t. Once this value is used this PathIterator is finished.
      • getNextT

        protected abstract double getNextT(double t)
        The t-value that we should use next. If this is greater than getMaxT(), then the maximum is used in the next segment and this PathIterator is finished.
        Parameters:
        t - the current t-value
        Returns:
        the next t-value