-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathpointRecorder.h
More file actions
48 lines (33 loc) · 1.02 KB
/
pointRecorder.h
File metadata and controls
48 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef POINT_RECORDER_H
#define POINT_RECORDER_H
#include "ofMain.h"
// ---------------------------
// this is like an old school class, a "struct"
// it doesn't have functions, just data...
// it's C style -
//
// typedef
// http://bytes.com/forum/thread620088.html
// http://en.wikipedia.org/wiki/Typedef
// struct
// http://www.itee.uq.edu.au/~comp2303/Leslie_C_ref/C/SYNTAX/struct.html
// http://en.wikipedia.org/wiki/C%2B%2B_structures_and_classes
typedef struct {
ofPoint pos;
float time; // from the start, what time does this pt occur at
} timePt;
class pointRecorder {
public:
pointRecorder();
void addPoint(ofPoint pt);
void clear();
void draw();
float startTime;
int maxNumPts;
vector <timePt> pts;
float newStartTime; //for playback
float totalDuration; // the total life of the line
bool lineComplete; // for knowing that a line has finished drawing
ofPoint mostRecentPoint; // the most recent point drawn during playback
};
#endif // POINT_RECORDER_H