edu.stanford.hci.r3.util.geometry
Class CatmullRomSpline
java.lang.Object
edu.stanford.hci.r3.util.geometry.CatmullRomSpline
public class CatmullRomSpline
- extends java.lang.Object
A Catmull-Rom Spline. Great for Handwriting. It's a basic implementation, so it might not be optimized for
performance yet.
This software is distributed under the BSD License.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CatmullRomSpline
public CatmullRomSpline()
getBackwardTangents
public java.util.List<Vector2D> getBackwardTangents()
getControlPoints
public java.util.List<java.awt.geom.Point2D> getControlPoints()
getForwardTangents
public java.util.List<Vector2D> getForwardTangents()
- Returns:
getLineShape
public java.awt.Shape getLineShape()
- Returns:
getPathPoints
public java.util.List<java.awt.geom.Point2D> getPathPoints()
- Returns:
- a copy of the path's points
getShape
public java.awt.Shape getShape()
- Returns:
setPoints
public void setPoints(double[] x,
double[] y)
- Parameters:
x
- y
-
setPoints
public void setPoints(java.util.List<java.awt.geom.Point2D> points)
- TODO: Create a different hybridized spline, that will only go to Catmull-Rom if the points are far
enough apart. Otherwise, it will just default to lineTos...
- Parameters:
points
-