#include <CGAL/Simple_cartesian.h>
#include <CGAL/box_intersection_d.h>
#include <CGAL/point_generators_3.h>
#include <CGAL/algorithm.h>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cmath>
typedef CGAL::Random_points_on_sphere_3<Point_3> Points_on_sphere;
std::vector<Point_3> points;
std::vector<Point_3*> boxes;
const float eps = 0.1f;
struct Traits {
typedef float NT;
typedef Point_3* Box_parameter;
typedef std::ptrdiff_t ID;
static int dimension() { return 3; }
static float coord( Box_parameter b, int d) {
return (d == 0) ? b->x() : ((d == 1) ? b->y() : b->z());
}
static float min_coord( Box_parameter b, int d) { return coord(b,d)-eps;}
static float max_coord( Box_parameter b, int d) { return coord(b,d)+eps;}
static std::ptrdiff_t id(Box_parameter b) { return (std::ptrdiff_t)(b); }
};
void report( const Point_3* a, const Point_3* b) {
if ( dist < 2*eps) {
std::cout << "Point " << (a - &(points.front())) << " and Point "
<< (b - &(points.front())) << " have distance " << dist
<< "." << std::endl;
}
}
int main() {
Points_on_sphere generator( 1.0);
points.reserve( 50);
for ( int i = 0; i != 50; ++i) {
points.push_back( *generator++);
boxes.push_back( & points.back());
}
report, Traits());
return 0;
}