lasreader_txt.hpp
Go to the documentation of this file.
1 /*
2 ===============================================================================
3 
4  FILE: lasreader_txt.hpp
5 
6  CONTENTS:
7 
8  Reads LIDAR points in LAS format through on-the-fly conversion from ASCII.
9 
10  PROGRAMMERS:
11 
12  martin.isenburg@gmail.com
13 
14  COPYRIGHT:
15 
16  (c) 2007-2011, Martin Isenburg, LASSO - tools to catch reality
17 
18  This is free software; you can redistribute and/or modify it under the
19  terms of the GNU Lesser General Licence as published by the Free Software
20  Foundation. See the COPYING file for more information.
21 
22  This software is distributed WITHOUT ANY WARRANTY and without even the
23  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 
25  CHANGE HISTORY:
26 
27  8 April 2011 -- created after starting a google group for LAStools users
28 
29 ===============================================================================
30 */
31 #ifndef LAS_READER_TXT_HPP
32 #define LAS_READER_TXT_HPP
33 
34 #include "lasreader.hpp"
35 
36 #include <stdio.h>
37 
38 class LASreaderTXT : public LASreader
39 {
40 public:
41 
46  void set_scale_factor(const F64* scale_factor);
47  void set_offset(const F64* offset);
48  void add_extra_attribute(I32 data_type, const char* name, const char* description=0, F64 scale=1.0, F64 offset=0.0);
49  virtual BOOL open(const char* file_name, const char* parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE);
50 
51  I32 get_format() const { return LAS_TOOLS_FORMAT_TXT; };
52 
53  BOOL seek(const I64 p_index);
54 
55  ByteStreamIn* get_stream() const;
56  void close(BOOL close_stream=TRUE);
57  BOOL reopen(const char* file_name);
58 
59  LASreaderTXT();
60  virtual ~LASreaderTXT();
61 
62 protected:
64 
65 private:
66  char* parse_string;
75  FILE* file;
76  bool piped;
77  char line[512];
80  const char* extra_attribute_names[10];
85  BOOL parse_extra_attribute(const char* l, I32 index);
86  BOOL parse(const char* parse_string);
87  BOOL check_parse_string(const char* parse_string);
89  void populate_bounding_box();
90  void clean();
91 };
92 
93 class LASreaderTXTrescale : public virtual LASreaderTXT
94 {
95 public:
96  virtual BOOL open(const char* file_name, const char* parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE);
97  LASreaderTXTrescale(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor);
98 
99 protected:
101 };
102 
103 class LASreaderTXTreoffset : public virtual LASreaderTXT
104 {
105 public:
106  virtual BOOL open(const char* file_name, const char* parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE);
107  LASreaderTXTreoffset(F64 x_offset, F64 y_offset, F64 z_offset);
108 protected:
110 };
111 
113 {
114 public:
115  BOOL open(const char* file_name, const char* parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE);
116  LASreaderTXTrescalereoffset(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor, F64 x_offset, F64 y_offset, F64 z_offset);
117 };
118 
119 #endif
I32 get_format() const
int BOOL
Definition: mydefs.hpp:57
void populate_bounding_box()
#define FALSE
Definition: mydefs.hpp:133
F64 extra_attribute_offsets[10]
BOOL parse(const char *parse_string)
float F32
Definition: mydefs.hpp:51
void close(BOOL close_stream=TRUE)
void set_translate_intensity(F32 translate_intensity)
char * parse_string
const char * extra_attribute_descriptions[10]
BOOL seek(const I64 p_index)
BOOL read_point_default()
LASindex * index
Definition: lasreader.hpp:106
F32 translate_scan_angle
void set_offset(const F64 *offset)
const char * extra_attribute_names[10]
virtual ~LASreaderTXT()
void set_scale_intensity(F32 scale_intensity)
void populate_scale_and_offset()
long long I64
Definition: mydefs.hpp:48
void set_scale_scan_angle(F32 scale_scan_angle)
void add_extra_attribute(I32 data_type, const char *name, const char *description=0, F64 scale=1.0, F64 offset=0.0)
BOOL check_parse_string(const char *parse_string)
void set_translate_scan_angle(F32 translate_scan_angle)
ByteStreamIn * get_stream() const
int I32
Definition: mydefs.hpp:35
void set_scale_factor(const F64 *scale_factor)
I32 number_extra_attributes
I32 extra_attributes_data_types[10]
BOOL reopen(const char *file_name)
#define LAS_TOOLS_FORMAT_TXT
I32 extra_attribute_array_offsets[10]
BOOL parse_extra_attribute(const char *l, I32 index)
#define TRUE
Definition: mydefs.hpp:137
virtual BOOL open(const char *file_name, const char *parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE)
F64 extra_attribute_scales[10]
double F64
Definition: mydefs.hpp:52
char line[512]


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