#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/compute_average_spacing.h>
#include <CGAL/IO/read_xyz_points.h>
#include <vector>
#include <fstream>
#include <boost/tuple/tuple.hpp>
typedef boost::tuple<int, Point, int, int, int> IndexedPointWithColorTuple;
int main(void)
{
std::vector<IndexedPointWithColorTuple> points;
std::ifstream stream("data/sphere_20k.xyz");
if (!stream ||
stream, std::back_inserter(points),
{
std::cerr << "Error: cannot read file data/sphere_20k.xyz" << std::endl;
return EXIT_FAILURE;
}
for(unsigned int i = 0; i < points.size(); i++)
{
points[i].get<0>() = i;
points[i].get<2>() = 0;
points[i].get<3>() = 0;
points[i].get<4>() = 0;
}
const unsigned int nb_neighbors = 6;
points.begin(), points.end(),
nb_neighbors);
std::cout << "Average spacing: " << average_spacing << std::endl;
return EXIT_SUCCESS;
}