#include <CGAL/Cartesian_d.h>
#include <CGAL/point_generators_d.h>
#include <CGAL/Kd_tree.h>
#include <CGAL/Fuzzy_sphere.h>
#include <CGAL/Fuzzy_iso_box.h>
#include <CGAL/Search_traits_d.h>
typedef K::Point_d Point_d;
typedef CGAL::Random_points_in_cube_d<Point_d> Random_points_iterator;
int main() {
const int D = 4;
const int N = 1000;
Random_points_iterator rpit(4, 1000.0);
Tree tree(N_Random_points_iterator(rpit,0),
N_Random_points_iterator(rpit,N));
double pcoord[D] = { 300, 300, 300, 300 };
double qcoord[D] = { 900.0, 900.0, 900.0, 900.0 };
Point_d p(D, pcoord, pcoord+D);
Point_d q(D, qcoord, qcoord+D);
Fuzzy_sphere fs(p, 700.0, 100.0);
Fuzzy_iso_box fib(p, q, 100.0);
std::cout << "points approximately in fuzzy range query" << std::endl;
std::cout << "with center (300.0, 300.0, 300.0, 300.0)" << std::endl;
std::cout << "and fuzzy radius <200.0,400.0> are:" << std::endl;
tree.search(std::ostream_iterator<Point_d>(std::cout, "\n"), fs);
std::cout << "points approximately in fuzzy range query ";
std::cout << "[<200,4000>,<800,1000>]]^4 are:" << std::endl;
tree.search(std::ostream_iterator<Point_d>(std::cout, "\n"), fib);
return 0;
}