-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (35 loc) · 966 Bytes
/
main.cpp
File metadata and controls
37 lines (35 loc) · 966 Bytes
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
#include <iostream>
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cstring>
#include"MeshSimplifier.h"
int main(int argc, char** argv)
{
if (argc < 5)
{
cout << "ERROR" << endl;
cout << "Please input: [input filename] [output filename] [alpha] [adjust]" << endl;
return 0;
}
time_t start, end;
start = clock();
cout << "start " << start << endl;
string in = argv[1];
string out = argv[2];
double alpha = atof(argv[3]);
double adjust = atof(argv[4]);
MeshSimplifier simplifier;
simplifier.readin(in);
time_t readin = clock();
cout << "input time:" << (double)(readin - start) / CLOCKS_PER_SEC << "sec" << endl;
simplifier.run(alpha);
time_t run = clock();
cout << "run time:" << (double)(run - start) / CLOCKS_PER_SEC << "sec" << endl;
simplifier.output(out);
time_t output = clock();
cout << "output time:" << (double)(output - start) / CLOCKS_PER_SEC << "sec" << endl;
system("pause");
return 0;
}