-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gesture.cpp
104 lines (76 loc) · 1.4 KB
/
Gesture.cpp
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include "Gesture.h"
Gesture::Gesture(int cutoff, int width, int height)
{
// Setup the first point.
Point* firstPoint = new Point;
firstPoint->x = 0;
firstPoint->y = 0;
m_points.push_back(firstPoint); // save first point into container.
// Initialize attributes of the gesture shape.
m_cutoff = cutoff;
m_width = width;
m_height = height;
m_percent = 0;
m_enabled = true;
}
Gesture::~Gesture()
{
// Remove all points.
//for (std::vector<Point>::iterator i = m_points.
}
void Gesture::Recreate(int cutoff, int width, int height)
{
// Remove all the current points.
for (std::vector<Point*>::iterator i = m_points.begin(); i != m_points.end();)
{
delete (*i);
m_points.erase(i++);
}
Gesture(cutoff, width, height);
}
// ACCESSORS
int Gesture::GetWidth()
{
return m_width;
}
int Gesture::GetHeight()
{
return m_height;
}
int Gesture::GetCutoff()
{
return m_cutoff;
}
Gesture::Point* Gesture::GetPoint(int pointNumber)
{
return m_points[pointNumber];
}
Gesture::Point* Gesture::GetPoint()
{
return m_points.back();
}
std::vector<Gesture::Point*>& Gesture::GetPoints()
{
return m_points;
}
int Gesture::GetEnabled()
{
return m_enabled;
}
// MUTATORS
void Gesture::SetWidth(int value)
{
m_width = value;
}
void Gesture::SetHeight(int value)
{
m_height = value;
}
void Gesture::SetCutoff(int value)
{
m_cutoff = value;
}
void Gesture::SetEnabled(int enable)
{
m_enabled = enable;
}