251{
254
255 const IObject top =
archive.getTop();
256
257 for (size_t i = 0; i < top.getNumChildren(); ++i) {
258 const auto& header = top.getChildHeader(i);
259 const std::string&
name = header.getName();
260
261 StreamRecord record;
262 record.metadata = user_metadata(header.getMetaData());
263
264 ICompoundProperty arb;
265
266 if (IPoints::matches(header)) {
268 auto& schema =
points.getSchema();
269 record.topology = PrimitiveTopology::POINT_LIST;
270 record.sample_count = schema.getNumSamples();
271 record.time_sampling = schema.getTimeSampling();
272 arb = schema.getArbGeomParams();
273 record.object = std::move(
points);
274 } else if (ICurves::matches(header)) {
275 ICurves curves(top,
name);
276 auto& schema = curves.getSchema();
277 record.topology = PrimitiveTopology::LINE_STRIP;
278 record.sample_count = schema.getNumSamples();
279 record.time_sampling = schema.getTimeSampling();
280 arb = schema.getArbGeomParams();
281 record.object = std::move(curves);
282 } else {
284 "SpatialReader: object '{}' is neither points nor curves, skipped",
name);
285 continue;
286 }
287
288 record.attributes = declare_attributes(arb,
name);
289
292 }
293}
#define MF_WARN(comp, ctx,...)
std::vector< glm::vec2 > * points
@ FileIO
Filesystem I/O operations.
@ IO
Networking, file handling, streaming.
std::unordered_map< std::string, StreamRecord > records
std::vector< std::string > names