MCPcopy Create free account
hub / github.com/LAStools/LAStools / main

Function main

LASlib/example/lasexample.cpp:72–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72int main(int argc, char *argv[])
73{
74 int i;
75 bool verbose = false;
76 double start_time = 0.0;
77
78 LASreadOpener lasreadopener;
79 LASwriteOpener laswriteopener;
80
81 if (argc == 1)
82 {
83 fprintf(stderr,"%s is better run in the command line\n", argv[0]);
84 char file_name[256];
85 fprintf(stderr,"enter input file: "); fgets(file_name, 256, stdin);
86 file_name[strlen(file_name)-1] = '\0';
87 lasreadopener.set_file_name(file_name);
88 fprintf(stderr,"enter output file: "); fgets(file_name, 256, stdin);
89 file_name[strlen(file_name)-1] = '\0';
90 laswriteopener.set_file_name(file_name);
91 }
92 else
93 {
94 lasreadopener.parse(argc, argv);
95 laswriteopener.parse(argc, argv);
96 }
97
98 for (i = 1; i < argc; i++)
99 {
100 if (argv[i][0] == '\0')
101 {
102 continue;
103 }
104 else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
105 {
106 usage();
107 }
108 else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
109 {
110 verbose = true;
111 }
112 else if (i == argc - 2 && !lasreadopener.active() && !laswriteopener.active())
113 {
114 lasreadopener.set_file_name(argv[i]);
115 }
116 else if (i == argc - 1 && !lasreadopener.active() && !laswriteopener.active())
117 {
118 lasreadopener.set_file_name(argv[i]);
119 }
120 else if (i == argc - 1 && lasreadopener.active() && !laswriteopener.active())
121 {
122 laswriteopener.set_file_name(argv[i]);
123 }
124 else
125 {
126 fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
127 usage();
128 }
129 }

Callers

nothing calls this directly

Calls 12

get_ZMethod · 0.80
usageFunction · 0.70
taketimeFunction · 0.70
byebyeFunction · 0.70
set_file_nameMethod · 0.45
parseMethod · 0.45
activeMethod · 0.45
openMethod · 0.45
get_file_nameMethod · 0.45
write_pointMethod · 0.45
update_headerMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected