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

Function main

LASlib/example/lasexample_write_only.cpp:71–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 12

usageFunction · 0.70
taketimeFunction · 0.70
byebyeFunction · 0.70
set_file_nameMethod · 0.45
parseMethod · 0.45
activeMethod · 0.45
initMethod · 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