本文整理汇总了C++中LASreadOpener::get_file_name方法的典型用法代码示例。如果您正苦于以下问题:C++ LASreadOpener::get_file_name方法的具体用法?C++ LASreadOpener::get_file_name怎么用?C++ LASreadOpener::get_file_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LASreadOpener
的用法示例。
在下文中一共展示了LASreadOpener::get_file_name方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
int i;
bool verbose = false;
double start_time = 0.0;
LASreadOpener lasreadopener;
LASwriteOpener laswriteopener;
if (argc == 1)
{
fprintf(stderr,"%s is better run in the command line\n", argv[0]);
char file_name[256];
fprintf(stderr,"enter input file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.set_file_name(file_name);
fprintf(stderr,"enter output file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
laswriteopener.set_file_name(file_name);
}
else
{
lasreadopener.parse(argc, argv);
laswriteopener.parse(argc, argv);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
}
else if (i == argc - 2 && !lasreadopener.active() && !laswriteopener.active())
{
lasreadopener.set_file_name(argv[i]);
}
else if (i == argc - 1 && !lasreadopener.active() && !laswriteopener.active())
{
lasreadopener.set_file_name(argv[i]);
}
else if (i == argc - 1 && lasreadopener.active() && !laswriteopener.active())
{
laswriteopener.set_file_name(argv[i]);
}
else
{
fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
usage();
}
}
if (verbose) start_time = taketime();
// check input & output
if (!lasreadopener.active())
{
fprintf(stderr,"ERROR: no input specified\n");
usage(argc == 1);
}
if (!laswriteopener.active())
{
fprintf(stderr,"ERROR: no output specified\n");
usage(argc == 1);
}
// open lasreader
LASreader* lasreader = lasreadopener.open();
if (lasreader == 0)
{
fprintf(stderr, "ERROR: could not open lasreader\n");
byebye(argc==1);
}
// open laswriter
LASwriter* laswriter = laswriteopener.open(&lasreader->header);
if (laswriter == 0)
{
fprintf(stderr, "ERROR: could not open laswriter\n");
byebye(argc==1);
}
#ifdef _WIN32
if (verbose) fprintf(stderr, "reading %I64d points from '%s' and writing them modified to '%s'.\n", lasreader->npoints, lasreadopener.get_file_name(), laswriteopener.get_file_name());
#else
if (verbose) fprintf(stderr, "reading %lld points from '%s' and writing them modified to '%s'.\n", lasreader->npoints, lasreadopener.get_file_name(), laswriteopener.get_file_name());
#endif
// loop over points and modify them
//.........这里部分代码省略.........
示例2: main
//.........这里部分代码省略.........
minimum_points = atoi(argv[i]);
}
else if (strcmp(argv[i],"-threshold") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: value\n", argv[i]);
byebye(true);
}
i++;
threshold = atoi(argv[i]);
}
else if (strcmp(argv[i],"-append") == 0)
{
append = TRUE;
}
else
{
fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
byebye(true);
}
}
#ifdef COMPILE_WITH_GUI
if (gui)
{
return lasindex_gui(argc, argv, &lasreadopener);
}
#endif
#ifdef COMPILE_WITH_MULTI_CORE
if (cores > 1)
{
if (lasreadopener.get_file_name_number() < 2)
{
fprintf(stderr,"WARNING: only %u input files. ignoring '-cores %d' ...\n", lasreadopener.get_file_name_number(), cores);
}
else if (lasreadopener.is_merged())
{
fprintf(stderr,"WARNING: input files merged on-the-fly. ignoring '-cores %d' ...\n", cores);
}
else
{
return lasindex_multi_core(argc, argv, &lasreadopener, cores);
}
}
#endif
// check input
if (!lasreadopener.active())
{
fprintf(stderr,"ERROR: no input specified\n");
byebye(true, argc==1);
}
/*
// lasquadtree test
LASquadtree quadtree;
quadtree.setup(0, 99, 0, 99, 10);
quadtree.intersect_rectangle(10, 10, 20, 20);
quadtree.get_intersected_cells();
while (quadtree.has_intersected_cells())
{
F32 min[2],max[2];
示例3: main
//.........这里部分代码省略.........
}
else if (strcmp(argv[i],"-gps") == 0)
{
report_gps = true;
}
else if (strcmp(argv[i],"-rgb") == 0)
{
report_rgb = true;
}
else if (strcmp(argv[i],"-number") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: max\n", argv[i]);
byebye(true);
}
i++;
array_max = atoi(argv[i]);
}
else if (strcmp(argv[i],"-lines") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: number\n", argv[i]);
byebye(true);
}
i++;
report_lines = atoi(argv[i]);
}
else if (strcmp(argv[i],"-all") == 0)
{
array_max = U32_MAX;
}
else if ((argv[i][0] != '-') && (lasreadopener.get_file_name_number() == 0))
{
lasreadopener.add_file_name(argv[i]);
argv[i][0] = '\0';
}
else
{
fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
byebye(true);
}
}
#ifdef COMPILE_WITH_GUI
if (gui)
{
return lasprecision_gui(argc, argv, &lasreadopener);
}
#endif
#ifdef COMPILE_WITH_MULTI_CORE
if ((cores > 1) && (lasreadopener.get_file_name_number() > 1) && (!lasreadopener.is_merged()))
{
return lasprecision_multi_core(argc, argv, &geoprojectionconverter, &lasreadopener, &laswriteopener, cores);
}
#endif
// check input
if (!lasreadopener.active())
{
fprintf(stderr, "ERROR: no input specified\n");
byebye(true, argc==1);
}
示例4: main
int main(int argc, char *argv[])
{
int i;
#ifdef COMPILE_WITH_GUI
bool gui = false;
#endif
bool verbose = false;
bool keep_lastiling = false;
U32 chopchop = 0;
bool projection_was_set = false;
double start_time = 0;
LASreadOpener lasreadopener;
GeoProjectionConverter geoprojectionconverter;
LASwriteOpener laswriteopener;
if (argc == 1)
{
#ifdef COMPILE_WITH_GUI
return lasmerge_gui(argc, argv, 0);
#else
fprintf(stderr,"%s is better run in the command line\n", argv[0]);
char file_name[256];
fprintf(stderr,"enter input file 1: ");
fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.add_file_name(file_name);
fprintf(stderr,"enter input file 2: ");
fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.add_file_name(file_name);
fprintf(stderr,"enter output file: ");
fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
laswriteopener.set_file_name(file_name);
#endif
}
else
{
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '–') argv[i][0] = '-';
}
if (!geoprojectionconverter.parse(argc, argv)) byebye(true);
if (!lasreadopener.parse(argc, argv)) byebye(true);
if (!laswriteopener.parse(argc, argv)) byebye(true);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
}
else if (strcmp(argv[i],"-version") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
byebye();
}
else if (strcmp(argv[i],"-gui") == 0)
{
#ifdef COMPILE_WITH_GUI
gui = true;
#else
fprintf(stderr, "WARNING: not compiled with GUI support. ignoring '-gui' ...\n");
#endif
}
else if (strcmp(argv[i],"-split") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: size\n", argv[i]);
byebye(true);
}
i++;
chopchop = atoi(argv[i]);
}
else if (strcmp(argv[i],"-keep_lastiling") == 0)
{
keep_lastiling = true;
}
else if ((argv[i][0] != '-') && (lasreadopener.get_file_name_number() == 0))
{
lasreadopener.add_file_name(argv[i]);
argv[i][0] = '\0';
}
else
{
fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
byebye(true);
}
//.........这里部分代码省略.........
示例5: main
int main(int argc, char *argv[])
{
int i,j;
#ifdef COMPILE_WITH_GUI
bool gui = false;
#endif
bool verbose = false;
int shutup = 5;
int random_seeks = 0;
double start_time = 0.0;
LASreadOpener lasreadopener;
LASwriteOpener laswriteopener;
if (argc == 1)
{
#ifdef COMPILE_WITH_GUI
return lasdiff_gui(argc, argv, 0);
#else
char file_name[256];
fprintf(stderr,"lasdiff.exe is better run in the command line\n");
fprintf(stderr,"enter input file1: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.set_file_name(file_name);
fprintf(stderr,"enter input file2: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.set_file_name(file_name);
#endif
}
else
{
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '–') argv[i][0] = '-';
}
if (!lasreadopener.parse(argc, argv)) byebye(true);
if (!laswriteopener.parse(argc, argv)) byebye(true);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
}
else if (strcmp(argv[i],"-version") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
byebye();
}
else if (strcmp(argv[i],"-gui") == 0)
{
#ifdef COMPILE_WITH_GUI
gui = true;
#else
fprintf(stderr, "WARNING: not compiled with GUI support. ignoring '-gui' ...\n");
#endif
}
else if (strcmp(argv[i],"-random_seeks") == 0)
{
random_seeks = 10;
}
else if (strcmp(argv[i],"-shutup") == 0)
{
i++;
shutup = atoi(argv[i]);;
}
else if ((argv[i][0] != '-') && (lasreadopener.get_file_name_number() == 0))
{
lasreadopener.add_file_name(argv[i]);
argv[i][0] = '\0';
}
else
{
fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
byebye(true);
}
}
#ifdef COMPILE_WITH_GUI
if (gui)
{
return lasdiff_gui(argc, argv, &lasreadopener);
}
#endif
if (!lasreadopener.active())
{
fprintf (stderr, "ERROR: no input specified\n");
byebye(true, argc==1);
}
//.........这里部分代码省略.........
示例6: main
//.........这里部分代码省略.........
{
header_comment_sign = ',';
}
else if (strcmp(argv[i],"colon") == 0)
{
header_comment_sign = ':';
}
else if (strcmp(argv[i],"scolon") == 0 || strcmp(argv[i],"semicolon") == 0)
{
header_comment_sign = ';';
}
else if (strcmp(argv[i],"pound") == 0 || strcmp(argv[i],"hash") == 0)
{
header_comment_sign = '#';
}
else if (strcmp(argv[i],"percent") == 0)
{
header_comment_sign = '%';
}
else if (strcmp(argv[i],"dollar") == 0)
{
header_comment_sign = '$';
}
else if (strcmp(argv[i],"star") == 0)
{
header_comment_sign = '*';
}
else
{
fprintf(stderr, "ERROR: unknown header comment symbol '%s'\n",argv[i]);
usage(true);
}
}
else if ((argv[i][0] != '-') && (lasreadopener.get_file_name_number() == 0))
{
lasreadopener.add_file_name(argv[i]);
argv[i][0] = '\0';
}
else
{
fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
usage(true);
}
}
#ifdef COMPILE_WITH_GUI
if (gui)
{
return las2txt_gui(argc, argv, &lasreadopener);
}
#endif
#ifdef COMPILE_WITH_MULTI_CORE
if ((cores > 1) && (lasreadopener.get_file_name_number() > 1) && (!lasreadopener.is_merged()))
{
return las2txt_multi_core(argc, argv, &lasreadopener, &laswriteopener, cores);
}
#endif
// check input
if (!lasreadopener.active())
{
fprintf(stderr,"ERROR: no input specified\n");
byebye(true, argc == 1);
}
示例7: main
//.........这里部分代码省略.........
usage(true);
}
i++;
set_system_identifier = argv[i];
}
else if (strcmp(argv[i],"-set_generating_software") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: name\n", argv[i]);
usage(true);
}
i++;
set_generating_software = argv[i];
}
else if (strcmp(argv[i],"-set_ogc_wkt") == 0)
{
set_ogc_wkt = true;
}
else if (strcmp(argv[i],"-set_version") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: major.minor\n", argv[i]);
usage(true);
}
i++;
if (sscanf(argv[i],"%d.%d",&set_version_major,&set_version_minor) != 2)
{
fprintf(stderr, "ERROR: cannot understand argument '%s' of '%s'\n", argv[i], argv[i-1]);
usage(true);
}
}
else if ((argv[i][0] != '-') && (lasreadopener.get_file_name_number() == 0))
{
lasreadopener.add_file_name(argv[i]);
argv[i][0] = '\0';
}
else
{
fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
usage(true);
}
}
#ifdef COMPILE_WITH_GUI
if (gui)
{
return txt2las_gui(argc, argv, &lasreadopener);
}
#endif
#ifdef COMPILE_WITH_MULTI_CORE
if (cores > 1)
{
if (lasreadopener.get_file_name_number() < 2)
{
fprintf(stderr,"WARNING: only %u input files. ignoring '-cores %d' ...\n", lasreadopener.get_file_name_number(), cores);
}
else if (lasreadopener.is_merged())
{
fprintf(stderr,"WARNING: input files merged on-the-fly. ignoring '-cores %d' ...\n", cores);
}
else
{
return txt2las_multi_core(argc, argv, &geoprojectionconverter, &lasreadopener, &laswriteopener, cores);
示例8: main
int main(int argc, char *argv[])
{
MPI_Init(&argc, &argv);
int i;
#ifdef COMPILE_WITH_GUI
bool gui = false;
#endif
bool verbose = false;
bool keep_lastiling = false;
U32 chopchop = 0;
bool projection_was_set = false;
double start_time = 0;
LASreadOpener lasreadopener;
GeoProjectionConverter geoprojectionconverter;
LASwriteOpener laswriteopener;
if (argc == 1)
{
#ifdef COMPILE_WITH_GUI
return lasmerge_gui(argc, argv, 0);
#else
fprintf(stderr,"%s is better run in the command line\n", argv[0]);
char file_name[256];
fprintf(stderr,"enter input file 1: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.add_file_name(file_name);
fprintf(stderr,"enter input file 2: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
lasreadopener.add_file_name(file_name);
fprintf(stderr,"enter output file: "); fgets(file_name, 256, stdin);
file_name[strlen(file_name)-1] = '\0';
laswriteopener.set_file_name(file_name);
#endif
}
else
{
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '�') argv[i][0] = '-';
}
if (!geoprojectionconverter.parse(argc, argv)) byebye(true);
if (!lasreadopener.parse(argc, argv)) byebye(true);
if (lasreadopener.get_file_name_number()<2)
{
fprintf(stderr,"Must specify more than one input file.\n");
byebye(true); // only support merging more than one file
}
if (!laswriteopener.parse(argc, argv)) byebye(true);
}
for (i = 1; i < argc; i++)
{
if (argv[i][0] == '\0')
{
continue;
}
else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
usage();
}
else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
{
verbose = true;
}
else if (strcmp(argv[i],"-version") == 0)
{
fprintf(stderr, "LAStools (by [email protected]) version %d\n", LAS_TOOLS_VERSION);
byebye();
}
else if (strcmp(argv[i],"-gui") == 0)
{
#ifdef COMPILE_WITH_GUI
gui = true;
#else
fprintf(stderr, "WARNING: not compiled with GUI support. ignoring '-gui' ...\n");
#endif
}
else if (strcmp(argv[i],"-split") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: size\n", argv[i]);
byebye(true);
}
i++;
chopchop = atoi(argv[i]);
}
else if (strcmp(argv[i],"-keep_lastiling") == 0)
{
keep_lastiling = true;
}
else if ((argv[i][0] != '-') && (lasreadopener.get_file_name_number() == 0))
{
lasreadopener.add_file_name(argv[i]);
argv[i][0] = '\0';
}
//.........这里部分代码省略.........
示例9: main
//.........这里部分代码省略.........
else if (strcmp(argv[i],"-minimum") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: number\n", argv[i]);
usage(true);
}
i++;
minimum_points = atoi(argv[i]);
}
else if (strcmp(argv[i],"-threshold") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: value\n", argv[i]);
usage(true);
}
i++;
threshold = atoi(argv[i]);
}
else if (strcmp(argv[i],"-size") == 0)
{
report_file_size = true;
}
else if (strcmp(argv[i],"-waveform") == 0 || strcmp(argv[i],"-waveforms") == 0)
{
waveform = true;
}
else if (strcmp(argv[i],"-waveform_with_map") == 0 || strcmp(argv[i],"-waveforms_with_map") == 0)
{
waveform = true;
waveform_with_map = true;
}
else if ((argv[i][0] != '-') && (lasreadopener.get_file_name_number() == 0))
{
lasreadopener.add_file_name(argv[i]);
argv[i][0] = '\0';
}
else
{
fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
usage(true);
}
}
#ifdef COMPILE_WITH_GUI
if (gui)
{
return laszip_gui(argc, argv, &lasreadopener);
}
#endif
#ifdef COMPILE_WITH_MULTI_CORE
if ((cores > 1) && (lasreadopener.get_file_name_number() > 1) && (!lasreadopener.get_merged()))
{
return laszip_multi_core(argc, argv, &geoprojectionconverter, &lasreadopener, &laswriteopener, cores);
}
#endif
// check input
if (!lasreadopener.active())
{
fprintf(stderr,"ERROR: no input specified\n");
usage(true, argc==1);
}
示例10: main
//.........这里部分代码省略.........
{
remove_tiling_vlr = true;
i++;
}
else if (strcmp(argv[i],"-remove_original_vlr") == 0)
{
remove_original_vlr = true;
i++;
}
else if (strcmp(argv[i],"-set_point_type") == 0 || strcmp(argv[i],"-set_point_data_format") == 0 || strcmp(argv[i],"-point_type") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: type\n", argv[i]);
byebye(true);
}
set_point_data_format = atoi(argv[i+1]);
i++;
}
else if (strcmp(argv[i],"-set_point_data_record_length") == 0 || strcmp(argv[i],"-set_point_size") == 0 || strcmp(argv[i],"-point_size") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: size\n", argv[i]);
byebye(true);
}
set_point_data_record_length = atoi(argv[i+1]);
i++;
}
else if (strcmp(argv[i],"-clip_to_bounding_box") == 0 || strcmp(argv[i],"-clip_to_bb") == 0)
{
clip_to_bounding_box = true;
}
else if ((argv[i][0] != '-') && (lasreadopener.get_file_name_number() == 0))
{
lasreadopener.add_file_name(argv[i]);
argv[i][0] = '\0';
}
else
{
fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
usage(true);
}
}
// check input
if (!lasreadopener.active())
{
fprintf(stderr,"ERROR: no input specified\n");
usage(true, argc==1);
}
BOOL extra_pass = laswriteopener.is_piped();
// for piped output we need an extra pass
if (extra_pass)
{
if (lasreadopener.is_piped())
{
fprintf(stderr, "ERROR: input and output cannot both be piped\n");
usage(true);
}
示例11: main
//.........这里部分代码省略.........
{
remove_tiling_vlr = true;
i++;
}
else if (strcmp(argv[i],"-remove_original_vlr") == 0)
{
remove_original_vlr = true;
i++;
}
else if (strcmp(argv[i],"-point_type") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: type\n", argv[i]);
byebye(true);
}
set_point_data_format = atoi(argv[i+1]);
i++;
}
else if (strcmp(argv[i],"-point_size") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: size\n", argv[i]);
byebye(true);
}
set_point_data_record_length = atoi(argv[i+1]);
i++;
}
else if (strcmp(argv[i],"-clip_to_bounding_box") == 0 || strcmp(argv[i],"-clip_to_bbox") == 0)
{
clip_to_bounding_box = true;
}
else if ((argv[i][0] != '-') && (lasreadopener.get_file_name_number() == 0))
{
lasreadopener.add_file_name(argv[i]);
argv[i][0] = '\0';
}
else
{
fprintf(stderr, "ERROR: cannot understand argument '%s'\n", argv[i]);
usage(true);
}
}
#ifdef COMPILE_WITH_GUI
if (gui)
{
return las2las_gui(argc, argv, &lasreadopener);
}
#endif
#ifdef COMPILE_WITH_MULTI_CORE
if ((cores > 1) && (lasreadopener.get_file_name_number() > 1) && (!lasreadopener.get_merged()))
{
return las2las_multi_core(argc, argv, &geoprojectionconverter, &lasreadopener, &laswriteopener, cores);
}
#endif
// check input
if (!lasreadopener.active())
{
fprintf(stderr,"ERROR: no input specified\n");
usage(true, argc==1);
}
示例12: main
//.........这里部分代码省略.........
// get a pointer to the header
LASheader* lasheader = &lasreader->header;
// maybe we are doing one report per file
if (one_report_per_file)
{
int len = strlen(lasreadopener.get_path());
CHAR* current_xml_output_file = (CHAR*)malloc(len + 5);
strcpy(current_xml_output_file, lasreadopener.get_path());
current_xml_output_file[len-4] = '_';
current_xml_output_file[len-3] = 'L';
current_xml_output_file[len-2] = 'V';
current_xml_output_file[len-1] = 'S';
current_xml_output_file[len ] = '.';
current_xml_output_file[len+1] = 'x';
current_xml_output_file[len+2] = 'm';
current_xml_output_file[len+3] = 'l';
current_xml_output_file[len+4] = '\0';
if (!xmlwriter.open(current_xml_output_file, "LASvalidator"))
{
byebye(LAS_VALIDATE_WRITE_PERMISSION_ERROR, argc == 1);
}
free(current_xml_output_file);
}
// start a new report
xmlwriter.begin("report");
// report description of file
xmlwriter.beginsub("file");
xmlwriter.write("name", lasreadopener.get_file_name());
xmlwriter.write("path", lasreadopener.get_path());
CHAR temp[32];
sprintf(temp, "%d.%d", lasheader->version_major, lasheader->version_minor);
xmlwriter.write("version", temp);
strncpy(temp, lasheader->system_identifier, 32);
temp[31] = '\0';
xmlwriter.write("system_identifier", temp);
strncpy(temp, lasheader->generating_software, 32);
temp[31] = '\0';
xmlwriter.write("generating_software", temp);
xmlwriter.write("point_data_format", lasheader->point_data_format);
CHAR crsdescription[512];
strcpy(crsdescription, "not valid or not specified");
if (lasheader->fails == 0)
{
// header was loaded. now parse and check.
LAScheck lascheck(lasheader);
while (lasreader->read_point())
{
lascheck.parse(&lasreader->point);
}
// check header and points and get CRS description
lascheck.check(lasheader, crsdescription);
}
xmlwriter.write("CRS", crsdescription);