MCPcopy Create free account
hub / github.com/PDAL/PDAL / read

Method read

io/FbiReader.cpp:286–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286point_count_t FbiReader::read(PointViewPtr view, point_count_t count)
287{
288 m_istreamPtr->seekg(hdr->PosXyz);
289 double Mul = 1.0 / hdr->UnitsXyz;
290
291 for (size_t i(0); i<hdr->FastCnt; i++)
292 {
293 fbi::UINT xr,yr,zr;
294 m_istreamPtr->read(reinterpret_cast<char *>(&xr), hdr->BitsX/8);
295 m_istreamPtr->read(reinterpret_cast<char *>(&yr), hdr->BitsY/8);
296 m_istreamPtr->read(reinterpret_cast<char *>(&zr), hdr->BitsZ/8);
297
298 double X = xr*Mul + hdr->OrgX;
299 double Y = yr*Mul + hdr->OrgY;
300 double Z = zr*Mul + hdr->OrgZ;
301
302 view->setField(Dimension::Id::X, i, X);
303 view->setField(Dimension::Id::Y, i, Y);
304 view->setField(Dimension::Id::Z, i, Z);
305 }
306
307 if (hdr->BitsTime > 0)
308 {
309 m_istreamPtr->seekg(hdr->PosTime);
310 for (size_t i(0); i<hdr->FastCnt; i++)
311 {
312 fbi::UINT64 timeGPS;
313 m_istreamPtr->read(reinterpret_cast<char *>(&timeGPS), hdr->BitsTime/8);
314 view->setField(Dimension::Id::OffsetTime, i, uint32_t(timeGPS));
315 }
316 }
317
318 if (hdr->BitsDistance > 0)
319 {
320 m_istreamPtr->seekg(hdr->PosDistance);
321 for (size_t i(0); i<hdr->FastCnt; i++)
322 {
323 fbi::UINT distance;
324 m_istreamPtr->read(reinterpret_cast<char *>(&distance), hdr->BitsDistance/8);
325 view->setField(Dimension::Id::NNDistance, i, uint32_t(distance));
326 }
327 }
328
329 if (hdr->BitsGroup > 0)
330 {
331 m_istreamPtr->seekg(hdr->PosGroup);
332 for (size_t i(0); i<hdr->FastCnt; i++)
333 {
334 fbi::UINT grpId;
335 m_istreamPtr->read(reinterpret_cast<char *>(&grpId), hdr->BitsGroup/8);
336 view->setField(Dimension::Id::ClusterID, i , uint32_t(grpId));
337 }
338 }
339
340 if (hdr->BitsNormal > 0)
341 {
342 m_istreamPtr->seekg(hdr->PosNormal, std::ios::beg);
343 for (size_t i(0); i<hdr->FastCnt; i++)

Callers 1

readFbiHeaderFunction · 0.45

Calls 3

NrmVecGetVectorFunction · 0.85
hasDimMethod · 0.80
setFieldMethod · 0.45

Tested by

no test coverage detected