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);
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
LASreaderTXT::add_extra_attribute
void add_extra_attribute(I32 data_type, const char *name, const char *description=0, F64 scale=1.0, F64 offset=0.0)
Definition: lasreader_txt.cpp:437
LASreaderTXT::get_stream
ByteStreamIn * get_stream() const
Definition: lasreader_txt.cpp:586
LASreaderTXT::LASreaderTXT
LASreaderTXT()
Definition: lasreader_txt.cpp:671
LASreaderTXTreoffset::open
virtual BOOL open(const char *file_name, const char *parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE)
Definition: lasreader_txt.cpp:1230
LASreaderTXTrescale
Definition: lasreader_txt.hpp:93
LASreaderTXT::number_extra_attributes
I32 number_extra_attributes
Definition: lasreader_txt.hpp:78
LASreaderTXT::set_translate_intensity
void set_translate_intensity(F32 translate_intensity)
Definition: lasreader_txt.cpp:385
LASreaderTXT::reopen
BOOL reopen(const char *file_name)
Definition: lasreader_txt.cpp:601
LASreaderTXTrescalereoffset
Definition: lasreader_txt.hpp:112
LASreaderTXT::populate_bounding_box
void populate_bounding_box()
Definition: lasreader_txt.cpp:1128
lasreader.hpp
LASreaderTXT::extra_attribute_offsets
F64 extra_attribute_offsets[10]
Definition: lasreader_txt.hpp:83
LASreaderTXT::offset
F64 * offset
Definition: lasreader_txt.hpp:72
LASreaderTXT::scale_scan_angle
F32 scale_scan_angle
Definition: lasreader_txt.hpp:70
I64
long long I64
Definition: mydefs.hpp:48
F64
double F64
Definition: mydefs.hpp:52
LASreaderTXTrescale::scale_factor
F64 scale_factor[3]
Definition: lasreader_txt.hpp:100
I32
int I32
Definition: mydefs.hpp:35
LASreaderTXT::set_scale_factor
void set_scale_factor(const F64 *scale_factor)
Definition: lasreader_txt.cpp:405
LASreaderTXT::parse
BOOL parse(const char *parse_string)
Definition: lasreader_txt.cpp:850
TRUE
#define TRUE
Definition: mydefs.hpp:137
LASreaderTXT::extra_attributes_data_types
I32 extra_attributes_data_types[10]
Definition: lasreader_txt.hpp:79
LASreaderTXT::skip_lines
I32 skip_lines
Definition: lasreader_txt.hpp:73
LASreaderTXTreoffset
Definition: lasreader_txt.hpp:103
LASreaderTXT::piped
bool piped
Definition: lasreader_txt.hpp:76
LASreaderTXT::~LASreaderTXT
virtual ~LASreaderTXT()
Definition: lasreader_txt.cpp:686
LASreaderTXTrescalereoffset::LASreaderTXTrescalereoffset
LASreaderTXTrescalereoffset(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor, F64 x_offset, F64 y_offset, F64 z_offset)
Definition: lasreader_txt.cpp:1249
LASreaderTXTrescale::open
virtual BOOL open(const char *file_name, const char *parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE)
Definition: lasreader_txt.cpp:1204
LASreaderTXT::parse_extra_attribute
BOOL parse_extra_attribute(const char *l, I32 index)
Definition: lasreader_txt.cpp:701
LASreaderTXT::set_scale_scan_angle
void set_scale_scan_angle(F32 scale_scan_angle)
Definition: lasreader_txt.cpp:400
LASreaderTXT::set_scale_intensity
void set_scale_intensity(F32 scale_intensity)
Definition: lasreader_txt.cpp:390
LASreaderTXT::line
char line[512]
Definition: lasreader_txt.hpp:77
LASreader
Definition: lasreader.hpp:49
LASreaderTXT
Definition: lasreader_txt.hpp:38
LASreaderTXTrescale::LASreaderTXTrescale
LASreaderTXTrescale(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor)
Definition: lasreader_txt.cpp:1197
LASreaderTXTreoffset::offset
F64 offset[3]
Definition: lasreader_txt.hpp:109
LASreaderTXT::scale_factor
F64 * scale_factor
Definition: lasreader_txt.hpp:71
ByteStreamIn
Definition: bytestreamin.hpp:36
LASreader::index
LASindex * index
Definition: lasreader.hpp:106
LASreaderTXTrescalereoffset::open
BOOL open(const char *file_name, const char *parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE)
Definition: lasreader_txt.cpp:1253
LASreaderTXT::file
FILE * file
Definition: lasreader_txt.hpp:75
LASreaderTXT::get_format
I32 get_format() const
Definition: lasreader_txt.hpp:51
LASreaderTXTreoffset::LASreaderTXTreoffset
LASreaderTXTreoffset(F64 x_offset, F64 y_offset, F64 z_offset)
Definition: lasreader_txt.cpp:1223
LASreaderTXT::parse_string
char * parse_string
Definition: lasreader_txt.hpp:66
LASreaderTXT::extra_attribute_descriptions
const char * extra_attribute_descriptions[10]
Definition: lasreader_txt.hpp:81
LASreaderTXT::seek
BOOL seek(const I64 p_index)
Definition: lasreader_txt.cpp:463
LASreaderTXT::translate_scan_angle
F32 translate_scan_angle
Definition: lasreader_txt.hpp:69
LASreaderTXT::set_translate_scan_angle
void set_translate_scan_angle(F32 translate_scan_angle)
Definition: lasreader_txt.cpp:395
BOOL
int BOOL
Definition: mydefs.hpp:57
LAS_TOOLS_FORMAT_TXT
#define LAS_TOOLS_FORMAT_TXT
Definition: lasdefinitions.hpp:63
LASreaderTXT::translate_intensity
F32 translate_intensity
Definition: lasreader_txt.hpp:67
LASreaderTXT::read_point_default
BOOL read_point_default()
Definition: lasreader_txt.cpp:515
LASreaderTXT::extra_attribute_array_offsets
I32 extra_attribute_array_offsets[10]
Definition: lasreader_txt.hpp:84
FALSE
#define FALSE
Definition: mydefs.hpp:133
F32
float F32
Definition: mydefs.hpp:51
LASreaderTXT::close
void close(BOOL close_stream=TRUE)
Definition: lasreader_txt.cpp:591
LASreaderTXT::set_offset
void set_offset(const F64 *offset)
Definition: lasreader_txt.cpp:421
LASreaderTXT::extra_attribute_names
const char * extra_attribute_names[10]
Definition: lasreader_txt.hpp:80
LASreaderTXT::scale_intensity
F32 scale_intensity
Definition: lasreader_txt.hpp:68
LASreaderTXT::open
virtual BOOL open(const char *file_name, const char *parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE)
Definition: lasreader_txt.cpp:42
LASreaderTXT::clean
void clean()
Definition: lasreader_txt.cpp:655
LASreaderTXT::extra_attribute_scales
F64 extra_attribute_scales[10]
Definition: lasreader_txt.hpp:82
LASreaderTXT::populate_scale_and_offset
void populate_scale_and_offset()
Definition: lasreader_txt.cpp:1080
LASreaderTXT::check_parse_string
BOOL check_parse_string(const char *parse_string)
Definition: lasreader_txt.cpp:1019
LASreaderTXT::populated_header
BOOL populated_header
Definition: lasreader_txt.hpp:74


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