From c9d4ab26df8b910d060ebfa679e6935c75cdf406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 14 Sep 2018 10:50:36 +0200 Subject: [PATCH] update signature to be consistent --- .../Concepts/ErrorMetricProxy.h | 2 +- .../vsa_isotropic_metric_example.cpp | 2 +- .../include/CGAL/VSA/L21_metric_plane_proxy.h | 6 +++--- .../include/CGAL/VSA/L2_metric_plane_proxy.h | 2 +- .../include/CGAL/Variational_shape_approximation.h | 14 +++++++------- .../Surface_mesh_approximation/vsa_metric_test.cpp | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/ErrorMetricProxy.h b/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/ErrorMetricProxy.h index 7b092da9df8..a183c59b95a 100644 --- a/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/ErrorMetricProxy.h +++ b/Surface_mesh_approximation/doc/Surface_mesh_approximation/Concepts/ErrorMetricProxy.h @@ -26,7 +26,7 @@ public: /// @{ /// Computes and returns fitting error from face f to proxy. - FT compute_error(const TriangleMesh &tm, const face_descriptor f, const Proxy &proxy) const; + FT compute_error(const face_descriptor f, const TriangleMesh &tm, const Proxy &proxy) const; /// Computes and returns fitted proxy from a range of faces. /// @tparam FaceRange a range of diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_isotropic_metric_example.cpp b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_isotropic_metric_example.cpp index bc37c6a6108..7c09ee6601b 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_isotropic_metric_example.cpp +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_isotropic_metric_example.cpp @@ -34,7 +34,7 @@ struct Compact_metric_point_proxy // compute and return error from a face to a proxy, // defined as the Euclidean distance between // the face center of mass and proxy point. - FT compute_error(const Polyhedron &tm, const Facet_handle &f, const Proxy &px) const { + FT compute_error(const Facet_handle &f, const Polyhedron &tm, const Proxy &px) const { (void)(tm); return FT(std::sqrt(CGAL::to_double( CGAL::squared_distance(center_pmap[f], px)))); diff --git a/Surface_mesh_approximation/include/CGAL/VSA/L21_metric_plane_proxy.h b/Surface_mesh_approximation/include/CGAL/VSA/L21_metric_plane_proxy.h index b10c946a3b1..69911a243fe 100644 --- a/Surface_mesh_approximation/include/CGAL/VSA/L21_metric_plane_proxy.h +++ b/Surface_mesh_approximation/include/CGAL/VSA/L21_metric_plane_proxy.h @@ -65,7 +65,7 @@ public: m_sum_functor = traits.construct_sum_of_vectors_3_object(); m_scale_functor = traits.construct_scaled_vector_3_object(); - // construct internal facet normal & area map + // construct internal face normal & area map BOOST_FOREACH(face_descriptor f, faces(tm)) { const halfedge_descriptor he = halfedge(f, tm); const Point_3 &p0 = vpmap[source(he, tm)]; @@ -78,13 +78,13 @@ public: /// @} /*! - * @brief computes the L2,1 error from a facet to a proxy. + * @brief computes the L2,1 error from a face to a proxy. * @param tm input triangle mesh * @param f face_descriptor of a face * @param px proxy * @return computed error */ - FT compute_error(const TriangleMesh &tm, const face_descriptor f, const Proxy &px) const { + FT compute_error(const face_descriptor f, const TriangleMesh &tm, const Proxy &px) const { (void)(tm); Vector_3 v = m_sum_functor(get(m_fnmap, f), m_scale_functor(px, FT(-1.0))); return get(m_famap, f) * m_scalar_product_functor(v, v); diff --git a/Surface_mesh_approximation/include/CGAL/VSA/L2_metric_plane_proxy.h b/Surface_mesh_approximation/include/CGAL/VSA/L2_metric_plane_proxy.h index 581b2e6a458..43b45d9680a 100644 --- a/Surface_mesh_approximation/include/CGAL/VSA/L2_metric_plane_proxy.h +++ b/Surface_mesh_approximation/include/CGAL/VSA/L2_metric_plane_proxy.h @@ -75,7 +75,7 @@ public: * @param px proxy * @return computed error */ - FT compute_error(const TriangleMesh &tm, const face_descriptor f, const Proxy &px) const { + FT compute_error(const face_descriptor f, const TriangleMesh &tm, const Proxy &px) const { (void)(tm); halfedge_descriptor he = halfedge(f, *m_tm); const Point_3 &p0 = m_vpmap[source(he, *m_tm)]; diff --git a/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h b/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h index 2037d4c15f9..7b7be2d0a4e 100644 --- a/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h +++ b/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h @@ -1200,7 +1200,7 @@ private: if (fadj != boost::graph_traits::null_face() && get(m_fproxy_map, fadj) == CGAL_VSA_INVALID_TAG) { face_pqueue.push(Face_to_integrate( - fadj, pxw_itr->idx, m_metric->compute_error(*m_ptm, fadj, pxw_itr->px))); + fadj, pxw_itr->idx, m_metric->compute_error(fadj, *m_ptm, pxw_itr->px))); } } } @@ -1214,7 +1214,7 @@ private: if (fadj != boost::graph_traits::null_face() && get(m_fproxy_map, fadj) == CGAL_VSA_INVALID_TAG) { face_pqueue.push(Face_to_integrate( - fadj, c.px, m_metric->compute_error(*m_ptm, fadj, m_proxies[c.px].px))); + fadj, c.px, m_metric->compute_error(fadj, *m_ptm, m_proxies[c.px].px))); } } } @@ -1290,7 +1290,7 @@ private: if (px_idx != px_worst || f == m_proxies[px_idx].seed) continue; - FT err = m_metric->compute_error(*m_ptm, f, m_proxies[px_idx].px); + FT err = m_metric->compute_error(f, *m_ptm, m_proxies[px_idx].px); if (first || max_error < err) { first = false; max_error = err; @@ -1325,10 +1325,10 @@ private: // find proxy seed and sum error face_descriptor seed = *px_patch.begin(); - FT err_min = m_metric->compute_error(*m_ptm, seed, px); + FT err_min = m_metric->compute_error(seed, *m_ptm, px); FT sum_error(0.0); BOOST_FOREACH(face_descriptor f, px_patch) { - const FT err = m_metric->compute_error(*m_ptm, f, px); + const FT err = m_metric->compute_error(f, *m_ptm, px); sum_error += err; if (err < err_min) { err_min = err; @@ -1362,13 +1362,13 @@ private: // fit proxy parameters std::vector fvec(1, f); const Proxy px = m_metric->fit_proxy(fvec, *m_ptm); - const FT err = m_metric->compute_error(*m_ptm, f, px); + const FT err = m_metric->compute_error(f, *m_ptm, px); // original proxy map should always be falid const std::size_t prev_px_idx = get(m_fproxy_map, f); CGAL_assertion(prev_px_idx != CGAL_VSA_INVALID_TAG); // update the proxy error and proxy map - m_proxies[prev_px_idx].err -= m_metric->compute_error(*m_ptm, f, m_proxies[prev_px_idx].px); + m_proxies[prev_px_idx].err -= m_metric->compute_error(f, *m_ptm, m_proxies[prev_px_idx].px); put(m_fproxy_map, f, px_idx); return Proxy_wrapper(px, px_idx, f, err); diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp index 80ebedc020d..0b27713f465 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp @@ -34,7 +34,7 @@ struct Compact_metric_point_proxy { // compute and return error from a face to a proxy, // defined as the Euclidean distance between // the face center of mass and proxy point. - FT compute_error(const Polyhedron &tm, const Facet_handle &f, const Proxy &px) const { + FT compute_error(const Facet_handle &f, const Polyhedron &tm, const Proxy &px) const { (void)(tm); return FT(std::sqrt(CGAL::to_double( CGAL::squared_distance(center_pmap[f], px))));