本文整理汇总了C++中LASreadOpener::set_populate_header方法的典型用法代码示例。如果您正苦于以下问题:C++ LASreadOpener::set_populate_header方法的具体用法?C++ LASreadOpener::set_populate_header怎么用?C++ LASreadOpener::set_populate_header使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LASreadOpener
的用法示例。
在下文中一共展示了LASreadOpener::set_populate_header方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mexFunction
//.........这里部分代码省略.........
argv[0] = "LASreader";
for (i = 1; i < argc; i++)
argv[i] = (char *)mxArrayToString(prhs[i+n_arg_no_char-1]);
}
for (i = 1; i < argc; i++) {
if (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'A':
angle = atof(&argv[i][2]);
break;
case 'B':
get_BB_only = TRUE;
break;
case 'C':
classif = atoi(&argv[i][2]);
break;
case 'D':
if (argv[i][2])
srcID = atoi(&argv[i][2]);
else
scanD = TRUE;
break;
case 'I':
intens = atoi(&argv[i][2]);
break;
case 'N':
nRet = atoi(&argv[i][2]);
break;
case 'R':
if (decode_R (argv[i], &west, &east, &south, &north, &z_min, &z_max))
mexErrMsgTxt("Error decoding -R option!");
got_R = TRUE;
break;
case 'S':
scanC = TRUE;
break;
case 'V':
verbose = TRUE;
break;
}
}
}
LASreadOpener lasreadopener;
lasreadopener.set_merged(FALSE);
lasreadopener.set_populate_header(FALSE);
lasreadopener.set_file_name(fname);
LASreader *lasreader = lasreadopener.open();
if (!lasreader) mexErrMsgTxt("LASREADER Error! could not open lasreader!");
LASheader *header = &(lasreader->header);
if (!header) mexErrMsgTxt("LASREADER: Unable to fetch header for file");
if (get_BB_only && (scanC || scanD) )
mexPrintf("LASREADER WARNING: option -B takes precedence over -C or -D\n");
else if (scanC && scanD)
mexPrintf("LASREADER WARNING: option -C takes precedence over -D\n");
if (get_BB_only) {
plhs[0] = mxCreateDoubleMatrix(1, 6, mxREAL);
bbox = mxGetPr(plhs[0]);
bbox[0] = header->min_x; bbox[1] = header->max_x;
bbox[2] = header->min_y; bbox[3] = header->max_y;
bbox[4] = header->min_z; bbox[5] = header->max_z;
return;
}
if (verbose) print_header(header, FALSE);
if (!(scanC || scanD)) {
if ((got_R + nRet + intens + classif + angle + srcID) == 0)
plain_xyz(plhs, lasreader, header->number_of_point_records);
else
conditional_xyz(plhs, lasreader, header, angle, classif,
intens, nRet, srcID, got_R, west, east, south, north, z_min, z_max);
}
else if (scanC) /* Scan file for a list of different classifications */
get_classification_list ( plhs, lasreader);
else if (scanD) /* Scan file for a list of different Source IDs */
get_ID_list ( plhs, lasreader);
if (nlhs == 2) {
plhs[1] = mxCreateDoubleMatrix(1, 6, mxREAL);
bbox = mxGetPr(plhs[1]);
bbox[0] = header->min_x; bbox[1] = header->max_x;
bbox[2] = header->min_y; bbox[3] = header->max_y;
bbox[4] = header->min_z; bbox[5] = header->max_z;
}
// close the reader
lasreader->close();
delete lasreader;
return;
}
示例2: main
//.........这里部分代码省略.........
}
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 lasmerge_gui(argc, argv, &lasreadopener);
}
#endif
// read all the input files merged
lasreadopener.set_merged(TRUE);
// maybe we want to keep the lastiling
if (keep_lastiling)
{
lasreadopener.set_keep_lastiling(TRUE);
}
// we need to precompute the bounding box
lasreadopener.set_populate_header(TRUE);
// check input and output
if (!lasreadopener.active())
{
fprintf(stderr, "ERROR: no input specified\n");
byebye(true, argc==1);
}
if (!laswriteopener.active())
{
fprintf(stderr, "ERROR: no output specified\n");
byebye(true, argc==1);
}
// make sure we do not corrupt the input file
if (lasreadopener.get_file_name() && laswriteopener.get_file_name() && (strcmp(lasreadopener.get_file_name(), laswriteopener.get_file_name()) == 0))
{
fprintf(stderr, "ERROR: input and output file name are identical\n");
usage(true);
}
// check if projection info was set in the command line
int number_of_keys;
GeoProjectionGeoKeys* geo_keys = 0;
int num_geo_double_params;
double* geo_double_params = 0;
if (geoprojectionconverter.has_projection())
{
示例3: main
//.........这里部分代码省略.........
}
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 lasmerge_gui(argc, argv, &lasreadopener);
}
#endif
// read all the input files merged
lasreadopener.set_merged(TRUE);
// maybe we want to keep the lastiling
if (keep_lastiling)
{
lasreadopener.set_keep_lastiling(TRUE);
}
// we need to precompute the bounding box
lasreadopener.set_populate_header(TRUE);
// check input and output
if (!lasreadopener.active())
{
fprintf(stderr, "ERROR: no input specified\n");
byebye(true, argc==1);
}
if (!laswriteopener.active())
{
fprintf(stderr, "ERROR: no output specified\n");
byebye(true, argc==1);
}
// make sure we do not corrupt the input file
if (lasreadopener.get_file_name() && laswriteopener.get_file_name() && (strcmp(lasreadopener.get_file_name(), laswriteopener.get_file_name()) == 0))
{
fprintf(stderr, "ERROR: input and output file name are identical\n");
usage(true);
}
// check if projection info was set in the command line
int number_of_keys;
GeoProjectionGeoKeys* geo_keys = 0;
int num_geo_double_params;
double* geo_double_params = 0;
if (geoprojectionconverter.has_projection())
{