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

Function main

LASlib/example/lasexample_simple_classification.cpp:72–332  ·  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 step = 1.0;
77 double range = 1.0;
78 double start_time = 0;
79
80 LASreadOpener lasreadopener;
81 LASwriteOpener laswriteopener;
82
83 if (argc == 1)
84 {
85 fprintf(stderr,"%s is better run in the command line\n", argv[0]);
86 char file_name[256];
87 fprintf(stderr,"enter input file: "); fgets(file_name, 256, stdin);
88 file_name[strlen(file_name)-1] = '\0';
89 lasreadopener.add_file_name(file_name);
90 fprintf(stderr,"enter output file: "); fgets(file_name, 256, stdin);
91 file_name[strlen(file_name)-1] = '\0';
92 laswriteopener.set_file_name(file_name);
93 }
94 else
95 {
96 for (i = 1; i < argc; i++)
97 {
98 if (argv[i][0] == '�') argv[i][0] = '-';
99 }
100 if (!lasreadopener.parse(argc, argv)) byebye(true);
101 if (!laswriteopener.parse(argc, argv)) byebye(true);
102 }
103
104 for (i = 1; i < argc; i++)
105 {
106 if (argv[i][0] == '\0')
107 {
108 continue;
109 }
110 else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
111 {
112 fprintf(stderr, "LAStools (by info@rapidlasso.de) version %d\n", LAS_TOOLS_VERSION);
113 usage();
114 }
115 else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
116 {
117 verbose = true;
118 }
119 else if (strcmp(argv[i],"-step") == 0)
120 {
121 if ((i+1) >= argc)
122 {
123 fprintf(stderr,"ERROR: '%s' needs 1 argument: cell size\n", argv[i]);
124 byebye(true);
125 }
126 step = atof(argv[i+1]);
127 i+=1;
128 }
129 else if (strcmp(argv[i],"-range") == 0)

Callers

nothing calls this directly

Calls 15

get_file_name_numberMethod · 0.80
get_ZMethod · 0.80
make_file_nameMethod · 0.80
byebyeFunction · 0.70
usageFunction · 0.70
taketimeFunction · 0.70
add_file_nameMethod · 0.45
set_file_nameMethod · 0.45
parseMethod · 0.45
set_populate_headerMethod · 0.45
activeMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected