#include #include #include #include #include #include #include #include #include #include #if !defined(__BORLANDC__) && !defined(_MSC_VER) #ifdef CGAL_USE_LEDA #include typedef leda_integer RT; #else #ifdef CGAL_USE_GMP #include typedef CGAL::Gmpz RT; #else #include typedef double RT; #endif #endif typedef CGAL::Homogeneous_d Kernel; typedef CGAL::Convex_hull_d Convex_hull_d; typedef Convex_hull_d::Point_d Point_d; typedef Convex_hull_d::Simplex_handle Simplex_handle; template CGAL::Point_d random_point_in_range(int d,int l,int h, CGAL::Point_d) { std::vector V(d+1); V[d]=1; for(int i = 0; i(d,V.begin(),V.end()); } template void random_points_in_range(int n, int d,int l,int h, std::list< CGAL::Point_d >& L) { CGAL::Point_d dummy; for(int i = 0; i Kernel_3; typedef CGAL::Point_3 Point_3; typedef CGAL::Polyhedron_3 Polyhedron; int main(int argc, char* argv[]) { int dimension = 3; int n = 100; if (argc > 1 && std::string(argv[1])=="-h") { std::cout << "usage: chddemo [#points]\n"; exit(1); } if (argc > 1) n = atoi(argv[1]); int r = 2*n; CGAL::Geomview_stream gv(CGAL::Bbox_3(-r, -r, -r, r, r, r)); gv.clear(); Convex_hull_d T(dimension); std::list L; random_points_in_range(n,dimension,-n,n,L); int i(0); std::list::iterator it; for(it = L.begin(); it!=L.end(); ++it) { T.insert(*it); i++; if (i%10==0) std::cout << i << " points inserted" << std::endl; } T.is_valid(true); Polyhedron P; CGAL::convex_hull_d_to_polyhedron_3(T,P); gv << P; std::cout << "Enter a key to finish" << std::endl; char ch; std::cin >> ch; return 0; } #else int main() { std::cout << "Geomview is not supported on MS windows.\n"; return 0; } #endif