|
1 | 1 | /* |
2 | 2 | =============================================================================== |
3 | 3 |
|
4 | | - FILE: lasreader_txt.hpp |
| 4 | + FILE: lasreader_txt.hpp |
5 | 5 |
|
6 | | - CONTENTS: |
| 6 | + CONTENTS: |
7 | 7 |
|
8 | | - Reads LIDAR points in LAS format through on-the-fly conversion from ASCII. |
| 8 | + Reads LIDAR points in LAS format through on-the-fly conversion from ASCII. |
9 | 9 |
|
10 | | - PROGRAMMERS: |
| 10 | + PROGRAMMERS: |
11 | 11 |
|
12 | | - info@rapidlasso.de - https://rapidlasso.de |
| 12 | + info@rapidlasso.de - https://rapidlasso.de |
13 | 13 |
|
14 | | - COPYRIGHT: |
| 14 | + COPYRIGHT: |
15 | 15 |
|
16 | | - (c) 2007-2017, rapidlasso GmbH - fast tools to catch reality |
| 16 | + (c) 2007-2017, rapidlasso GmbH - fast tools to catch reality |
17 | 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 LICENSE.txt file for more information. |
| 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 LICENSE.txt file for more information. |
21 | 21 |
|
22 | | - This software is distributed WITHOUT ANY WARRANTY and without even the |
23 | | - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 22 | + This software is distributed WITHOUT ANY WARRANTY and without even the |
| 23 | + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
24 | 24 |
|
25 | | - CHANGE HISTORY: |
| 25 | + CHANGE HISTORY: |
26 | 26 |
|
27 | | - 7 September 2018 -- replaced calls to _strdup with calls to the LASCopyString macro |
28 | | - 22 July 2018 -- bug fix for parsing classfication to point type 6 (or higher) |
29 | | - 11 January 2017 -- added with<h>eld and scanner channe<l> for the parse string |
30 | | - 11 January 2017 -- added 'k'eypoint and 'o'verlap flags for the parse string |
31 | | - 17 January 2016 -- pre-scaling and pre-offsetting of "extra bytes" attributes |
32 | | - 9 July 2014 -- allowing input from stdin after the 7:1 in the World Cup |
33 | | - 8 April 2011 -- created after starting a google group for LAStools users |
| 27 | + 10 March 2022 -- added '-iptx_transform' option |
| 28 | + 7 September 2018 -- replaced calls to _strdup with calls to the LASCopyString macro |
| 29 | + 22 July 2018 -- bug fix for parsing classfication to point type 6 (or higher) |
| 30 | + 11 January 2017 -- added with<h>eld and scanner channe<l> for the parse string |
| 31 | + 11 January 2017 -- added 'k'eypoint and 'o'verlap flags for the parse string |
| 32 | + 17 January 2016 -- pre-scaling and pre-offsetting of "extra bytes" attributes |
| 33 | + 9 July 2014 -- allowing input from stdin after the 7:1 in the World Cup |
| 34 | + 8 April 2011 -- created after starting a google group for LAStools users |
34 | 35 |
|
35 | 36 | =============================================================================== |
36 | 37 | */ |
|
44 | 45 | class LASreaderTXT : public LASreader |
45 | 46 | { |
46 | 47 | public: |
| 48 | + BOOL iptx_transform; |
| 49 | + void set_pts(BOOL pts); |
| 50 | + void set_ptx(BOOL ptx); |
| 51 | + void set_ptx_transform(BOOL ptx); |
47 | 52 |
|
48 | | - void set_pts(BOOL pts); |
49 | | - void set_ptx(BOOL ptx); |
| 53 | + void set_translate_intensity(F32 translate_intensity); |
| 54 | + void set_scale_intensity(F32 scale_intensity); |
| 55 | + void set_translate_scan_angle(F32 translate_scan_angle); |
| 56 | + void set_scale_scan_angle(F32 scale_scan_angle); |
| 57 | + void set_scale_factor(const F64* scale_factor); |
| 58 | + void set_offset(const F64* offset); |
| 59 | + void add_attribute(I32 data_type, const CHAR* name, const CHAR* description = 0, F64 scale = 1.0, F64 offset = 0.0, F64 pre_scale = 1.0, F64 pre_offset = 0.0, F64 no_data = F64_MAX); |
| 60 | + virtual BOOL open(const CHAR* file_name, U8 point_type = 0, const CHAR* parse_string = 0, I32 skip_lines = 0, BOOL populate_header = FALSE); |
| 61 | + virtual BOOL open(FILE* file, const CHAR* file_name = 0, U8 point_type = 0, const CHAR* parse_string = 0, I32 skip_lines = 0, BOOL populate_header = FALSE); |
50 | 62 |
|
51 | | - void set_translate_intensity(F32 translate_intensity); |
52 | | - void set_scale_intensity(F32 scale_intensity); |
53 | | - void set_translate_scan_angle(F32 translate_scan_angle); |
54 | | - void set_scale_scan_angle(F32 scale_scan_angle); |
55 | | - void set_scale_factor(const F64* scale_factor); |
56 | | - void set_offset(const F64* offset); |
57 | | - void add_attribute(I32 data_type, const CHAR* name, const CHAR* description=0, F64 scale=1.0, F64 offset=0.0, F64 pre_scale=1.0, F64 pre_offset=0.0, F64 no_data=F64_MAX); |
58 | | - virtual BOOL open(const CHAR* file_name, U8 point_type=0, const CHAR* parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE); |
59 | | - virtual BOOL open(FILE* file, const CHAR* file_name=0, U8 point_type=0, const CHAR* parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE); |
| 63 | + I32 get_format() const { return LAS_TOOLS_FORMAT_TXT; }; |
60 | 64 |
|
61 | | - I32 get_format() const { return LAS_TOOLS_FORMAT_TXT; }; |
| 65 | + BOOL seek(const I64 p_index); |
62 | 66 |
|
63 | | - BOOL seek(const I64 p_index); |
| 67 | + ByteStreamIn* get_stream() const; |
| 68 | + void close(BOOL close_stream = TRUE); |
| 69 | + BOOL reopen(const CHAR* file_name); |
64 | 70 |
|
65 | | - ByteStreamIn* get_stream() const; |
66 | | - void close(BOOL close_stream=TRUE); |
67 | | - BOOL reopen(const CHAR* file_name); |
68 | | - |
69 | | - LASreaderTXT(); |
70 | | - virtual ~LASreaderTXT(); |
| 71 | + LASreaderTXT(); |
| 72 | + virtual ~LASreaderTXT(); |
71 | 73 |
|
72 | 74 | protected: |
73 | | - BOOL read_point_default(); |
| 75 | + BOOL read_point_default(); |
74 | 76 |
|
75 | 77 | private: |
76 | | - U8 point_type; |
77 | | - CHAR* parse_string; |
78 | | - F32 translate_intensity; |
79 | | - F32 scale_intensity; |
80 | | - F32 translate_scan_angle; |
81 | | - F32 scale_scan_angle; |
82 | | - F64* scale_factor; |
83 | | - F64* offset; |
84 | | - I32 skip_lines; |
85 | | - BOOL populated_header; |
86 | | - BOOL ipts; |
87 | | - BOOL iptx; |
88 | | - FILE* file; |
89 | | - bool piped; |
90 | | - CHAR line[512]; |
91 | | - I32 number_attributes; |
92 | | - I32 attributes_data_types[32]; |
93 | | - const CHAR* attribute_names[32]; |
94 | | - const CHAR* attribute_descriptions[32]; |
95 | | - F64 attribute_scales[32]; |
96 | | - F64 attribute_offsets[32]; |
97 | | - F64 attribute_pre_scales[32]; |
98 | | - F64 attribute_pre_offsets[32]; |
99 | | - F64 attribute_no_datas[32]; |
100 | | - I32 attribute_starts[32]; |
101 | | - BOOL parse_attribute(const CHAR* l, I32 index); |
102 | | - BOOL parse(const CHAR* parse_string); |
103 | | - BOOL check_parse_string(const CHAR* parse_string); |
104 | | - void populate_scale_and_offset(); |
105 | | - void populate_bounding_box(); |
106 | | - void clean(); |
| 78 | + U8 point_type; |
| 79 | + CHAR* parse_string; |
| 80 | + F32 translate_intensity; |
| 81 | + F32 scale_intensity; |
| 82 | + F32 translate_scan_angle; |
| 83 | + F32 scale_scan_angle; |
| 84 | + F64* scale_factor; |
| 85 | + F64* offset; |
| 86 | + I32 skip_lines; |
| 87 | + BOOL populated_header; |
| 88 | + BOOL ipts; |
| 89 | + BOOL iptx; |
| 90 | + FILE* file; |
| 91 | + bool piped; |
| 92 | + CHAR line[512]; |
| 93 | + I32 number_attributes; |
| 94 | + I32 attributes_data_types[32]; |
| 95 | + const CHAR* attribute_names[32]; |
| 96 | + const CHAR* attribute_descriptions[32]; |
| 97 | + F64 attribute_scales[32]; |
| 98 | + F64 attribute_offsets[32]; |
| 99 | + F64 attribute_pre_scales[32]; |
| 100 | + F64 attribute_pre_offsets[32]; |
| 101 | + F64 attribute_no_datas[32]; |
| 102 | + I32 attribute_starts[32]; |
| 103 | + BOOL parse_attribute(const CHAR* l, I32 index); |
| 104 | + BOOL parse(const CHAR* parse_string); |
| 105 | + BOOL check_parse_string(const CHAR* parse_string); |
| 106 | + void populate_scale_and_offset(); |
| 107 | + void populate_bounding_box(); |
| 108 | + void clean(); |
107 | 109 | }; |
108 | 110 |
|
109 | 111 | class LASreaderTXTrescale : public virtual LASreaderTXT |
110 | 112 | { |
111 | 113 | public: |
112 | | - virtual BOOL open(const CHAR* file_name, U8 point_type=0, const CHAR* parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE); |
113 | | - LASreaderTXTrescale(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor); |
| 114 | + virtual BOOL open(const CHAR* file_name, U8 point_type = 0, const CHAR* parse_string = 0, I32 skip_lines = 0, BOOL populate_header = FALSE); |
| 115 | + LASreaderTXTrescale(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor); |
114 | 116 |
|
115 | 117 | protected: |
116 | | - F64 scale_factor[3]; |
| 118 | + F64 scale_factor[3]; |
117 | 119 | }; |
118 | 120 |
|
119 | 121 | class LASreaderTXTreoffset : public virtual LASreaderTXT |
120 | 122 | { |
121 | 123 | public: |
122 | | - virtual BOOL open(const CHAR* file_name, U8 point_type=0, const CHAR* parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE); |
123 | | - LASreaderTXTreoffset(F64 x_offset, F64 y_offset, F64 z_offset); |
| 124 | + virtual BOOL open(const CHAR* file_name, U8 point_type = 0, const CHAR* parse_string = 0, I32 skip_lines = 0, BOOL populate_header = FALSE); |
| 125 | + LASreaderTXTreoffset(F64 x_offset, F64 y_offset, F64 z_offset); |
124 | 126 | protected: |
125 | | - F64 offset[3]; |
| 127 | + F64 offset[3]; |
126 | 128 | }; |
127 | 129 |
|
128 | 130 | class LASreaderTXTrescalereoffset : public LASreaderTXTrescale, LASreaderTXTreoffset |
129 | 131 | { |
130 | 132 | public: |
131 | | - BOOL open(const CHAR* file_name, U8 point_type=0, const CHAR* parse_string=0, I32 skip_lines=0, BOOL populate_header=FALSE); |
132 | | - LASreaderTXTrescalereoffset(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor, F64 x_offset, F64 y_offset, F64 z_offset); |
| 133 | + BOOL open(const CHAR* file_name, U8 point_type = 0, const CHAR* parse_string = 0, I32 skip_lines = 0, BOOL populate_header = FALSE); |
| 134 | + LASreaderTXTrescalereoffset(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor, F64 x_offset, F64 y_offset, F64 z_offset); |
133 | 135 | }; |
134 | 136 |
|
135 | 137 | #endif |
0 commit comments