| 290 | } |
| 291 | |
| 292 | QuickInfo 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 | |
| 329 | void PlyReader::initialize() |
| 330 | { |
nothing calls this directly
no test coverage detected