| 74 | } |
| 75 | |
| 76 | void PcdReader::ready(PointTableRef table) |
| 77 | { |
| 78 | m_index = 0; |
| 79 | switch (m_header.m_dataStorage) |
| 80 | { |
| 81 | case PcdDataStorage::ASCII: |
| 82 | m_istreamPtr = Utils::openFile(m_filename, true); |
| 83 | if (!m_istreamPtr) |
| 84 | throwError("Unable to open ASCII PCD file '" + m_filename + "'."); |
| 85 | m_istreamPtr->seekg(m_header.m_dataOffset); |
| 86 | break; |
| 87 | case PcdDataStorage::BINARY: |
| 88 | m_istreamPtr = Utils::openFile(m_filename, true); |
| 89 | if (!m_istreamPtr) |
| 90 | throwError("Unable to open binary PCD file '" + m_filename + "'."); |
| 91 | m_stream = ILeStream(m_istreamPtr); |
| 92 | m_stream.seek(m_header.m_dataOffset); |
| 93 | break; |
| 94 | case PcdDataStorage::COMPRESSED: |
| 95 | throwError("Binary compressed PCD is not supported at this time."); |
| 96 | break; |
| 97 | case PcdDataStorage::unknown: |
| 98 | default: |
| 99 | throwError("Unrecognized data storage."); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | void PcdReader::addDimensions(PointLayoutPtr layout) |
| 104 | { |