#ifndef _TIME_STROKE
#define _TIME_STROKE


#include "ofMain.h"
#include "ofXML.h"


#define MAX_NUM_TIME_STROKE		50


typedef struct{
	float x;
	float y;	
	float t;	// pct 0-1
} timePt;

static void catmullRom(timePt p1, timePt p2, timePt p3, timePt p4, float t, float *x, float *y);

class timeStroke {
	
	public:
		timeStroke();
		void reset();
		void draw(float time, int nDivision);
		void addPt(int whichPt, float x, float y, float t);
		void setDimensions(int w, int h);
		void removePt(int whichPt);
		void setName(char * _name);
		void loadSettings(char * fileName);
		void saveSettings(char * fileName);
		
		ofVec3f	getPointForPct(float pct);
		float 	getStartingAngle();
		ofVec3f getStartingPoint();
		
		
		
		timePt	pts[MAX_NUM_TIME_STROKE];
		int		ref[MAX_NUM_TIME_STROKE];
		
		ofXML XML;
		char name[128];
		
		int nPts;
		
		float startPct;
		float endPct;
		
		int startSide;
		int endSide;
		int width;
		int height;
		
};

#endif	