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

Function main

LASlib/example/lasexample_write_only_with_extra_bytes.cpp:73–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

set_attributeMethod · 0.80
usageFunction · 0.70
taketimeFunction · 0.70
byebyeFunction · 0.70
set_file_nameMethod · 0.45
parseMethod · 0.45
activeMethod · 0.45
set_offsetMethod · 0.45
add_attributeMethod · 0.45
initMethod · 0.45
openMethod · 0.45
get_file_nameMethod · 0.45

Tested by

no test coverage detected