#include <CGAL/Simple_cartesian.h>
#include <CGAL/Kd_tree.h>
#include <CGAL/point_generators_2.h>
#include <CGAL/algorithm.h>
#include <CGAL/Fuzzy_sphere.h>
#include <CGAL/Search_traits_2.h>
typedef K::Point_2 Point_d;
typedef CGAL::Random_points_in_square_2<Point_d> Random_points_iterator;
int main()
{
const int N = 30;
Tree tree;
Random_points_iterator rpg;
for(int i = 0; i < N; i++)
Point_d center(0., 0.);
Fuzzy_circle default_range(center, 0.5);
std::list<Point_d> result;
tree.search(std::back_inserter( result ), default_range);
std::cout << "The points in the fuzzy circle centered at (0., 0.) ";
std::cout << "with fuzzy radius (0.5, 0.5) are: " << std::endl;
std::copy (result.begin(),result.end(),std::ostream_iterator<Point_d>(std::cout,"\n") );
std::cout << std::endl;
std::cout << "The points in the fuzzy circle centered at (0., 0.) ";
std::cout << "with fuzzy radius (0.1, 0.9) are: " << std::endl;
Fuzzy_circle approximate_range(center, 0.5, 0.4);
tree.search(std::ostream_iterator<Point_d>(std::cout,"\n"), approximate_range);
return 0;
}
The class Fuzzy_sphere implements fuzzy d-dimensional spheres.
Definition: Fuzzy_sphere.h:26
The class Kd_tree defines a k-d tree.
Definition: Kd_tree.h:39
void insert(Point_d p)
Inserts the point p in the k-d tree.
The class Search_traits_2 can be used as a template parameter of the kd tree and the search classes.
Definition: Search_traits_2.h:20