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);
87 private:
88  char* file_name;
89  char* parse_string;
90  char* separator;
97 };
98 
99 #endif
LASheader
Definition: lasdefinitions.hpp:952
laswaveform13writer.hpp
LASwriter::write_point
virtual BOOL write_point(const LASpoint *point)=0
LASwriteOpener::separator
char * separator
Definition: laswriter.hpp:90
LASwriteOpener::file_name
char * file_name
Definition: laswriter.hpp:88
LASpoint
Definition: lasdefinitions.hpp:472
LASwriter::chunk
virtual BOOL chunk()=0
LASwriteOpener::LASwriteOpener
LASwriteOpener()
Definition: laswriter.cpp:491
LASwriteOpener::chunk_size
U32 chunk_size
Definition: laswriter.hpp:92
LASwriter::update_header
virtual BOOL update_header(const LASheader *header, BOOL use_inventory=TRUE, BOOL update_extra_bytes=FALSE)=0
LASwriteOpener::piped
BOOL piped() const
Definition: laswriter.cpp:41
LASwriteOpener::use_chunking
BOOL use_chunking
Definition: laswriter.hpp:93
I64
long long I64
Definition: mydefs.hpp:48
LASinventory
Definition: lasutility.hpp:36
LASwriter::p_count
I64 p_count
Definition: laswriter.hpp:52
lasutility.hpp
I32
int I32
Definition: mydefs.hpp:35
LASinventory::add
BOOL add(const LASpoint *point)
Definition: lasutility.cpp:48
TRUE
#define TRUE
Definition: mydefs.hpp:137
LASwriter::inventory
LASinventory inventory
Definition: laswriter.hpp:53
LASwriter
Definition: laswriter.hpp:47
LASwriter::LASwriter
LASwriter()
Definition: laswriter.hpp:62
LASwriteOpener::make_file_name
void make_file_name(const char *file_name, I32 file_number=-1)
Definition: laswriter.cpp:379
LASwriteOpener::parse
BOOL parse(int argc, char *argv[])
Definition: laswriter.cpp:197
LASwriteOpener
Definition: laswriter.hpp:68
LASwriteOpener::~LASwriteOpener
~LASwriteOpener()
Definition: laswriter.cpp:504
LASwriteOpener::set_format
void set_format(const char *format)
Definition: laswriter.cpp:348
LASwriteOpener::use_nil
BOOL use_nil
Definition: laswriter.hpp:95
LASwriteOpener::open_waveform13
LASwaveform13writer * open_waveform13(const LASheader *lasheader)
Definition: laswriter.cpp:170
LASwriter::~LASwriter
virtual ~LASwriter()
Definition: laswriter.hpp:63
LASwriteOpener::format_was_specified
BOOL format_was_specified() const
Definition: laswriter.cpp:464
LASwriteOpener::active
BOOL active() const
Definition: laswriter.cpp:486
LASwriteOpener::set_parse_string
void set_parse_string(const char *parse_string)
Definition: laswriter.cpp:474
LASwriteOpener::set_file_name
void set_file_name(const char *file_name)
Definition: laswriter.cpp:315
LASwriter::quantizer
LASquantizer quantizer
Definition: laswriter.hpp:50
BOOL
int BOOL
Definition: mydefs.hpp:57
argc
int argc
Definition: tests_high_five_parallel.cpp:27
FALSE
#define FALSE
Definition: mydefs.hpp:133
LASwriteOpener::format
U32 format
Definition: laswriter.hpp:91
LASwriter::close
virtual I64 close(BOOL update_npoints=TRUE)=0
LASwriteOpener::get_format
I32 get_format() const
Definition: laswriter.cpp:469
LASwriter::npoints
I64 npoints
Definition: laswriter.hpp:51
LASwaveform13writer
Definition: laswaveform13writer.hpp:42
U32
unsigned int U32
Definition: mydefs.hpp:39
LASwriteOpener::parse_string
char * parse_string
Definition: laswriter.hpp:89
LASwriteOpener::set_separator
void set_separator(const char *separator)
Definition: laswriter.cpp:480
LASwriteOpener::usage
void usage() const
Definition: laswriter.cpp:184
LASwriteOpener::open
LASwriter * open(LASheader *header)
Definition: laswriter.cpp:46
LASwriteOpener::get_file_name
const char * get_file_name() const
Definition: laswriter.cpp:459
LASquantizer
Definition: lasdefinitions.hpp:89
argv
char ** argv
Definition: tests_high_five_parallel.cpp:28
lasdefinitions.hpp
LASwriteOpener::use_v1
BOOL use_v1
Definition: laswriter.hpp:96
LASwriter::update_inventory
void update_inventory(const LASpoint *point)
Definition: laswriter.hpp:56
LASwriteOpener::use_stdout
BOOL use_stdout
Definition: laswriter.hpp:94


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 Wed Mar 2 2022 00:37:23