#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/IO/read_points.h>
#include <CGAL/IO/write_points.h>
#include <CGAL/hierarchy_simplify_point_set.h>
#include <CGAL/Memory_sizer.h>
#include <CGAL/Timer.h>
#include <vector>
#include <fstream>
int main(int argc, char*argv[])
{
const std::string fname = (argc>1) ? argv[1] : CGAL::data_file_path("points_3/oni.pwn");
std::vector<Point> points;
{
std::cerr << "Error: cannot read file " << fname << std::endl;
return EXIT_FAILURE;
}
std::cout << "Read " << points.size () << " point(s)" << std::endl;
CGAL::Timer task_timer; task_timer.start();
CGAL::parameters::size(100)
.maximum_variation(0.01)),
points.end());
std::size_t memory = CGAL::Memory_sizer().virtual_size();
std::cout << points.size () << " point(s) kept, computed in "
<< task_timer.time() << " seconds, "
<< (memory>>20) << " Mib allocated." << std::endl;
return EXIT_SUCCESS;
}
PointRange::iterator hierarchy_simplify_point_set(PointRange &points, const NamedParameters &np=parameters::default_values())
Recursively split the point set in smaller clusters until the clusters have fewer than size elements ...
Definition: hierarchy_simplify_point_set.h:181
bool write_points(const std::string &fname, const PointRange &points, const NamedParameters &np=parameters::default_values(),)
writes the range of points with properties to a file.
Definition: write_points.h:92
bool read_points(const std::string &fname, PointOutputIterator output, const NamedParameters &np=parameters::default_values())
reads the point set from an input file.
Definition: read_points.h:89