Skip to content

Commit c6c5405

Browse files
committed
changes after review 2
1 parent 553445a commit c6c5405

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ class GetGeomTraits<CGAL_PMP_NP_CLASS, NP>
5353

5454
namespace Polygon_mesh_processing {
5555

56-
namespace pmp_internal {
56+
namespace internal {
5757

5858
inline void rearrange_face_ids(boost::container::small_vector<std::size_t, 4>& ids)
5959
{
6060
auto min_elem = std::min_element(ids.begin(), ids.end());
6161
std::rotate(ids.begin(), min_elem, ids.end());
6262
}
63-
}//namespace pmp_internal
63+
}//namespace internal
6464
/**
6565
* \ingroup measure_grp
6666
* computes the length of an edge of a given polygon mesh.
@@ -906,6 +906,9 @@ void match_faces(const PolygonMesh1& m1, const PolygonMesh2& m2,
906906
get_const_property_map(vertex_point, m1));
907907
const VPMap2 vpm2 = choose_parameter(get_parameter(np2, internal_np::vertex_point),
908908
get_const_property_map(vertex_point, m2));
909+
CGAL_static_assertion_msg((boost::is_same<typename boost::property_traits<VPMap1>::value_type,
910+
typename boost::property_traits<VPMap2>::value_type>::value),
911+
"Both vertex point maps must have the same point type.");
909912

910913
const VIMap1 vim1 = get_initialized_vertex_index_map(m1, np1);
911914
const VIMap2 vim2 = get_initialized_vertex_index_map(m2, np2);
@@ -920,15 +923,15 @@ void match_faces(const PolygonMesh1& m1, const PolygonMesh2& m2,
920923
std::size_t id = 0;
921924
for(auto v : vertices(m1))
922925
{
923-
const Point_3& p = get(vpm1, v);
926+
const typename boost::property_traits<VPMap1>::reference p = get(vpm1, v);
924927
auto res = point_id_map.emplace(p, id);
925928
if(res.second)
926929
++id;
927930
m1_vertex_id[get(vim1, v)] = res.first->second;
928931
}
929932
for(auto v : vertices(m2))
930933
{
931-
const Point_3& p = get(vpm2, v);
934+
const typename boost::property_traits<VPMap2>::reference p = get(vpm2, v);
932935
auto res = point_id_map.emplace(p, id);
933936
if(res.second)
934937
++id;
@@ -955,7 +958,7 @@ void match_faces(const PolygonMesh1& m1, const PolygonMesh2& m2,
955958
}
956959
if(all_shared)
957960
{
958-
pmp_internal::rearrange_face_ids(ids);
961+
internal::rearrange_face_ids(ids);
959962
m1_faces_map.emplace(ids, f);
960963
}
961964
else
@@ -977,7 +980,7 @@ void match_faces(const PolygonMesh1& m1, const PolygonMesh2& m2,
977980
}
978981
if(all_shared)
979982
{
980-
pmp_internal::rearrange_face_ids(ids);
983+
internal::rearrange_face_ids(ids);
981984
auto it = m1_faces_map.find(ids);
982985
if(it != m1_faces_map.end())
983986
{

Polygon_mesh_processing/test/Polygon_mesh_processing/measures_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ int main(int argc, char* argv[])
362362
// It won't work with Epec for large meshes as it builds up a deep DAG
363363
// leading to a stackoverflow when the destructor is called.
364364
test_centroid<CGAL::Surface_mesh<Epic::Point_3>,Epic>(filename_surface_mesh);
365-
test_compare<CGAL::Polyhedron_3<Epic> >();
366-
test_compare<CGAL::Polyhedron_3<Epec> >();
365+
test_compare<CGAL::Polyhedron_3<Epic>, CGAL::Surface_mesh<Epic::Point_3> >();
366+
test_compare<CGAL::Polyhedron_3<Epec>, CGAL::Surface_mesh<Epec::Point_3> >();
367367
test_compare<CGAL::Surface_mesh<Epic::Point_3>, CGAL::Polyhedron_3<Epic> >();
368368
test_compare<CGAL::Surface_mesh<Epec::Point_3>, CGAL::Polyhedron_3<Epec> >();
369369
std::cerr << "All done." << std::endl;

0 commit comments

Comments
 (0)