home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-11-19 | 1.0 KB | 34 lines |
- // An AnimationMaster Spline curve
-
- // Written by Bernie Roehl, November 1996
-
- package hash;
-
- import java.io.*;
-
- public class Spline {
- protected int npoints;
- protected ControlPoint[] points;
-
- public int getNumberOfControlPoints() { return npoints; }
- public ControlPoint getControlPoint(int n) { return points[n]; }
-
- public void dump() {
- System.out.println("Spline: " + npoints + " points");
- for (int i = 0; i < npoints; ++i) {
- System.out.println(" Point " + i + ":");
- points[i].dump();
- System.out.println();
- }
- }
-
- public Spline(DataInputStream input)
- throws IOException, HashSyntaxException {
- npoints = Integer.parseInt(input.readLine());
- points = new ControlPoint[npoints];
- for (int i = 0; i < npoints; ++i)
- points[i] = new ControlPoint(input);
- }
- }
-
-