-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
executable file
·68 lines (58 loc) · 1.71 KB
/
main.cpp
File metadata and controls
executable file
·68 lines (58 loc) · 1.71 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
////////////////////////////////////
///// main.cpp (opbr_main.cpp) /////
////////////////////////////////////
#include "spbr.h"
#include "version.h"
#include "display_opbr_usage.h"
#include "mainfn_utility.h"
// Prototype declaration
int mainsub_opbr_spbrbin( int argc, char** argv );
int mainsub_opbr_plybin(int argc, char** argv);//2018/8
int mainsub_opbr_plyascii ( int argc, char** argv );
int mainsub_opbr_spbrascii ( int argc, char** argv );
// MACRO
//#define DEBUG_PLY
//-----
int main(int argc, char** argv) {
// Opening Message and Usage
displayOPBR_OpeningMessage();
displayOPBR_Usage();
// Help
if (argc >= 2 && !strcmp(argv[1], "-h")) {
displayOPBRCommands(std::cout);
displayOPBRDataFormat(std::cout);
exit(1);
}
else if (argc < 2) {
exit(1);
}
// Check validitiy of input files
if (!checkInputFiles(argc, argv)) {
exit(1);
}
//Call a proper main routine for the input file of arg[1]:
// binary SPBR, binary PLY, ASCII PLY, or ASCII SPBR
if (isBinarySPBR_File(argv[1])) {
// binary SPBR file
// std::cout << "** Binary SPBR file: " << argv[1] << std::endl;
mainsub_opbr_spbrbin (argc, argv);
}
else if (isBINARY_PLY_File(argv[1])){
// binary PLY file
// std::cout << "** Binary PLY file: " << argv[1] << std::endl;
mainsub_opbr_plybin(argc, argv);
}
else if (isASCII_PLY_File(argv[1])) {//TANAKA 2017/11/05
// ASCII PLY file
// std::cout << "** ASCII PLY file: " << argv[1] << std::endl;
mainsub_opbr_plyascii(argc, argv);
}
else {
// ASCII SPBR file
// std::cout << "** ASCII SPBR file: " << argv[1] <<std::endl;
mainsub_opbr_spbrascii( argc, argv );
}
//EndFn
return 0;
}
// main() for OPBR