|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.robokind.api.interpolation.cspline.CSplineInterpolator
public class CSplineInterpolator
Implementation of a Catmull-Rom Cardinal Spline using reflected endpoints. A Cardinal Spline represents the natural curve of a rope under tension. A Catmull-Rom Spline is a Cardinal spline with a fixed tension of T=0.5. The standard c-spline has hidden endpoints which influence the curvature of the first and last segment. Instead of having them user defined, the reflected endpoints method is used. Hidden points as reflections around the first and last point are added as a simple heuristic for good continuity.
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 | |
---|---|
CSplineInterpolator()
Creates an empty CSplineInterpolator. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String VERSION_NAME
public static final String VERSION_NUMBER
public static final org.robokind.api.common.config.VersionProperty VERSION
Constructor Detail |
---|
public CSplineInterpolator()
Method Detail |
---|
public Point2D addPoint(double x, double y)
Interpolator
addPoint
in interface Interpolator
x
- x-value to addy
- y-value to add
public Point2D insertPoint(int i, double x, double y)
Interpolator
insertPoint
in interface Interpolator
i
- index for where to add the new Pointx
- x-value to addy
- y-value to add
public void addPoints(List<Point2D> points)
Interpolator
addPoints
in interface Interpolator
points
- List of Points to addpublic void addPoints(int i, List<Point2D> points)
Interpolator
addPoints
in interface Interpolator
i
- index for where to add the Pointspoints
- List of Points to addpublic Point2D setPoint(int i, double x, double y)
Interpolator
setPoint
in interface Interpolator
i
- index of the point to setx
- x-value to sety
- y-value to set
public void removePoint(Point2D p)
Interpolator
removePoint
in interface Interpolator
p
- the Point to removepublic Point2D removePoint(int i)
Interpolator
removePoint
in interface Interpolator
i
- index of the Point to remove
public List<Point2D> getControlPoints()
Interpolator
getControlPoints
in interface Interpolator
public List<Point2D> getInterpolatedPoints()
Interpolator
getInterpolatedPoints
in interface Interpolator
public boolean interpolationChanged()
Interpolator
interpolationChanged
in interface Interpolator
public void clear()
Interpolator
clear
in interface Interpolator
public org.robokind.api.common.config.VersionProperty getInterpolatorVersion()
Interpolator
getInterpolatorVersion
in interface Interpolator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |