/* * Header Begins--Do not remove################################################ * * This driver takes data values in from standard input, so it is invoked: * * interp1 < data.file (e.g., spline.data) * * spline.data contains a set of data values to plot * This routine will give you a good idea of the relative speeds of * the rendering techniques. * (c) Eugene Fiume, University of Toronto, 1995. * * You are permitted to use this code for noncommercial, educational * purposes only. This header must not be removed from this file. * * Header Ends--Do not remove################################################## */ #include #include "X.h" #include "Spline.h" main(argc, argv) int argc; char *argv[]; { int done = FALSE; RealPoint2D pt; printf("Interpolation Demonstration: Reading data from std input.\n"); XOpen(700,400, argc, argv); printf("Hit a mouse button to start.\n"); GetEvent(); printf("Just sit back and watch a work of art unfold before your eyes.\n"); SetEvaluation(DirectTM); SetUpSpline(CubicBSpline, 16, 0); /* try CubicCatmullRom too */ do { scanf("%lf %lf", &(pt.x), &(pt.y)); if (pt.x < 0.0) done = TRUE; else AddControlPoint(pt); } while (!done); printf("Hit a mouse button to end.\n"); GetEvent(); }