org.robokind.api.interpolation.bezier
Class BezierInterpolator

java.lang.Object
  extended by org.robokind.api.interpolation.bezier.BezierInterpolator
All Implemented Interfaces:
Interpolator

public class BezierInterpolator
extends Object
implements Interpolator

Author:
Matthew Liston

Field Summary
static org.robokind.api.common.config.VersionProperty VERSION
          Interpolator VersionProperty.
static String VERSION_NAME
          Interpolator version name.
static String VERSION_NUMBER
          Interpolator version number.
 
Constructor Summary
BezierInterpolator()
          Creates a new empty LinearInterpolator.
 
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> condensePoints(ArrayList<Point2D> A, int step)
           
 Point2D dissect(Point2D a, Point2D b, int segpos)
           
 List<Point2D> doSegment(int seg, int j)
           
 boolean equals(Object obj)
           
 Point2D getBPoint(int segpos, Point2D a, Point2D b, Point2D c)
           
 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.
 int hashCode()
           
 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()
           
 void updateInterpolation()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_NAME

public static final String VERSION_NAME
Interpolator version name.

See Also:
Constant Field Values

VERSION_NUMBER

public static final String VERSION_NUMBER
Interpolator version number.

See Also:
Constant Field Values

VERSION

public static final org.robokind.api.common.config.VersionProperty VERSION
Interpolator VersionProperty.

Constructor Detail

BezierInterpolator

public BezierInterpolator()
Creates a new empty LinearInterpolator.

Method Detail

addPoint

public Point2D addPoint(double x,
                        double y)
Description copied from interface: Interpolator
Adds a new Point with the given x and y value.

Specified by:
addPoint in interface Interpolator
Parameters:
x - x-value to add
y - y-value to add
Returns:
the Point which was added

insertPoint

public Point2D insertPoint(int i,
                           double x,
                           double y)
Description copied from interface: Interpolator
Adds a new point at the given index.

Specified by:
insertPoint in interface Interpolator
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

public void addPoints(List<Point2D> points)
Description copied from interface: Interpolator
Adds a List of Points.

Specified by:
addPoints in interface Interpolator
Parameters:
points - List of Points to add

addPoints

public void addPoints(int i,
                      List<Point2D> points)
Description copied from interface: Interpolator
Adds a List of Point at the given index.

Specified by:
addPoints in interface Interpolator
Parameters:
i - index for where to add the Points
points - List of Points to add

setPoint

public Point2D setPoint(int i,
                        double x,
                        double y)
Description copied from interface: Interpolator
Sets the x and y values of the Point at the given index.

Specified by:
setPoint in interface Interpolator
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

public void removePoint(Point2D p)
Description copied from interface: Interpolator
Removes the given Point from the Interpolator.

Specified by:
removePoint in interface Interpolator
Parameters:
p - the Point to remove

removePoint

public Point2D removePoint(int i)
Description copied from interface: Interpolator
Remove the Point at the given index.

Specified by:
removePoint in interface Interpolator
Parameters:
i - index of the Point to remove
Returns:
the Point removed

getControlPoints

public List<Point2D> getControlPoints()
Description copied from interface: Interpolator
Returns a list of the Interpolator's points.

Specified by:
getControlPoints in interface Interpolator
Returns:
list of the Interpolator's points

updateInterpolation

public void updateInterpolation()

doSegment

public List<Point2D> doSegment(int seg,
                               int j)

condensePoints

public List<Point2D> condensePoints(ArrayList<Point2D> A,
                                    int step)

getBPoint

public Point2D getBPoint(int segpos,
                         Point2D a,
                         Point2D b,
                         Point2D c)

dissect

public Point2D dissect(Point2D a,
                       Point2D b,
                       int segpos)

getInterpolatedPoints

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

Specified by:
getInterpolatedPoints in interface Interpolator
Returns:
List of Points interpolated from the Interpolator's control points

interpolationChanged

public boolean interpolationChanged()
Description copied from interface: Interpolator
Returns true if the List of interpolated Points has changed since last being requested and needs to be recalculated.

Specified by:
interpolationChanged in interface Interpolator
Returns:
true if the List of interpolated Points has changed since last being requested and needs to be recalculated

clear

public void clear()
Description copied from interface: Interpolator
Clears all the Points from the Interpolator.

Specified by:
clear in interface Interpolator

getInterpolatorVersion

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

Specified by:
getInterpolatorVersion in interface Interpolator
Returns:
Interpolator's VersionProperty

touchesControlPoints

public boolean touchesControlPoints()
Specified by:
touchesControlPoints in interface Interpolator

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2011-2013. All Rights Reserved.