当前位置: 首页>>代码示例>>C++>>正文


C++ LASreadOpener::add_directory方法代码示例

本文整理汇总了C++中LASreadOpener::add_directory方法的典型用法代码示例。如果您正苦于以下问题:C++ LASreadOpener::add_directory方法的具体用法?C++ LASreadOpener::add_directory怎么用?C++ LASreadOpener::add_directory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LASreadOpener的用法示例。


在下文中一共展示了LASreadOpener::add_directory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char *argv[])
{
  int i;
  BOOL verbose = TRUE;
  BOOL very_verbose = TRUE;
  F64 start_time = 0.0;
  F64 full_start_time = 0.0;
  const CHAR* xml_output_file = 0;
  BOOL one_report_per_file = FALSE;
  U32 num_pass = 0;
  U32 num_fail = 0;
  U32 num_warning = 0;

  fprintf(stderr, "This is version '%s' of the LAS validator. Please contact\n", "GRiD-1");
  fprintf(stderr, "me at '[email protected]' if you disagree with\n");
  fprintf(stderr, "validation reports, want additional checks, or find bugs as\n");
  fprintf(stderr, "the software is still under development. Your feedback will\n");
  fprintf(stderr, "help to finish it sooner.\n");

  LASreadOpener lasreadopener;

  if (argc == 1)
  {
    fprintf(stderr,"lasvalidate.exe is best run with arguments in the command line\n");
    char file_name[256];
    fprintf(stderr,"enter input LAS file name: "); fgets(file_name, 256, stdin);
    file_name[strlen(file_name)-1] = '\0';
    lasreadopener.set_file_name(file_name);
    fprintf(stderr,"enter output XML file name: "); fgets(file_name, 256, stdin);
    file_name[strlen(file_name)-1] = '\0';
    xml_output_file = strdup(file_name);
  }

  for (i = 1; i < argc; i++)
  {
    if (strcmp(argv[i],"-version") == 0)
    {
      fprintf(stderr, "\nlasvalidate %d with LASread (v %d.%d %d) and LAScheck (v %d.%d %d) by rapidlasso GmbH\n", VALIDATE_VERSION, LASREAD_VERSION_MAJOR, LASREAD_VERSION_MINOR, LASREAD_BUILD_DATE, LASCHECK_VERSION_MAJOR, LASCHECK_VERSION_MINOR, LASCHECK_BUILD_DATE);
      byebye(LAS_VALIDATE_SUCCESS);
    }
    else if (strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"-help") == 0)
    {
      lasreadopener.usage();
      usage(LAS_VALIDATE_SUCCESS);
    }
    else if (strcmp(argv[i],"-v") == 0 || strcmp(argv[i],"-verbose") == 0)
    {
      verbose = TRUE;
    }
    else if (strcmp(argv[i],"-vv") == 0 || strcmp(argv[i],"-very_verbose") == 0)
    {
      verbose = TRUE;
      very_verbose = TRUE;
    }
    else if (strcmp(argv[i],"-i") == 0)
    {
      if ((i+1) >= argc)
      {
        fprintf(stderr,"ERROR: '%s' needs at least 1 argument: file_name or wild_card\n", argv[i]);
        usage(LAS_VALIDATE_WRONG_COMMAND_LINE_SYNTAX);
      }
      i+=1;
      do
      {
        lasreadopener.add_file_name(argv[i]);
        i+=1;
      } while (i < argc && *argv[i] != '-');
      i-=1;
    }
    else if (strcmp(argv[i],"-irec") == 0)
    {
      if ((i+1) >= argc)
      {
        fprintf(stderr,"ERROR: '%s' needs at least 1 argument: directory_name\n", argv[i]);
        usage(LAS_VALIDATE_WRONG_COMMAND_LINE_SYNTAX);
      }
      i+=1;
      do
      {
        lasreadopener.add_directory(argv[i], TRUE);
        i+=1;
      } while (i < argc && *argv[i] != '-');
      i-=1;
    }
    else if (strcmp(argv[i],"-stdin") == 0)
    {
      lasreadopener.set_piped(TRUE);
    }
    else if (strcmp(argv[i],"-lof") == 0)
    {
      if ((i+1) >= argc)
      {
        fprintf(stderr,"ERROR: '%s' needs 1 argument: list_of_files\n", argv[i]);
        usage(LAS_VALIDATE_WRONG_COMMAND_LINE_SYNTAX);
      }
      FILE* file = fopen(argv[i+1], "r");
      if (file == 0)
      {
        fprintf(stderr, "ERROR: cannot open '%s'\n", argv[i+1]);
        return FALSE;
//.........这里部分代码省略.........
开发者ID:CRREL,项目名称:lasvalidate,代码行数:101,代码来源:lasvalidate.cpp


注:本文中的LASreadOpener::add_directory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。