| 1500 | } |
| 1501 | |
| 1502 | BOOL LASreaderLAS::read_point_default() |
| 1503 | { |
| 1504 | if (p_idx < npoints) |
| 1505 | { |
| 1506 | if (reader->read(point.point) == FALSE) |
| 1507 | { |
| 1508 | if (reader->warning()) |
| 1509 | { |
| 1510 | LASMessage(LAS_WARNING, "'%s' for '%s'", reader->warning(), file_name); |
| 1511 | } |
| 1512 | if (reader->error()) |
| 1513 | { |
| 1514 | laserror("'%s' after %u of %u points for '%s'", reader->error(), (U32)p_cnt, (U32)npoints, file_name); |
| 1515 | } |
| 1516 | else |
| 1517 | { |
| 1518 | LASMessage(LAS_WARNING, "end-of-file after %u of %u points for '%s'", (U32)p_cnt, (U32)npoints, file_name); |
| 1519 | } |
| 1520 | return FALSE; |
| 1521 | } |
| 1522 | |
| 1523 | /* |
| 1524 | // fix for OPTECH LMS export error |
| 1525 | if (point.have_wavepacket) |
| 1526 | { |
| 1527 | // distance in meters light travels in one nanoseconds divided by two divided by 1000 |
| 1528 | F64 round_trip_distance_in_picoseconds = 0.299792458 / 2 / 1000; |
| 1529 | F64 x = -point.wavepacket.getXt(); |
| 1530 | F64 y = -point.wavepacket.getYt(); |
| 1531 | F64 z = -point.wavepacket.getZt(); |
| 1532 | F64 len = sqrt(x*x+y*y+z*z); |
| 1533 | x = x / len * round_trip_distance_in_picoseconds; |
| 1534 | y = y / len * round_trip_distance_in_picoseconds; |
| 1535 | z = z / len * round_trip_distance_in_picoseconds; |
| 1536 | point.wavepacket.setXt((F32)x); |
| 1537 | point.wavepacket.setYt((F32)y); |
| 1538 | point.wavepacket.setZt((F32)z); |
| 1539 | // alternative to converge on optical origin |
| 1540 | // point.wavepacket.setXt(-point.wavepacket.getXt()/point.wavepacket.getLocation()); |
| 1541 | // point.wavepacket.setYt(-point.wavepacket.getYt()/point.wavepacket.getLocation()); |
| 1542 | // point.wavepacket.setZt(-point.wavepacket.getZt()/point.wavepacket.getLocation()); |
| 1543 | } |
| 1544 | */ |
| 1545 | p_idx++; |
| 1546 | p_cnt++; |
| 1547 | return TRUE; |
| 1548 | } |
| 1549 | else |
| 1550 | { |
| 1551 | if (!checked_end) |
| 1552 | { |
| 1553 | if (reader->check_end() == FALSE) |
| 1554 | { |
| 1555 | laserror("'%s' when reaching end of encoding", reader->error()); |
| 1556 | p_idx--; |
| 1557 | p_cnt--; |
| 1558 | } |
| 1559 | if (reader->warning()) |