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

Method parse

LASlib/src/lastransform.cpp:7077–11212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7075}
7076
7077BOOL LAStransform::parse(int argc, char* argv[])
7078{
7079 int i;
7080
7081 // check if multiple time shifts are used
7082 bool gps_modifier_used = false;
7083 std::string gps_modifier = "";
7084
7085 for (i = 1; i < argc; i++)
7086 {
7087 if (argv[i][0] == '\0')
7088 {
7089 continue;
7090 }
7091 else if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "-help") == 0)
7092 {
7093 return TRUE;
7094 }
7095 else if (strcmp(argv[i], "-hh") == 0)
7096 {
7097 usage();
7098 return TRUE;
7099 }
7100 else if (strcmp(argv[i], "-force_RGB") == 0)
7101 {
7102 add_operation(new LASoperationForceRGB());
7103 *argv[i] = '\0';
7104 }
7105 else if (strncmp(argv[i], "-translate_", 11) == 0)
7106 {
7107 if (strcmp(argv[i], "-translate_x") == 0)
7108 {
7109 if ((i + 1) >= argc)
7110 {
7111 laserror("'%s' needs 1 argument: offset", argv[i]);
7112 return FALSE;
7113 }
7114 F64 offset;
7115 if (sscanf(argv[i + 1], "%lf", &offset) != 1)
7116 {
7117 laserror("'%s' needs 1 argument: offset but '%s' is no valid number", argv[i], argv[i + 1]);
7118 return FALSE;
7119 }
7120 transformed_fields |= LASTRANSFORM_X_COORDINATE;
7121 add_operation(new LASoperationTranslateX(offset));
7122 *argv[i] = '\0';
7123 *argv[i + 1] = '\0';
7124 i += 1;
7125 }
7126 else if (strcmp(argv[i], "-translate_y") == 0)
7127 {
7128 if ((i + 1) >= argc)
7129 {
7130 laserror("'%s' needs 1 argument: offset", argv[i]);
7131 return FALSE;
7132 }
7133 F64 offset;
7134 if (sscanf(argv[i + 1], "%lf", &offset) != 1)

Callers

nothing calls this directly

Calls 5

laserrorFunction · 0.85
LASfopenFunction · 0.85
sscanf_lasFunction · 0.85
parseFunction · 0.85
usageFunction · 0.50

Tested by

no test coverage detected