diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_no_id.cpp b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_no_id.cpp index ec93ca54a56..fe9489bfb9d 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_no_id.cpp +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_no_id.cpp @@ -11,16 +11,16 @@ #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef CGAL::Polyhedron_3 Triangle_mesh; -typedef CGAL::Surface_mesh_shortest_path_traits Traits; +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef CGAL::Polyhedron_3 Triangle_mesh; +typedef CGAL::Surface_mesh_shortest_path_traits Traits; // default property maps typedef boost::property_map::type Vertex_index_map; + boost::vertex_external_index_t>::const_type Vertex_index_map; typedef boost::property_map::type Halfedge_index_map; + CGAL::halfedge_external_index_t>::const_type Halfedge_index_map; typedef boost::property_map::type Face_index_map; + CGAL::face_external_index_t>::const_type Face_index_map; typedef CGAL::Surface_mesh_shortest_path::%type`. + The default is `boost::property_map::%const_type`. \tparam HIM a model of `ReadablePropertyMap` with `halfedge_descriptor` as key and `unsigned int` as value type. - The default is `boost::property_map::%type`. + The default is `boost::property_map::%const_type`. \tparam FIM a model of `ReadablePropertyMap` with `face_descriptor` as key and `unsigned int` as value type. - The default is `boost::property_map::%type`. + The default is `boost::property_map::%const_type`. \tparam VPM a model of `ReadablePropertyMap` with `vertex_descriptor` as key and `Traits::Point_3` as value type. - The default is `boost::property_map::%type`. + The default is `boost::property_map::%const_type`. + +If index property maps are not provided through the constructor of the class, internal property maps must +be available and initialized. + +\sa \link PkgBGLHelper `CGAL::set_halfedgeds_items_id()`\endlink */ template::type + typename boost::property_map::const_type >::type Vertex_index_map; typedef typename Default::Get< HIM, - typename boost::property_map::type + typename boost::property_map::const_type >::type Halfedge_index_map; typedef typename Default::Get< FIM, - typename boost::property_map::type + typename boost::property_map::const_type >::type Face_index_map; typedef typename Default::Get< VPM, - typename boost::property_map::type + typename boost::property_map::const_type >::type Vertex_point_map; #else @@ -336,7 +341,7 @@ private: private: const Traits& m_traits; - Triangle_mesh& m_graph; + const Triangle_mesh& m_graph; Vertex_index_map m_vertexIndexMap; Halfedge_index_map m_halfedgeIndexMap; @@ -2196,11 +2201,15 @@ public: Equivalent to `Surface_mesh_shortest_path(tm, get(boost::vertex_index, tm), get(boost::halfedge_index, tm), get(boost::face_index, tm), get(CGAL::vertex_point, tm), traits)`. + + Internal property maps must be available and initialized. + + \sa \link PkgBGLHelper `CGAL::set_halfedgeds_items_id()`\endlink */ - Surface_mesh_shortest_path(Triangle_mesh& tm, + Surface_mesh_shortest_path(const Triangle_mesh& tm, const Traits& traits = Traits()) : m_traits(traits) - , m_graph(const_cast(tm)) + , m_graph(tm) , m_vertexIndexMap(get(boost::vertex_index, tm)) , m_halfedgeIndexMap(get(boost::halfedge_index, tm)) , m_faceIndexMap(get(boost::face_index, tm)) @@ -2234,7 +2243,7 @@ public: Vertex_point_map vertexPointMap, const Traits& traits = Traits()) : m_traits(traits) - , m_graph(const_cast(tm)) + , m_graph(tm) , m_vertexIndexMap(vertexIndexMap) , m_halfedgeIndexMap(halfedgeIndexMap) , m_faceIndexMap(faceIndexMap) diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_1.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_1.cpp index d952707649d..f420e43c1a3 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_1.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_1.cpp @@ -98,7 +98,7 @@ void test_simple_saddle_vertex_mesh() typedef Graph_traits::halfedge_descriptor halfedge_descriptor; typedef Graph_traits::face_descriptor face_descriptor; typedef CGAL::Surface_mesh_shortest_path Surface_mesh_shortest_path; - typedef boost::property_map::type VPM; + typedef boost::property_map::const_type VPM; Traits traits; @@ -197,7 +197,7 @@ void test_simple_saddle_vertex_mesh() collector.m_sequence.clear(); - typedef boost::property_map::type HalfedgeIndexMap; + typedef boost::property_map::const_type HalfedgeIndexMap; HalfedgeIndexMap halfedgeIndexMap(CGAL::get(CGAL::halfedge_external_index, P)); @@ -329,7 +329,7 @@ void test_boundary_mesh() typedef Graph_traits::face_descriptor face_descriptor; typedef Graph_traits::face_iterator face_iterator; typedef CGAL::Surface_mesh_shortest_path Surface_mesh_shortest_path; - typedef boost::property_map::type VPM; + typedef boost::property_map::const_type VPM; Traits traits; @@ -398,7 +398,7 @@ void test_boundary_mesh() Barycentric_coordinates startLocation = construct_barycentric_coordinates(FT(0.1), FT(0.8), FT(0.1)); - typedef boost::property_map::type FaceIndexMap; + typedef boost::property_map::const_type FaceIndexMap; FaceIndexMap faceIndexMap(CGAL::get(CGAL::face_external_index, P)); @@ -462,6 +462,6 @@ int main() shortest_path_regular_tetrahedron(); test_simple_saddle_vertex_mesh(); test_boundary_mesh(); - + return 0; } diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_2.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_2.cpp index 5a895e77fc4..06be126c91a 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_2.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_2.cpp @@ -37,9 +37,9 @@ int main(int argc, char* argv[]) typedef Graph_traits::face_descriptor face_descriptor; typedef Graph_traits::face_iterator face_iterator; typedef CGAL::Surface_mesh_shortest_path Surface_mesh_shortest_path; - typedef boost::property_map::type VIM; - typedef boost::property_map::type HIM; - typedef boost::property_map::type FIM; + typedef boost::property_map::const_type VIM; + typedef boost::property_map::const_type HIM; + typedef boost::property_map::const_type FIM; diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_3.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_3.cpp index 31f5198322a..d9884ccb384 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_3.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_3.cpp @@ -35,8 +35,8 @@ int main(int argc, char* argv[]) typedef Graph_traits::face_descriptor face_descriptor; typedef Graph_traits::face_iterator face_iterator; typedef CGAL::Surface_mesh_shortest_path Surface_mesh_shortest_path; - typedef boost::property_map::type VPM; - typedef boost::property_map::type FIM; + typedef boost::property_map::const_type VPM; + typedef boost::property_map::const_type FIM; typedef CGAL::AABB_face_graph_triangle_primitive AABB_face_graph_primitive; typedef CGAL::AABB_traits AABB_face_graph_traits; diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_4.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_4.cpp index 3c57487983c..9593de4bc43 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_4.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_4.cpp @@ -38,8 +38,8 @@ int main(int argc, char* argv[]) typedef Graph_traits::face_descriptor face_descriptor; typedef Graph_traits::face_iterator face_iterator; typedef CGAL::Surface_mesh_shortest_path Surface_mesh_shortest_path; - typedef boost::property_map::type VPM; - typedef boost::property_map::type FIM; + typedef boost::property_map::const_type VPM; + typedef boost::property_map::const_type FIM; typedef CGAL::AABB_face_graph_triangle_primitive AABB_face_graph_primitive; typedef CGAL::AABB_traits AABB_face_graph_traits; @@ -83,8 +83,8 @@ int main(int argc, char* argv[]) size_t numTrials = 30; - typedef boost::property_map::type VPM ; - typedef boost::property_map::type FIM; + typedef boost::property_map::const_type VPM ; + typedef boost::property_map::const_type FIM; FIM faceIndexMap(get(boost::face_index, polyhedron)); VPM vertexPointMap(get(CGAL::vertex_point, polyhedron)); diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_5.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_5.cpp index fac75436061..ee5d2f15c81 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_5.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_5.cpp @@ -35,9 +35,9 @@ int main(int argc, char* argv[]) typedef Graph_traits::face_iterator face_iterator; typedef CGAL::Surface_mesh_shortest_path Surface_mesh_shortest_path; typedef Surface_mesh_shortest_path::Face_location Face_location; - typedef boost::property_map::type VIM; - typedef boost::property_map::type HIM; - typedef boost::property_map::type FIM; + typedef boost::property_map::const_type VIM; + typedef boost::property_map::const_type HIM; + typedef boost::property_map::const_type FIM; Traits traits; diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/TestMesh.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/TestMesh.cpp index 89f57b80826..674cf9f7562 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/TestMesh.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/TestMesh.cpp @@ -61,11 +61,11 @@ struct TestMeshProgramInstance typedef typename Graph_traits::face_iterator face_iterator; typedef CGAL::Surface_mesh_shortest_path Surface_mesh_shortest_path; typedef typename Surface_mesh_shortest_path::Face_location Face_location; - typedef typename boost::property_map::type VPM; - typedef typename boost::property_map::type VIM; - typedef typename boost::property_map::type EIM; - typedef typename boost::property_map::type HIM; - typedef typename boost::property_map::type FIM; + typedef typename boost::property_map::const_type VPM; + typedef typename boost::property_map::const_type VIM; + typedef typename boost::property_map::const_type EIM; + typedef typename boost::property_map::const_type HIM; + typedef typename boost::property_map::const_type FIM; TestMeshProgramInstance() { diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/include/CGAL/test_util.h b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/include/CGAL/test_util.h index 6255de9e733..55d9234e4a4 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/include/CGAL/test_util.h +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/include/CGAL/test_util.h @@ -41,9 +41,9 @@ struct Sequence_item }; template ::type, - class HIM = typename boost::property_map::type, - class FIM = typename boost::property_map::type> + class VIM = typename boost::property_map::const_type, + class HIM = typename boost::property_map::const_type, + class FIM = typename boost::property_map::const_type> struct Edge_sequence_collector { typedef typename Traits::Triangle_mesh Triangle_mesh;