%
%	This driver takes data values in from a file called spline.data
%
%	spline.data contains a large set of data values to plot
%
%	This routine will give you a good idea of the relative speeds of
%	the rendering techniques.
%
import var Spline in "Spline.t"

var fs: int
var fn: string := "spline.data"
var p: Spline.point

put "Interpolation Demonstration: Reading data from file spline.data."
put "Just sit back and watch a work of art unfold before your eyes."
setscreen("nocursor")

open : fs, fn, get

assert fs not=0 


Spline.SetUpSpline(Spline.CubicCatmullRom, 16, 0)
Spline.SetEvaluation(Spline.DirectTM)

% Here are some other sample options

% Spline.SetUpSpline(Spline.CubicBSpline, 16, 0)
% Spline.SetEvaluation(Spline.Horner)

% Spline.SetUpSpline(Spline.CubicLagrange, 16, 0)
% Spline.SetEvaluation(Spline.DirectMP)

loop
	get: fs, p.x, p.y
	exit when p.x < 0
	Spline.AddControlPoint(p)
end loop


