47 openvdb::initialize();
63 openvdb::GridBase::Ptr baseGrid;
64 openvdb::DoubleGrid::Ptr grid;
66 bool valid_grid =
false;
68 for (openvdb::io::File::NameIterator nameIter = file.beginName();
69 nameIter != file.endName(); ++nameIter)
71 if (nameIter.gridName() ==
"SpatioTemporalVoxelLayer")
73 baseGrid = file.readGrid(nameIter.gridName());
74 grid = openvdb::gridPtrCast<openvdb::DoubleGrid>(baseGrid);
81 std::cout <<
"No valid grid inside of provided file." << std::endl;
86 openvdb::DoubleGrid::ValueOnCIter cit_grid = grid->cbeginValueOn();
87 for (cit_grid; cit_grid; ++cit_grid)
89 const openvdb::Vec3d pt = grid->indexToWorld(cit_grid.getCoord());
90 cloud->push_back(pcl::PointXYZ(pt[0], pt[1], pt[2]));
void SetFile(const std::string &file_name)
bool GetCloud(pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud)