#include #include #include #include #include #include #include #include #include #include #include #include #include typedef CGAL::Exact_predicates_inexact_constructions_kernel EPICK; typedef CGAL::Exact_predicates_exact_constructions_kernel EPECK; typedef CGAL::Regular_triangulation_vertex_base_3 Rvb; typedef CGAL::Fixed_alpha_shape_vertex_base_3 WFixed_Vb; typedef CGAL::Regular_triangulation_cell_base_3 Rcb; typedef CGAL::Fixed_alpha_shape_cell_base_3 WFixed_Cb; typedef CGAL::Triangulation_data_structure_3 WFixed_TDS; typedef CGAL::Regular_triangulation_3 WFixed_DT; typedef CGAL::Fixed_alpha_shape_3 WFixed_AS; typedef CGAL::Alpha_shape_vertex_base_3 WVb; typedef CGAL::Alpha_shape_cell_base_3 WCb; typedef CGAL::Triangulation_data_structure_3 WTDS; typedef CGAL::Regular_triangulation_3 WDT; typedef CGAL::Alpha_shape_3< WDT > WAS; typedef CGAL::Alpha_shape_vertex_base_3 WVb_f; typedef CGAL::Alpha_shape_cell_base_3 WCb_f; typedef CGAL::Triangulation_data_structure_3 WTDS_f; typedef CGAL::Regular_triangulation_3 WDT_f; typedef CGAL::Alpha_shape_3< WDT_f,CGAL::Tag_true > WAS_f; typedef CGAL::Regular_triangulation_vertex_base_3 ERvb; typedef CGAL::Alpha_shape_vertex_base_3 EVb; typedef CGAL::Regular_triangulation_cell_base_3 ERcb; typedef CGAL::Alpha_shape_cell_base_3 ECb; typedef CGAL::Triangulation_data_structure_3 ETDS; typedef CGAL::Regular_triangulation_3 EDT; typedef CGAL::Alpha_shape_3< EDT > EAS; template void fill_wp_lists(const char* file_path,std::list& Ls,double rw=0){ double x,y,z,r; std::ifstream input(file_path); while(input){ input >> x; if (!input) break; input >> y >> z >> r; Ls.push_back(Object(typename Object::Point(x,y,z),(r+rw)*(r+rw))); } } void make_one_run(const char* filename){ std::cout << "== testing with " << filename << " ==\n"; //read weighted points std::list lst; fill_wp_lists(filename,lst,1.4); CGAL::Timer time; //---Test weighted alpha shape //build regular triangulation time.start(); WFixed_DT T(lst.begin(),lst.end()); time.stop(); std::cout << "Building regular triangulation: " << time.time() << std::endl;; time.reset(); if (lst.size()!=T.number_of_vertices()) std::cout << lst.size()-T.number_of_vertices() << " hidden vertices.\n"; std::cout << "Build Fixed weighted alpha complex" << std::endl; time.start(); WFixed_AS wfixed_as(T); time.stop(); std::cout << "Fixed "<< time.time() << std::endl; time.reset(); //copy triangulation for family alpha-shape WDT T1; T1.set_infinite_vertex( T1.tds().copy_tds( wfixed_as.tds(), wfixed_as.infinite_vertex() ) ); std::cout << "Build family weighted alpha complex" << std::endl; time.start(); WAS w_as(T1,0,WAS::GENERAL); time.stop(); std::cout << "Family "<< time.time() << std::endl; time.reset(); //copy triangulation for family alpha-shape WDT_f T1f; T1f.set_infinite_vertex( T1f.tds().copy_tds(wfixed_as.tds(),wfixed_as.infinite_vertex()) ); std::cout << "Build family filtered weighted alpha complex" << std::endl; time.start(); WAS_f w_asf(T1f,0,WAS_f::GENERAL); time.stop(); std::cout << "Family filtered "<< time.time() << std::endl; time.reset(); std::list elst; fill_wp_lists(filename,elst,1.4); //recreate the triangulation time.start(); EDT edt(elst.begin(),elst.end()); time.stop(); std::cout << "Building exact regular triangulation: " << time.time() << std::endl;; time.reset(); std::cout << "Build exact family weighted alpha complex" << std::endl; time.start(); EAS ase(edt,0,EAS::GENERAL); time.stop(); std::cout << "Family exact "<< time.time() << std::endl; } int main(int argc, char** argv){ if (argc==1){ std::cerr << "Nothing was tested\n"; return EXIT_SUCCESS; } for (int i=1;i