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

Method inspect

io/PlyReader.cpp:292–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292QuickInfo PlyReader::inspect()
293{
294 QuickInfo qi;
295
296 PointTable t;
297 initialize();
298 addDimensions(t.layout());
299 t.finalize();
300
301 if (m_vertexElt)
302 {
303 // Get quick info information from the vertex element (if initialised). We ignore the bounds
304 // since calculating that would require reading the entire file. We also ignore the spatial
305 // reference since we don't have that.
306
307 qi.m_valid = true;
308 qi.m_pointCount = static_cast<point_count_t>(m_vertexElt->m_count);
309 for (auto& prop : m_vertexElt->m_properties)
310 qi.m_dimNames.push_back(prop->m_name);
311 }
312
313 // We have to read the points to actually get the bounds
314 PointViewPtr v(new PointView(t));
315 ready(t);
316 read(v, qi.m_pointCount);
317 done(t);
318 for (PointRef p : *v)
319 {
320 float x = p.getFieldAs<float>(Dimension::Id::X);
321 float y = p.getFieldAs<float>(Dimension::Id::Y);
322 float z = p.getFieldAs<float>(Dimension::Id::Z);
323 qi.m_bounds.grow(x, y, z);
324 }
325
326 return qi;
327}
328
329void PlyReader::initialize()
330{

Callers

nothing calls this directly

Calls 7

initializeFunction · 0.85
addDimensionsFunction · 0.85
readFunction · 0.85
readyFunction · 0.50
doneFunction · 0.50
finalizeMethod · 0.45
growMethod · 0.45

Tested by

no test coverage detected