MCPcopy Create free account
hub / github.com/LAStools/LAStools / open

Method open

LASlib/src/lasreaderbuffered.cpp:142–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142BOOL LASreaderBuffered::open()
143{
144 if (!lasreadopener.active())
145 {
146 laserror("no input name");
147 return FALSE;
148 }
149
150 // open the main file
151
152 lasreader = lasreadopener.open();
153 if (lasreader == 0)
154 {
155 laserror("opening '%s'", lasreadopener.get_file_name());
156 return FALSE;
157 }
158
159 // populate the merged header
160 header = lasreader->header;
161
162 // unlink pointers in other header so their data does not get deallocated twice
163 lasreader->header.unlink();
164
165 // special check for attributes in extra bytes
166 if (header.number_attributes)
167 {
168 header.number_attributes = 0;
169 header.init_attributes(lasreader->header.number_attributes, lasreader->header.attributes);
170 }
171
172 // initialize the point with the header info
173
174 if (header.laszip)
175 {
176 if (!point.init(&header, header.laszip->num_items, header.laszip->items, &header)) return FALSE;
177 }
178 else
179 {
180 if (!point.init(&header, header.point_data_format, header.point_data_record_length, &header)) return FALSE;
181 }
182
183 // maybe we have to look for neighbors from which we load buffer points
184
185 if (lasreadopener_neighbors.active())
186 {
187 F64 xyz;
188
189 lasreadopener_neighbors.set_inside_rectangle(header.min_x - buffer_size, header.min_y - buffer_size, header.max_x + buffer_size, header.max_y + buffer_size);
190
191 // store current counts and bounding box in LASoriginal VLR
192
193 header.set_lasoriginal();
194
195 // force identical scale on the neighbors
196
197 lasreadopener_neighbors.set_scale_factor(&header.x_scale_factor);
198
199 // force identical offset on the neighbors

Callers

nothing calls this directly

Calls 9

laserrorFunction · 0.85
LASMessageFunction · 0.85
set_inside_rectangleMethod · 0.80
activeMethod · 0.45
get_file_nameMethod · 0.45
initMethod · 0.45
set_scale_factorMethod · 0.45
set_offsetMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected