org.robokind.api.interpolation
Interface Interpolator

All Known Implementing Classes:
BezierInterpolator, CSplineInterpolator, LinearInterpolator, MotionPath, PathInterpolator

public interface Interpolator

An Interpolator is able to take a sparse set of Points and interpolate intermediate Points.

Author:
Matthew Stevenson

Method Summary
 Point2D addPoint(double x, double y)
          Adds a new Point with the given x and y value.
 void addPoints(int i, List<Point2D> points)
          Adds a List of Point at the given index.
 void addPoints(List<Point2D> points)
          Adds a List of Points.
 void clear()
          Clears all the Points from the Interpolator.
 List<Point2D> getControlPoints()
          Returns a list of the Interpolator's points.
 List<Point2D> getInterpolatedPoints()
          Returns a List of Points interpolated from the Interpolator's control points.
 org.robokind.api.common.config.VersionProperty getInterpolatorVersion()
          Return the Interpolator's VersionProperty.
 Point2D insertPoint(int i, double x, double y)
          Adds a new point at the given index.
 boolean interpolationChanged()
          Returns true if the List of interpolated Points has changed since last being requested and needs to be recalculated.
 Point2D removePoint(int i)
          Remove the Point at the given index.
 void removePoint(Point2D p)
          Removes the given Point from the Interpolator.
 Point2D setPoint(int i, double x, double y)
          Sets the x and y values of the Point at the given index.
 boolean touchesControlPoints()
           
 

Method Detail

addPoint

Point2D addPoint(double x,
                 double y)
Adds a new Point with the given x and y value.

Parameters:
x - x-value to add
y - y-value to add
Returns:
the Point which was added

insertPoint

Point2D insertPoint(int i,
                    double x,
                    double y)
Adds a new point at the given index.

Parameters:
i - index for where to add the new Point
x - x-value to add
y - y-value to add
Returns:
the Point which was added

addPoints

void addPoints(List<Point2D> points)
Adds a List of Points.

Parameters:
points - List of Points to add

addPoints

void addPoints(int i,
               List<Point2D> points)
Adds a List of Point at the given index.

Parameters:
i - index for where to add the Points
points - List of Points to add

setPoint

Point2D setPoint(int i,
                 double x,
                 double y)
Sets the x and y values of the Point at the given index.

Parameters:
i - index of the point to set
x - x-value to set
y - y-value to set
Returns:
the Point after being set

removePoint

void removePoint(Point2D p)
Removes the given Point from the Interpolator.

Parameters:
p - the Point to remove

removePoint

Point2D removePoint(int i)
Remove the Point at the given index.

Parameters:
i - index of the Point to remove
Returns:
the Point removed

getControlPoints

List<Point2D> getControlPoints()
Returns a list of the Interpolator's points.

Returns:
list of the Interpolator's points

getInterpolatedPoints

List<Point2D> getInterpolatedPoints()
Returns a List of Points interpolated from the Interpolator's control points.

Returns:
List of Points interpolated from the Interpolator's control points

interpolationChanged

boolean interpolationChanged()
Returns true if the List of interpolated Points has changed since last being requested and needs to be recalculated.

Returns:
true if the List of interpolated Points has changed since last being requested and needs to be recalculated

clear

void clear()
Clears all the Points from the Interpolator.


getInterpolatorVersion

org.robokind.api.common.config.VersionProperty getInterpolatorVersion()
Return the Interpolator's VersionProperty. Used to specify an Interpolator type when serializing and de-serializing an Interpolator.

Returns:
Interpolator's VersionProperty

touchesControlPoints

boolean touchesControlPoints()


Copyright © 2011-2013. All Rights Reserved.