|
||||||||||
| 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 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. |
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()
|
| 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 VersionProperty VERSION
| Constructor Detail |
|---|
public CSplineInterpolator()
| Method Detail |
|---|
public Point2D addPoint(double x,
double y)
Interpolator
addPoint in interface Interpolatorx - x-value to addy - y-value to add
public Point2D insertPoint(int i,
double x,
double y)
Interpolator
insertPoint in interface Interpolatori - 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 Interpolatorpoints - List of Points to add
public void addPoints(int i,
List<Point2D> points)
Interpolator
addPoints in interface Interpolatori - index for where to add the Pointspoints - List of Points to add
public Point2D setPoint(int i,
double x,
double y)
Interpolator
setPoint in interface Interpolatori - index of the point to setx - x-value to sety - y-value to set
public void removePoint(Point2D p)
Interpolator
removePoint in interface Interpolatorp - the Point to removepublic Point2D removePoint(int i)
Interpolator
removePoint in interface Interpolatori - index of the Point to remove
public List<Point2D> getControlPoints()
Interpolator
getControlPoints in interface Interpolatorpublic List<Point2D> getInterpolatedPoints()
Interpolator
getInterpolatedPoints in interface Interpolatorpublic boolean interpolationChanged()
Interpolator
interpolationChanged in interface Interpolatorpublic void clear()
Interpolator
clear in interface Interpolatorpublic VersionProperty getInterpolatorVersion()
Interpolator
getInterpolatorVersion in interface Interpolatorpublic boolean touchesControlPoints()
touchesControlPoints in interface Interpolator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||