laswriter.hpp
Go to the documentation of this file.
1 /*
2 ===============================================================================
3 
4  FILE: laswriter.hpp
5 
6  CONTENTS:
7 
8  Interface to write LIDAR points to the LAS format versions 1.0 - 1.3 and
9  per on-the-fly conversion to simple ASCII files.
10 
11  PROGRAMMERS:
12 
13  martin.isenburg@gmail.com
14 
15  COPYRIGHT:
16 
17  (c) 2007-2011, Martin Isenburg, LASSO - tools to catch reality
18 
19  This is free software; you can redistribute and/or modify it under the
20  terms of the GNU Lesser General Licence as published by the Free Software
21  Foundation. See the COPYING file for more information.
22 
23  This software is distributed WITHOUT ANY WARRANTY and without even the
24  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
25 
26  CHANGE HISTORY:
27 
28  5 September 2011 -- support for writing Terrasolid's BIN format
29  11 June 2011 -- billion point support: p_count & npoints are 64 bit counters
30  8 May 2011 -- added an option for variable chunking via chunk()
31  9 April 2011 -- added capability to write on-the-fly conversion to ASCII
32  24 January 2011 -- introduced LASwriteOpener
33  21 January 2011 -- turned into abstract reader to support multiple files
34  3 December 2010 -- updated to (somewhat) support LAS format 1.3
35  7 September 2008 -- updated to support LAS format 1.2
36  21 February 2007 -- created after eating Sarah's veggies with peanutsauce
37 
38 ===============================================================================
39 */
40 #ifndef LAS_WRITER_HPP
41 #define LAS_WRITER_HPP
42 
43 #include "lasdefinitions.hpp"
44 
45 #include "lasutility.hpp"
46 
47 class LASwriter
48 {
49 public:
54 
55  virtual BOOL write_point(const LASpoint* point) = 0;
56  void update_inventory(const LASpoint* point) { inventory.add(point); };
57  virtual BOOL chunk() = 0;
58 
59  virtual BOOL update_header(const LASheader* header, BOOL use_inventory=TRUE, BOOL update_extra_bytes=FALSE) = 0;
60  virtual I64 close(BOOL update_npoints=TRUE) = 0;
61 
62  LASwriter() { npoints = 0; p_count = 0; };
63  virtual ~LASwriter() {};
64 };
65 
66 #include "laswaveform13writer.hpp"
67 
69 {
70 public:
71  void set_file_name(const char* file_name);
72  void set_format(const char* format);
73  void make_file_name(const char* file_name, I32 file_number=-1);
74  const char* get_file_name() const;
75  BOOL format_was_specified() const;
76  I32 get_format() const;
77  void set_parse_string(const char* parse_string);
78  void set_separator(const char* separator);
79  void usage() const;
80  BOOL parse(int argc, char* argv[]);
81  BOOL active() const;
82  BOOL piped() const;
83  LASwriter* open(LASheader* header);
84  LASwaveform13writer* open_waveform13(const LASheader* lasheader);
86  ~LASwriteOpener();
87 private:
88  char* file_name;
89  char* parse_string;
90  char* separator;
97 };
98 
99 #endif
virtual ~LASwriter()
Definition: laswriter.hpp:63
int BOOL
Definition: mydefs.hpp:57
#define FALSE
Definition: mydefs.hpp:133
LASquantizer quantizer
Definition: laswriter.hpp:50
unsigned int U32
Definition: mydefs.hpp:39
virtual BOOL write_point(const LASpoint *point)=0
BOOL add(const LASpoint *point)
Definition: lasutility.cpp:48
char * parse_string
Definition: laswriter.hpp:89
long long I64
Definition: mydefs.hpp:48
char * file_name
Definition: laswriter.hpp:88
virtual I64 close(BOOL update_npoints=TRUE)=0
int I32
Definition: mydefs.hpp:35
I64 npoints
Definition: laswriter.hpp:51
LASinventory inventory
Definition: laswriter.hpp:53
void update_inventory(const LASpoint *point)
Definition: laswriter.hpp:56
char * separator
Definition: laswriter.hpp:90
virtual BOOL update_header(const LASheader *header, BOOL use_inventory=TRUE, BOOL update_extra_bytes=FALSE)=0
#define TRUE
Definition: mydefs.hpp:137
virtual BOOL chunk()=0
std::shared_ptr< HighFive::File > open(const std::string &filename)
Definition: Hdf5Util.cpp:202
I64 p_count
Definition: laswriter.hpp:52
char ** argv


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:07