#include #include //#include #include #include #include #include #include //#include #include #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Delaunay_triangulation_sphere_traits_2 Gt; //typedef CGAL::Projection_sphere_traits_3 Gt; typedef CGAL::Delaunay_triangulation_sphere_2 RTOS; typedef RTOS::Vertex_handle Vertex_handle; typedef RTOS::Face_handle Face_handle; typedef RTOS::Point Point; typedef RTOS::All_faces_iterator Face_iterator; typedef RTOS::All_vertices_iterator Vertex_iterator; typedef RTOS::Solid_faces_iterator Solid_faces_iterator; typedef RTOS::Locate_type Locate_type; typedef RTOS::Edge Edge; bool has_face(Face_handle fh, Vertex_handle v0, Vertex_handle v1, Vertex_handle v2){ bool test1, test2, test3; for(int i=0;i<=2; i++){ test1 = (v0->point()==fh->vertex(i)->point()); if(test1) break; } if(!test1) return false; for(int i=0;i<=2; i++){ test2 = v1->point()==fh->vertex(i)->point(); if(test2) break; } if(!test2)return false; for(int i=0; i<=2; i++){ test3 = v2->point()==fh->vertex(i)->point(); if(test3)break; } if(!test3) return false; return true; } bool are_equal(RTOS triA, RTOS triB){ bool test = false; Face_iterator fiA; Face_iterator fiB; fiA = triA.all_faces_begin(); fiB = triB.all_faces_begin(); for( ; fiA != triA.all_faces_end(); ++fiA ){ //**face of fiA in fiB? for( ; fiB != triB.all_faces_end(); ++fiB ){ test = has_face(fiB, fiA->vertex(0), fiA->vertex(1), fiA->vertex(2)); if(has_face) break; } CGAL_assertion(has_face); //** } return true; } int main(){ int nu_of_pts; double radius; nu_of_pts =1000; radius=6000000; double minDist = radius * pow (2, -25); double minDist2 = pow(minDist, 2); int invalid = 0; CGAL::Timer t; CGAL::Random random(nu_of_pts); typedef CGAL::Creator_uniform_3 Creator; CGAL::Random_points_on_sphere_3 on_sphere(radius); RTOS rtos; RTOS rtos2; rtos.set_radius(radius); rtos2.set_radius(radius); std::vector points; std::vector vertices; vertices.reserve(nu_of_pts*2); /* for (int count=0; count vertices2; vertices2.reserve(nu_of_pts*2); for (int count=0; countis_ghost()); count ++; } std::cout<<"number of solid faces "<