diff --git a/AABB_tree/include/CGAL/AABB_face_graph_triangle_primitive.h b/AABB_tree/include/CGAL/AABB_face_graph_triangle_primitive.h index aad31663753..c6f21af88fa 100644 --- a/AABB_tree/include/CGAL/AABB_face_graph_triangle_primitive.h +++ b/AABB_tree/include/CGAL/AABB_face_graph_triangle_primitive.h @@ -135,18 +135,18 @@ public: Constructs a primitive. */ template - AABB_face_graph_triangle_primitive(Iterator it, FaceGraph& graph, VertexPointPMap vppm) + AABB_face_graph_triangle_primitive(Iterator it, const FaceGraph& graph, VertexPointPMap vppm) : Base( Id_(*it), - Triangle_property_map(&graph,vppm), - Point_property_map(&graph,vppm) ) + Triangle_property_map(const_cast(&graph),vppm), + Point_property_map(const_cast(&graph),vppm) ) {} #ifndef DOXYGEN_RUNNING template - AABB_face_graph_triangle_primitive(Iterator it, FaceGraph& graph) + AABB_face_graph_triangle_primitive(Iterator it, const FaceGraph& graph) : Base( Id_(*it), - Triangle_property_map(&graph), - Point_property_map(&graph) ) + Triangle_property_map(const_cast(&graph)), + Point_property_map(const_cast(&graph)) ) {} #ifndef CGAL_NO_DEPRECATED_CODE // for backward compatibility with Polyhedron::facets_begin() @@ -171,9 +171,9 @@ public: /// \internal static typename Cstr_shared_data::Shared_data - construct_shared_data(FaceGraph& graph) + construct_shared_data(const FaceGraph& graph) { - return Cstr_shared_data::construct_shared_data(graph); + return Cstr_shared_data::construct_shared_data(const_cast(graph)); } }; diff --git a/AABB_tree/include/CGAL/AABB_halfedge_graph_segment_primitive.h b/AABB_tree/include/CGAL/AABB_halfedge_graph_segment_primitive.h index 1036c088000..000463376bb 100644 --- a/AABB_tree/include/CGAL/AABB_halfedge_graph_segment_primitive.h +++ b/AABB_tree/include/CGAL/AABB_halfedge_graph_segment_primitive.h @@ -121,18 +121,18 @@ public: is available with `vppm` set to `boost::get(vertex_point, graph)`. */ template - AABB_halfedge_graph_segment_primitive(Iterator it, HalfedgeGraph& graph, VertexPointPMap vppm) + AABB_halfedge_graph_segment_primitive(Iterator it, const HalfedgeGraph& graph, VertexPointPMap vppm) : Base( Id_(*it), - Segment_property_map(&graph, vppm), - Point_property_map(&graph, vppm) ) + Segment_property_map(const_cast(&graph), vppm), + Point_property_map(const_cast(&graph), vppm) ) {} #ifndef DOXYGEN_RUNNING template - AABB_halfedge_graph_segment_primitive(Iterator it, HalfedgeGraph& graph) + AABB_halfedge_graph_segment_primitive(Iterator it, const HalfedgeGraph& graph) : Base( Id_(*it), - Segment_property_map(&graph), - Point_property_map(&graph) ){} + Segment_property_map(const_cast(&graph)), + Point_property_map(const_cast(&graph)) ){} #endif /// \internal @@ -140,9 +140,9 @@ public: /// \internal static typename Cstr_shared_data::Shared_data - construct_shared_data(HalfedgeGraph& graph) + construct_shared_data(const HalfedgeGraph& graph) { - return Cstr_shared_data::construct_shared_data(graph); + return Cstr_shared_data::construct_shared_data(const_cast(graph)); } }; diff --git a/Intersections_3/test/Intersections_3/test_intersections_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_3.cpp index 2e3af429b25..28004cd5e78 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_3.cpp @@ -479,7 +479,7 @@ struct Test { std::cout << "Bbox - Triangle\n"; typedef CGAL::Polyhedron_3 Polyhedron; - typedef CGAL::AABB_face_graph_triangle_primitive Primitive; + typedef CGAL::AABB_face_graph_triangle_primitive Primitive; typedef CGAL::AABB_traits Traits; typedef CGAL::AABB_tree Tree;