| 383 | } |
| 384 | |
| 385 | void DracoWriter::addPoint(DimensionInfo dim, PointRef &point, PointId idx) |
| 386 | { |
| 387 | const auto pointId = draco::PointIndex((uint32_t)idx); |
| 388 | |
| 389 | //find data type and create buffer |
| 390 | Dimension::Type dataType = dim.pdalDims[0].m_type; |
| 391 | size_t size = Dimension::size(dataType) * dim.pdalDims.size(); |
| 392 | |
| 393 | std::vector<char> buffer(size, 0); |
| 394 | //fill buffer |
| 395 | point.getPackedData(dim.pdalDims, buffer.data()); |
| 396 | //add to draco pointcloud |
| 397 | draco::PointAttribute *const att = m_pc->attribute(dim.attId); |
| 398 | att->SetAttributeValue(att->mapped_index(pointId), buffer.data()); |
| 399 | } |
| 400 | |
| 401 | void DracoWriter::write(const PointViewPtr view) |
| 402 | { |