-
Notifications
You must be signed in to change notification settings - Fork 0
/
Beacons.cpp
100 lines (75 loc) · 1.79 KB
/
Beacons.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
#define USE_EXTERNS
#include "Beacons.hpp"
/*Define Shapes and Colors for Known Target Beacons:
Green Triangle
Blue Rectangle
Red Octagon
*/
Beacon::~Beacon() { // I never have to free-up the class, so this is not run...
// nothing here in the deconstructor
}
Beacon::Beacon(string name) { // this is the class declaration that I am actually using...
if (name == "GreenTriangle") {
//TODO: use "calibration mode" to find HSV min
//and HSV max values
setHSVmin(Scalar(0, 0, 0));
setHSVmax(Scalar(0, 255, 0));
setColor(GREEN);
setShape("Triangle");
}
if (name == "BlueRectangle") {
//TODO: use "calibration mode" to find HSV min
//and HSV max values
setHSVmin(Scalar(0, 0, 0));
setHSVmax(Scalar(255, 0, 0));
setColor(BLUE);
setShape("Rectangle");
}
if (name == "RedOctagon") {
//TODO: use "calibration mode" to find HSV min
//and HSV max values
setHSVmin(Scalar(0, 0, 0));
setHSVmax(Scalar(0, 0, 255));
setColor(RED);
setShape("Octagon");
}
if (name == "TestingObjectDetecting_NOT_Recording_Locations") { //do not record any locations of the beacons (this beacon is used for testing)
setShape("TestingObjectDetecting_NOT_Recording_Locations");
}
}
int Beacon::getXPos() {
return Beacon::xPos;
}
int Beacon::getYPos() {
return Beacon::yPos;
}
void Beacon::setXPos(int x) {
Beacon::xPos = x;
}
void Beacon::setYPos(int y) {
Beacon::yPos = y;
}
Scalar Beacon::getHSVmin() {
return Beacon::HSVmin;
}
Scalar Beacon::getHSVmax() {
return Beacon::HSVmax;
}
void Beacon::setHSVmin(Scalar min) {
Beacon::HSVmin = min;
}
void Beacon::setHSVmax(Scalar max) {
Beacon::HSVmax = max;
}
Scalar Beacon::getColor() {
return Color;
}
void Beacon::setColor(Scalar s) {
Color = s;
}
String Beacon::getShape() {
return Shape;
}
void Beacon::setShape(string s) {
Shape = s;
}