//#define CGAL_NO_STATIC_FILTERS #include #include #include #include #include #include #include #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::Delaunay_triangulation_sphere_2 RTOS; //typedef CGAL::Triangulation_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::Locate_type Locate_type; typedef RTOS::Edge Edge; typedef RTOS::Vertex_handle Vertex_handle; 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++){ std::cout<point()<vertex(i)->point()<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 argc, char* argv[]) { double radius = 100; double radius2 = radius*radius; typedef K::Point_3 Point_3; //DTOS_exact dtos; RTOS rtos; RTOS rtos2; RTOS rtos3; rtos.set_radius(radius); rtos2.set_radius(radius); rtos3.set_radius(radius); std::vector points; std::vector points2; std::vector points4; // insert and remove 5 coplanar points. Points are also coplanar with the center of the sphere Point_3 p1=Point_3(radius/sqrt(2), radius/sqrt(2), 0); Point_3 p2 = Point_3(-1*radius/sqrt(2), radius/sqrt(2), 0); Point_3 p3 = Point_3(-1*radius/sqrt(2), -1*radius/sqrt(2), 0); Point_3 p4 = Point_3(radius/sqrt(2), -1*radius/sqrt(2), 0); Point_3 p5 = Point_3(radius,0,0); Point_3 p6 = Point_3(0,0,radius); points.push_back(p1); points.push_back(p2); points.push_back(p3); points.push_back(p4); points.push_back(p5); points.push_back(p6); points.resize(5); Vertex_handle v1 = rtos.insert(p1); Vertex_handle v4 = rtos.insert(p4); Vertex_handle v2 = rtos.insert(p2); Vertex_handle v5 = rtos.insert(p5); Vertex_handle v3 = rtos.insert(p3); rtos.is_valid(); Vertex_handle v6 = rtos.insert(p6); rtos.is_valid(); std::random_shuffle(points.begin(), points.end()); for(int i=0; i<5; i++){ std::cout<