diff --git a/Convex_hull_3/include/CGAL/Convex_hull_traits_3.h b/Convex_hull_3/include/CGAL/Convex_hull_traits_3.h index c115507f45c..e916559a651 100644 --- a/Convex_hull_3/include/CGAL/Convex_hull_traits_3.h +++ b/Convex_hull_3/include/CGAL/Convex_hull_traits_3.h @@ -29,6 +29,7 @@ #include #include #include +#include namespace CGAL { template < class R_ > @@ -185,7 +186,7 @@ struct Convex_hull_traits_base_3{ }; - template , class Has_filtered_predicates_tag = Tag_false> + template class Convex_hull_traits_3 : public Convex_hull_traits_base_3 { @@ -198,7 +199,7 @@ class Convex_hull_traits_3 : typedef Point_triple Plane_3; typedef typename R::Vector_3 Vector_3; - typedef Polyhedron Polyhedron_3; + typedef typename Default::Get >::type Polyhedron_3; typedef typename R::Construct_segment_3 Construct_segment_3; typedef typename R::Construct_ray_3 Construct_ray_3; diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index c70a95f2400..69dc15d145a 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -71,7 +71,7 @@ struct Default_traits_for_Chull_3{ //FT is a floating point type and Kernel is a filtered kernel template struct Default_traits_for_Chull_3{ - typedef Convex_hull_traits_3< typename Kernel_traits::Kernel, Tag_true > type; + typedef Convex_hull_traits_3< typename Kernel_traits::Kernel, Default, Tag_true > type; }; template @@ -79,9 +79,9 @@ struct Default_polyhedron_for_Chull_3{ typedef CGAL::Polyhedron_3 type; }; -template -struct Default_polyhedron_for_Chull_3 >{ - typedef typename Convex_hull_traits_3::Polyhedron_3 type; +template +struct Default_polyhedron_for_Chull_3 >{ + typedef typename Convex_hull_traits_3::Polyhedron_3 type; }; //utility class to select the right version of internal predicate Is_on_positive_side_of_plane_3 @@ -130,11 +130,11 @@ public: //The main operator() first tries the static version of the predicate, then uses //interval arithmetic (the protector must be created before using this predicate) //and in case of failure, exact arithmetic is used. -template -class Is_on_positive_side_of_plane_3,Tag_true>{ - typedef Simple_cartesian::Type> PK; +template +class Is_on_positive_side_of_plane_3,Tag_true>{ + typedef Simple_cartesian::Type> PK; typedef Simple_cartesian CK; - typedef Convex_hull_traits_3 Traits; + typedef Convex_hull_traits_3 Traits; typedef typename Traits::Point_3 Point_3; Cartesian_converter to_CK; @@ -616,6 +616,7 @@ ch_quickhull_polyhedron_3(std::list& points, typedef Triangulation_data_structure_2< Triangulation_vertex_base_with_info_2 >, Convex_hull_face_base_2 > Tds; + typedef typename Tds::Vertex_handle Vertex_handle; typedef typename Tds::Face_handle Face_handle; @@ -685,6 +686,7 @@ ch_quickhull_polyhedron_3(std::list& points, } } //namespace internal::Convex_hull_3 + template void convex_hull_3(InputIterator first, InputIterator beyond, @@ -768,7 +770,8 @@ convex_hull_3(InputIterator first, InputIterator beyond, } // result will be a polyhedron - typename internal::Convex_hull_3::Default_polyhedron_for_Chull_3::type P; + typedef typename internal::Convex_hull_3::Default_polyhedron_for_Chull_3::type Polyhedron; + Polyhedron P; P3_iterator minx, maxx, miny, it; minx = maxx = miny = it = points.begin(); @@ -783,14 +786,18 @@ convex_hull_3(InputIterator first, InputIterator beyond, } else { internal::Convex_hull_3::ch_quickhull_polyhedron_3(points, point1_it, point2_it, point3_it, P, traits); } - CGAL_assertion(P.size_of_vertices()>=3); - if (boost::next(P.vertices_begin(),3) == P.vertices_end()){ + CGAL_assertion(num_vertices(P)>=3); + boost::graph_traits::halfedge_iterator b,e; + boost::tie(b,e) = halfedges(P); + if (boost::next(b,3) == e){ + typename boost::property_map::type vpmap = get(CGAL::vertex_point, P); typedef typename Traits::Triangle_3 Triangle_3; typename Traits::Construct_triangle_3 construct_triangle = traits.construct_triangle_3_object(); - Triangle_3 tri = construct_triangle(P.halfedges_begin()->vertex()->point(), - P.halfedges_begin()->next()->vertex()->point(), - P.halfedges_begin()->opposite()->vertex()->point()); + + Triangle_3 tri = construct_triangle(get(vpmap, target(*b,P)), + get(vpmap, target(next(*b,P),P)), + get(vpmap, target(opposite(*b,P),P))); ch_object = make_object(tri); } else diff --git a/Convex_hull_3/include/CGAL/convexity_check_3.h b/Convex_hull_3/include/CGAL/convexity_check_3.h index a4ea10f0951..6dccc4f1c38 100644 --- a/Convex_hull_3/include/CGAL/convexity_check_3.h +++ b/Convex_hull_3/include/CGAL/convexity_check_3.h @@ -87,7 +87,10 @@ bool is_strongly_convex_3(const Polyhedron& P, const Traits& traits) typename boost::property_map::const_type vpmap = get(CGAL::vertex_point, P); - if (P.vertices_begin() == P.vertices_end()) return false; + vertex_iterator v_it, v_it_e; + boost::tie(v_it, v_it_e) = vertices(P); + + if (v_it == v_it_e) return false; BOOST_FOREACH(face_descriptor fd , faces(P)) if (!is_locally_convex(P, vpmap, fd, traits)) @@ -98,9 +101,6 @@ bool is_strongly_convex_3(const Polyhedron& P, const Traits& traits) typename Traits::Coplanar_3 coplanar = traits.coplanar_3_object(); - vertex_iterator v_it, v_it_e; - boost::tie(v_it, v_it_e) = vertices(P); - face_iterator f_it, f_it_e; boost::tie(f_it, f_it_e) = faces(P); Point_3 p; diff --git a/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp b/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp index 6a776bba4c7..2b30ca6857e 100644 --- a/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp +++ b/Convex_hull_3/test/Convex_hull_3/quick_hull_default_traits.cpp @@ -25,7 +25,7 @@ int main() CGAL_static_assertion( (boost::is_same::type>::value) ); CGAL_static_assertion( (boost::is_same::type>::value) ); CGAL_static_assertion( (boost::is_same::type>::value) ); - CGAL_static_assertion( (boost::is_same,Default_traits_for_Chull_3::type>::value) ); - CGAL_static_assertion( (boost::is_same >::Protector,CGAL::Protect_FPU_rounding >::value) ); + CGAL_static_assertion( (boost::is_same,Default_traits_for_Chull_3::type>::value) ); + CGAL_static_assertion( (boost::is_same >::Protector,CGAL::Protect_FPU_rounding >::value) ); return 0; } diff --git a/Convex_hull_3/test/Convex_hull_3/quickhull_degenerate_test_3.cpp b/Convex_hull_3/test/Convex_hull_3/quickhull_degenerate_test_3.cpp index 1ace68497a6..9c96fc1a724 100644 --- a/Convex_hull_3/test/Convex_hull_3/quickhull_degenerate_test_3.cpp +++ b/Convex_hull_3/test/Convex_hull_3/quickhull_degenerate_test_3.cpp @@ -151,6 +151,9 @@ void test_collinear() } +#include + + int main() { std::vector points; diff --git a/Hash_map/include/CGAL/Handle_hash_function.h b/Hash_map/include/CGAL/Handle_hash_function.h index 61a1790390b..25f33979a7e 100644 --- a/Hash_map/include/CGAL/Handle_hash_function.h +++ b/Hash_map/include/CGAL/Handle_hash_function.h @@ -31,6 +31,7 @@ namespace CGAL { + //mechanism to abuse Handle_hash_function which is the default //template parameter of Unique_hash_map namespace internal{ diff --git a/Triangulation_3/include/CGAL/star_to_face_graph.h b/Triangulation_3/include/CGAL/star_to_face_graph.h index 2980017b6f4..a4272b01986 100644 --- a/Triangulation_3/include/CGAL/star_to_face_graph.h +++ b/Triangulation_3/include/CGAL/star_to_face_graph.h @@ -32,7 +32,7 @@ namespace CGAL { template -typename boost::graph_trait::vertex_descriptor +typename boost::graph_traits::vertex_descriptor star_to_face_graph(const Triangulation_3& t, typename Triangulation_3::Vertex_handle vh, FG& fg,