本文整理汇总了C++中LASreadOpener::set_scale_factor方法的典型用法代码示例。如果您正苦于以下问题:C++ LASreadOpener::set_scale_factor方法的具体用法?C++ LASreadOpener::set_scale_factor怎么用?C++ LASreadOpener::set_scale_factor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LASreadOpener
的用法示例。
在下文中一共展示了LASreadOpener::set_scale_factor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
/*
==================================
LoadWorker::run()
Starts the worker.
==================================
*/
void LoadWorker::run()
{
int num_files = filenames.size();
// Has a new quadtree been created?
bool newQuadtree = false;
try
{
// For each file
for (int i = 0; i < num_files; ++i)
{
std::string filename = filenames[i];
send_message(filename);
if (filename != "")
{
filetype_t file_type = test_filename(filename);
if (file_type == UNKNOWN_FILE)
{
send_message(
"Unrecognised file type. Supported formats: las, txt, csv.");
sig_fail();
return;
}
LASreadOpener lasreadopener;
lasreadopener.set_file_name(filename.c_str());
// ASCII files
if (file_type == ASCII_FILE)
{
lasreadopener.set_parse_string(ascii_code.c_str());
if (!use_default_scale_factors)
{
lasreadopener.set_scale_factor(scale_factor);
}
}
// Point filter
if (point_filter.argc != 0)
{
std::vector<char*> argv;
std::transform(point_filter.args.begin(), point_filter.args.end(), std::back_inserter(argv), convert_string);
argv.push_back(0);
if (!lasreadopener.parse(point_filter.argc, &argv[0]))
{
for (size_t i = 0; i < argv.size(); ++i)
delete[] argv[i];
send_message("Error parsing filter parameters.");
sig_fail();
return;
}
for (size_t i = 0; i < argv.size(); ++i)
delete[] argv[i];
}
reader = lasreadopener.open();
if (reader == NULL)
{
send_message("Error opening the file.");
sig_fail();
return;
}
// Check if we have a latlong file
latlong = is_latlong(reader);
// If we have latlong convert to UTM
if (latlong)
convert_projection();
// Get file boundary
Boundary boundary = get_boundary();
fileopener->set_utm_zone(get_utm_zone());
// If refreshing
if ((i == 0
&& (create_new_quadtree
|| !fileopener->get_loadedanyfiles()))
|| fileopener->get_lidardata() == NULL)
{
// Delete old quadtree
fileopener->delete_lidardata();
// Create new quadree
//.........这里部分代码省略.........
示例2: main
//.........这里部分代码省略.........
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: parse_string\n", argv[i]);
usage(true);
}
i++;
lasreadopener.set_parse_string(argv[i]);
}
else if (strcmp(argv[i],"-skip") == 0)
{
if ((i+1) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 1 argument: number_of_lines\n", argv[i]);
usage(true);
}
i++;
lasreadopener.set_skip_lines(atoi(argv[i]));
}
else if (strcmp(argv[i],"-set_scale") == 0)
{
if ((i+3) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 3 arguments: x y z\n", argv[i]);
usage(true);
}
F64 scale_factor[3];
i++;
sscanf(argv[i], "%lf", &(scale_factor[0]));
i++;
sscanf(argv[i], "%lf", &(scale_factor[1]));
i++;
sscanf(argv[i], "%lf", &(scale_factor[2]));
lasreadopener.set_scale_factor(scale_factor);
}
else if (strcmp(argv[i],"-set_offset") == 0)
{
if ((i+3) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs 3 arguments: x y z\n", argv[i]);
usage(true);
}
F64 offset[3];
i++;
sscanf(argv[i], "%lf", &(offset[0]));
i++;
sscanf(argv[i], "%lf", &(offset[1]));
i++;
sscanf(argv[i], "%lf", &(offset[2]));
lasreadopener.set_offset(offset);
}
else if (strcmp(argv[i],"-add_extra") == 0 || strcmp(argv[i],"-add_attribute") == 0)
{
if ((i+3) >= argc)
{
fprintf(stderr,"ERROR: '%s' needs at least 3 arguments: data_type name description\n", argv[i]);
usage(true);
}
if (((i+4) < argc) && (atof(argv[i+4]) != 0.0))
{
if (((i+5) < argc) && ((atof(argv[i+5]) != 0.0) || (strcmp(argv[i+5], "0") == 0) || (strcmp(argv[i+5], "0.0") == 0)))
{
if (((i+6) < argc) && (atof(argv[i+6]) != 0.0))
{
if (((i+7) < argc) && ((atof(argv[i+7]) != 0.0) || (strcmp(argv[i+7], "0") == 0) || (strcmp(argv[i+7], "0.0") == 0)))
{