Al's Programming Resource Homepage  Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

bspline.h

Go to the documentation of this file.
00001 // Spline Class    by Alan Baylis 2001
00002 
00003 #ifndef SplineH
00004 #define SplineH
00005 
00006 #include "vector.h"
00007 
00008 class SPLINE
00009 {
00010 public:
00011       SPLINE(){};
00012       ~SPLINE(){};
00013 
00014     int Compare(const SPLINE& Spline);
00015     int GetMyPosition() const {return linkPosition;}
00016     void SetMyPosition(int newPosition) {linkPosition = newPosition;}
00017     int linkPosition;
00018     int Degree;                   // the degree of the polynomial plus 1
00019     int NumControl;               // number of control points minus 1
00020     int NumPoints;                // number of points to output      *not used in bsplinepoint()
00021     VECTOR* Control;              // control point array
00022     VECTOR* Output;               // output array                    *not used in bsplinepoint()
00023     float StartTime;            // start of spline movement        *used in bsplinepoint()
00024     float EndTime;              // end of spline movement          *used in bsplinepoint()
00025     float CopyOfStartTime;      // work variable
00026     float CopyOfEndTime;        // work variable
00027     bool Active;                  // active flag
00028     bool Repeat;                  // flag for looped output          *used in bsplinepoint()
00029     float Red;                  // color
00030     float Green;
00031     float Blue;
00032 };
00033 
00034 void bspline(SPLINE* spline);
00035 VECTOR bsplinepoint(SPLINE* spline);
00036 float blend(int k, int t, int *u, float v); // calculate the blending value
00037 void compute_intervals(int *u, int n, int t); // figure out the knots
00038 void compute_point(int *u, int n, int t, float v, VECTOR *control, VECTOR *output);
00039 
00040 #endif
00041 

Generated on Fri Dec 23 05:22:05 2005 for Splines by doxygen1.2.15