home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Late Night VRML 2.0 with Java CD-ROM
/
code.zip
/
Ch13
/
hash
/
Spline.java
< prev
next >
Wrap
Text File
|
1996-11-19
|
1KB
|
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);
}
}