edu.stanford.hci.r3.util.geometry
Class CatmullRomSpline

java.lang.Object
  extended by 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.


Constructor Summary
CatmullRomSpline()
           
 
Method Summary
 java.util.List<Vector2D> getBackwardTangents()
           
 java.util.List<java.awt.geom.Point2D> getControlPoints()
           
 java.util.List<Vector2D> getForwardTangents()
           
 java.awt.Shape getLineShape()
           
 java.util.List<java.awt.geom.Point2D> getPathPoints()
           
 java.awt.Shape getShape()
           
 void setPoints(double[] x, double[] y)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatmullRomSpline

public CatmullRomSpline()
Method Detail

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 -

Copyright 2006 Stanford University