-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
49 lines (39 loc) · 1.06 KB
/
main.cpp
File metadata and controls
49 lines (39 loc) · 1.06 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
#include "menu.h"
#include "global.h"
#include "pointSet.h"
#include "grahamScan.h"
#include "misc.h"
std::vector <Point> p;
std::vector <Point> grahamScanPointSet;
std::time_t timerStart, timerEnd;
int main()
{
std::string option = "";
while ( (option.compare("x")!=0) && (option.compare("X")!=0) )
{
option = menu();
if (option.compare("0")==0)
{
pointSetMenu();
}
else if (option.compare("1")==0)
{
grahamScanPointSet = p;
timerStart = time(NULL);
std::sort(grahamScanPointSet.begin(), grahamScanPointSet.end(), compareXOfPoints);
std::vector<Point> temp = grahamScanConvexHull();
timerEnd = time(NULL);
double seconds = std::difftime(timerEnd, timerStart);
std::cout << "Time: " << seconds;
}
else if (option.compare("2")==0)
{
//TODO Gift Wrapping
}
else if (option.compare("3")==0)
{
//TODO Divide and Conquer
}
}
return 0;
}