Setup reader to read next scan if available.
| 245 | |
| 246 | /// Setup reader to read next scan if available. |
| 247 | void E57Reader::setupReader() |
| 248 | { |
| 249 | // Are we done with reading all scans? |
| 250 | if (++m_currentScan >= m_data3D->childCount()) |
| 251 | return; |
| 252 | |
| 253 | try |
| 254 | { |
| 255 | m_scan.reset(new Scan((StructureNode)m_data3D->get(m_currentScan))); |
| 256 | initializeBuffers(); |
| 257 | m_reader.reset(new CompressedVectorReader( |
| 258 | m_scan->getPoints().reader(m_destBuffers))); |
| 259 | } |
| 260 | catch (E57Exception& e) |
| 261 | { |
| 262 | throwError(std::to_string(e.errorCode()) + " : " + e.context()); |
| 263 | } |
| 264 | catch (...) |
| 265 | { |
| 266 | throwError("Got an unknown exception"); |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | /// Read the next batch of m_defaultChunkSize. |
| 271 | /// This returns number of points aquired. |