#include #include #include #include #include #include // Type Declarations typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; typedef CGAL::Point_set_3 Point_set; typedef Point_set::Point_map Point_map; typedef CGAL::Octree Octree; int main(int argc, char **argv) { // Point set will be used to hold our points Point_set points; // Load points from a file. std::ifstream stream((argc > 1) ? argv[1] : CGAL::data_file_path("points_3/cube.pwn")); stream >> points; if (0 == points.number_of_points()) { std::cerr << "Error: cannot read file" << std::endl; return EXIT_FAILURE; } std::cout << "loaded " << points.number_of_points() << " points\n" << std::endl; // Create an octree from the points Octree octree(points, points.point_map()); // Build the octree with a small bucket size, using a more verbose method octree.refine(CGAL::Orthtrees::Maximum_depth_and_maximum_number_of_inliers(5, 10)); // Print out the tree std::cout << octree; return EXIT_SUCCESS; }