All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class att.grappa.BezierSpline

java.lang.Object
   |
   +----java.util.Vector
           |
           +----att.grappa.LineVector
                   |
                   +----att.grappa.BezierSpline

public class BezierSpline
extends LineVector
Calculates and stores a bezier spline of degree 3 from a Vector of control points.

Version:
1.1, 30 Sep 1999; Copyright 1996 - 1999 by AT&T Corp.
Author:
John Mocenigo, Research @ AT&T Labs

Constructor Index

 o BezierSpline()
Construct an empty (uncomputed) bezier spline.
 o BezierSpline(Vector)
Construct a bezier spline for the given vector of control points.
 o BezierSpline(Vector, int)
Construct a bezier spline for the given vector of control points.
 o BezierSpline(Vector, int, int)
Construct a bezier spline for the given vector of control points.

Method Index

 o firstPoint()
Get the first spline point.
 o getBezierPrecision()
Gets the current bezier precision.
 o getDegree()
Get the degree of this spline.
 o getPointAt(int)
Get the spline point at the given offset.
 o getPrecision()
Get the precision of this spline.
 o lastPoint()
Get the last spline point.
 o setBezierPrecision(int)
Sets the bezier precision to the specified value.
 o setSpline(Vector)
Compute the bezier spline for the given vector of control points.
 o setSpline(Vector, int, int)
Construct a bezier spline for the given vector of control points.

Constructors

 o BezierSpline
 public BezierSpline()
Construct an empty (uncomputed) bezier spline.

 o BezierSpline
 public BezierSpline(Vector linePoints)
Construct a bezier spline for the given vector of control points.

Parameters:
a - vector of Point objects that specifies the control points for bezier spline.
 o BezierSpline
 public BezierSpline(Vector linePoints,
                     int start)
Construct a bezier spline for the given vector of control points.

Parameters:
a - vector of Point objects that specifies the control points for bezier spline.
start - start with points beginning at this offset
 o BezierSpline
 public BezierSpline(Vector linePoints,
                     int start,
                     int count)
Construct a bezier spline for the given vector of control points.

Parameters:
a - vector of Point objects that specifies the control points for bezier spline.
start - start with points beginning at this offset
count - the number of points in the vector to use

Methods

 o setBezierPrecision
 public static int setBezierPrecision(int prec)
Sets the bezier precision to the specified value. The precision determines how many spline points, in addition to the control points, are to be computed are to be computed for each control point. The default is 15.

Parameters:
prec - the new precision value
Returns:
the previous precision value
 o getBezierPrecision
 public static int getBezierPrecision()
Gets the current bezier precision.

Returns:
the current precision value
 o setSpline
 public BezierSpline setSpline(Vector linePoints)
Compute the bezier spline for the given vector of control points.

Parameters:
a - vector of Point objects that specifies the control points for bezier spline.
 o setSpline
 public BezierSpline setSpline(Vector linePoints,
                               int start,
                               int count)
Construct a bezier spline for the given vector of control points.

Parameters:
a - vector of Point objects that specifies the control points for bezier spline.
start - start with points beginning at this offset
count - the number of points in the vector to use
 o getPointAt
 public Point getPointAt(int idx)
Get the spline point at the given offset.

Parameters:
idx - the index of the spline point to return (0 is the first point)
Returns:
the spline point at the specified index
Overrides:
getPointAt in class LineVector
 o firstPoint
 public Point firstPoint()
Get the first spline point.

Returns:
the first spline point
Overrides:
firstPoint in class LineVector
 o lastPoint
 public Point lastPoint()
Get the last spline point.

Returns:
the last spline point
Overrides:
lastPoint in class LineVector
 o getDegree
 public int getDegree()
Get the degree of this spline.

Returns:
the degree of the spline
 o getPrecision
 public int getPrecision()
Get the precision of this spline.

Returns:
the precision of the spline

All Packages  Class Hierarchy  This Package  Previous  Next  Index