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


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

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


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

示例1: open

BOOL PULSEreaderLAS::open(const char* file_name, U32 io_buffer_size)
{
  if (file_name == 0)
  {
    fprintf(stderr,"ERROR: file name pointer is zero\n");
    return FALSE;
  }

  // close an existing lasreader

  if (lasreader)
  {
    lasreader->close();
    delete lasreader;
    lasreader = 0;
  }

  // open the lasreader

  LASreadOpener lasreadopener;
  lasreadopener.set_file_name(file_name);
  lasreader = lasreadopener.open();
  if (lasreader == 0)
  {
    fprintf(stderr,"ERROR: cannot open file '%s'\n", file_name);
    return FALSE;
  }

  // make sure the LAS file has pulse data

  if (lasreader->header.point_data_format != 4 && lasreader->header.point_data_format != 5)
  {
    fprintf(stderr,"ERROR: file '%s' contains points of type %d without waveforms\n", file_name, lasreader->header.point_data_format);
    return FALSE;
  }
  last_gps_time = 0.0;

  // check if the LAS file also has waves data

  laswaveform13reader = lasreadopener.open_waveform13(&lasreader->header);
  if (laswaveform13reader == 0)
  {
    fprintf(stderr,"WARNING: cannot open the waves of file '%s'.\n", file_name);
  }

  return open();
}
开发者ID:chambbj,项目名称:PulseWaves,代码行数:47,代码来源:pulsereader_las.cpp

示例2: main


//.........这里部分代码省略.........

#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);
  }

  // possibly loop over multiple input files

  while (lasreadopener.active())
  {
    if (verbose) start_time = taketime();

    // open lasreader

    LASreader* lasreader = lasreadopener.open();
    if (lasreader == 0)
    {
      fprintf(stderr, "ERROR: could not open lasreader\n");
      byebye(true, argc==1);
    }

    // (maybe) open laswaveform13reader

    LASwaveform13reader* laswaveform13reader = lasreadopener.open_waveform13(&lasreader->header);

    // get a pointer to the header

    LASheader* header = &(lasreader->header);

    // open output file
  
    FILE* file_out;

    if (laswriteopener.is_piped())
    {
      file_out = stdout;
    }
    else
    {
      // create output file name if needed 

      if (laswriteopener.get_file_name() == 0)
      {
        if (lasreadopener.get_file_name() == 0)
        {
          fprintf(stderr, "ERROR: no output file specified\n");
          byebye(true, argc==1);
        }
        laswriteopener.make_file_name(lasreadopener.get_file_name(), -2);
      }

      const CHAR* file_name_out = laswriteopener.get_file_name();

      // open output file

      file_out = fopen(file_name_out, "w");
开发者ID:KAMI911,项目名称:lastools,代码行数:67,代码来源:las2txt.cpp

示例3: main


//.........这里部分代码省略.........
          {
            file_name_out[len-3] = 'l';
            file_name_out[len-2] = 'a';
            file_name_out[len-1] = 'z';
          }
          laswriteopener.set_file_name(file_name_out);
          free(file_name_out);
        }
      }

      // maybe set projection

      if (projection_was_set)
      {
        lasreader->header.set_geo_keys(number_of_keys, (LASvlr_key_entry*)geo_keys);
        if (geo_double_params)
        {
          lasreader->header.set_geo_double_params(num_geo_double_params, geo_double_params);
        }
        else
        {
          lasreader->header.del_geo_double_params();
        }
        lasreader->header.del_geo_ascii_params();
      }

      // almost never open laswaveform13reader and laswaveform13writer (-:

      LASwaveform13reader* laswaveform13reader = 0;
      LASwaveform13writer* laswaveform13writer = 0;

      if (waveform)
      {
        laswaveform13reader = lasreadopener.open_waveform13(&lasreader->header);
        if (laswaveform13reader)
        {
          // switch compression on/off
          U8 compression_type = (laswriteopener.get_format() == LAS_TOOLS_FORMAT_LAZ ? 1 : 0);
          for (i = 0; i < 255; i++) if (lasreader->header.vlr_wave_packet_descr[i]) lasreader->header.vlr_wave_packet_descr[i]->setCompressionType(compression_type);
          // create laswaveform13writer
          laswaveform13writer = laswriteopener.open_waveform13(&lasreader->header);
          if (laswaveform13writer == 0)
          {
            delete [] laswaveform13reader;
            laswaveform13reader = 0;
            waveform = 0;
            // switch compression on/off back
            U8 compression_type = (laswriteopener.get_format() == LAS_TOOLS_FORMAT_LAZ ? 0 : 1);
            for (i = 0; i < 255; i++) if (lasreader->header.vlr_wave_packet_descr[i]) lasreader->header.vlr_wave_packet_descr[i]->setCompressionType(compression_type);
          }
        }
        else
        {
          waveform = false;
        }
      }

      // special check for LAS 1.3+ files that contain waveform data

      if ((lasreader->header.version_major == 1) && (lasreader->header.version_minor >= 3))
      {
        if (lasreader->header.global_encoding & 2) // if bit # 1 is set we have internal waveform data
        {
          lasreader->header.global_encoding &= ~((U16)2); // remove internal bit
          if (lasreader->header.start_of_waveform_data_packet_record) // offset to 
          {
开发者ID:bsmaldon,项目名称:lag,代码行数:67,代码来源:laszip.cpp


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