| 247 | } |
| 248 | |
| 249 | BOOL LASreader::inside_rectangle(const F64 min_x, const F64 min_y, const F64 max_x, const F64 max_y) { |
| 250 | inside = 3; |
| 251 | r_min_x = min_x; |
| 252 | r_min_y = min_y; |
| 253 | r_max_x = max_x; |
| 254 | r_max_y = max_y; |
| 255 | orig_min_x = header.min_x; |
| 256 | orig_min_y = header.min_y; |
| 257 | orig_max_x = header.max_x; |
| 258 | orig_max_y = header.max_y; |
| 259 | header.min_x = min_x; |
| 260 | header.min_y = min_y; |
| 261 | header.max_x = max_x; |
| 262 | header.max_y = max_y; |
| 263 | if (((orig_min_x > max_x) || (orig_min_y > max_y) || (orig_max_x < min_x) || (orig_max_y < min_y))) { |
| 264 | if (filter || transform) { |
| 265 | read_complex = &LASreader::read_point_none; |
| 266 | } else { |
| 267 | read_simple = &LASreader::read_point_none; |
| 268 | } |
| 269 | } else if (filter || transform) { |
| 270 | if (index) { |
| 271 | index->intersect_rectangle(min_x, min_y, max_x, max_y); |
| 272 | read_complex = &LASreader::read_point_inside_rectangle_indexed; |
| 273 | } else if (copc_index) { |
| 274 | copc_index->intersect_rectangle(min_x, min_y, max_x, max_y); |
| 275 | read_complex = &LASreader::read_point_inside_rectangle_copc_indexed; |
| 276 | } else { |
| 277 | read_complex = &LASreader::read_point_inside_rectangle; |
| 278 | } |
| 279 | } else { |
| 280 | if (index) { |
| 281 | index->intersect_rectangle(min_x, min_y, max_x, max_y); |
| 282 | read_simple = &LASreader::read_point_inside_rectangle_indexed; |
| 283 | } else if (copc_index) { |
| 284 | copc_index->intersect_rectangle(min_x, min_y, max_x, max_y); |
| 285 | read_simple = &LASreader::read_point_inside_rectangle_copc_indexed; |
| 286 | } else { |
| 287 | read_simple = &LASreader::read_point_inside_rectangle; |
| 288 | } |
| 289 | } |
| 290 | return TRUE; |
| 291 | } |
| 292 | |
| 293 | BOOL LASreader::inside_copc_depth(const U8 mode, const I32 depth, const F32 resolution) { |
| 294 | if (!header.vlr_copc_info) return FALSE; |
no test coverage detected