From f679888c7ef3d410654759ee43d4acf7b78019e2 Mon Sep 17 00:00:00 2001 From: Lingjie Zhu Date: Sat, 24 Mar 2018 11:37:42 +0800 Subject: [PATCH] fix compilation error --- .../include/CGAL/L21_metric_plane_proxy.h | 4 +- .../include/CGAL/L2_metric_plane_proxy.h | 2 +- .../include/CGAL/VSA_approximation.h | 44 +++++++++---------- .../parameters_interface.h | 4 +- .../include/CGAL/mesh_approximation.h | 7 ++- .../vsa_class_interface_test.cpp | 8 ++-- .../vsa_kernel_test.cpp | 4 +- .../vsa_mesh_approximation_test.cpp | 4 +- 8 files changed, 37 insertions(+), 40 deletions(-) diff --git a/Surface_mesh_approximation/include/CGAL/L21_metric_plane_proxy.h b/Surface_mesh_approximation/include/CGAL/L21_metric_plane_proxy.h index ce0250e1be2..32f6a46474d 100644 --- a/Surface_mesh_approximation/include/CGAL/L21_metric_plane_proxy.h +++ b/Surface_mesh_approximation/include/CGAL/L21_metric_plane_proxy.h @@ -12,8 +12,8 @@ namespace CGAL { namespace VSA { - // TODO: remove unweighted version? or make separate metric if justified - // rename with vector instead of plane? as Proxy is a vector_3 + // TODO: remove unweighted version? or make separate metric if justified + // rename with vector instead of plane? as Proxy is a vector_3 /// \ingroup PkgTSMA diff --git a/Surface_mesh_approximation/include/CGAL/L2_metric_plane_proxy.h b/Surface_mesh_approximation/include/CGAL/L2_metric_plane_proxy.h index 5a1078f9d51..01046cb88e2 100644 --- a/Surface_mesh_approximation/include/CGAL/L2_metric_plane_proxy.h +++ b/Surface_mesh_approximation/include/CGAL/L2_metric_plane_proxy.h @@ -13,7 +13,7 @@ #include namespace CGAL { - namespace VSA { +namespace VSA { /// \ingroup PkgTSMA /// @brief Approximation L2 metric. diff --git a/Surface_mesh_approximation/include/CGAL/VSA_approximation.h b/Surface_mesh_approximation/include/CGAL/VSA_approximation.h index 056233b9f3c..cd02a4cfebb 100644 --- a/Surface_mesh_approximation/include/CGAL/VSA_approximation.h +++ b/Surface_mesh_approximation/include/CGAL/VSA_approximation.h @@ -862,10 +862,8 @@ public: /// \name Meshing /// @{ - /*! + /*! * @brief Extracts the output mesh in the form of an indexed triangle set. - * @note If the extracted surface mesh contains non-manifold facets, - * they are not built into the output polyhedron. * @param chord_error boundary approximation recursively split criterion * @param is_relative_to_chord set `true` if the chord_error is defined as a ratio of chord length, * and defined as ratio of average edge length otherwise. @@ -914,7 +912,7 @@ public: /// \name Output /// @{ - /*! + /*! * @brief Gets the facet-proxy index map. * @tparam FacetProxyMap `WritablePropertyMap` with * `boost::graph_traits::%face_descriptor` as key and `std::size_t` as value type @@ -930,7 +928,7 @@ public: * @brief Gets the facet region of the specified proxy. * @tparam OutputIterator output iterator with `boost::graph_traits::%face_descriptor` as value type * @param px_idx proxy index - * @param out_itr output iterator + * @param out output iterator */ template void proxy_region(const std::size_t px_idx, OutputIterator out) const { @@ -957,12 +955,12 @@ public: /*! * @brief Gets the wrapped proxies. * @tparam OutputIterator output iterator with Proxy_wrapper as value type - * @param out_itr output iterator + * @param out output iterator */ template - void wrapped_proxies(OutputIterator out_itr) const { + void wrapped_proxies(OutputIterator out) const { BOOST_FOREACH(const Proxy_wrapper &pxw, m_proxies) - *out_itr++ = pxw; + *out++ = pxw; } #endif @@ -975,35 +973,35 @@ public: /*! * @brief Gets the anchor points, which have the area-averaged position of the projected anchor vertex points on the incident proxies. * @tparam OutputIterator output iterator with Point_3 as value type - * @param out_itr output iterator + * @param out output iterator */ template - void anchor_points(OutputIterator out_itr) const { + void anchor_points(OutputIterator out) const { BOOST_FOREACH(const Anchor &a, m_anchors) - *out_itr++ = a.pos; + *out++ = a.pos; } /*! * @brief Gets the anchor vertices. * @tparam OutputIterator output iterator with vertex_descriptor as value type - * @param out_itr output iterator + * @param out output iterator */ template - void anchor_vertices(OutputIterator out_itr) const { + void anchor_vertices(OutputIterator out) const { BOOST_FOREACH(const Anchor &a, m_anchors) - *out_itr++ = a.vtx; + *out++ = a.vtx; } /*! * @brief Gets the indexed triangles, with * one triplet of integers per triangles, which refers to the anchor point indices. * @tparam OutputIterator output iterator with Indexed_triangle as value type - * @param out_itr output iterator + * @param out output iterator */ template - void indexed_triangles(OutputIterator out_itr) const { + void indexed_triangles(OutputIterator out) const { BOOST_FOREACH(const Indexed_triangle &t, m_tris) - *out_itr++ = t; + *out++ = t; } /*! @@ -1011,7 +1009,7 @@ public: * @tparam OutputIterator output iterator with std::vector as value type */ template - void indexed_boundary_polygons(OutputIterator out_itr) const { + void indexed_boundary_polygons(OutputIterator out) const { BOOST_FOREACH(const Boundary_cycle &bcycle, m_bcycles) { std::vector plg; halfedge_descriptor he = bcycle.he_head; @@ -1020,7 +1018,7 @@ public: walk_to_next_anchor(he, chord); plg.push_back(get(m_vanchor_map, target(he, *m_ptm))); } while (he != bcycle.he_head); - *out_itr++ = plg; + *out++ = plg; } } /// @} @@ -1091,8 +1089,8 @@ private: /*! * @brief Randomly initializes proxies - * with both maximum number of proxies and minimum error drop stop criteria, where - * the first criterion met stops the seeding. + * with both maximum number of proxies and minimum error drop stop criteria, + * where the first criterion met stops the seeding. * @note To ensure the randomness, call `std::srand()` beforehand. * @param max_nb_proxies maximum number of proxies, should be in range (nb_connected_components, num_faces(tm) / 3) * @param min_error_drop minimum error drop, should be in range (0.0, 1.0) @@ -1150,8 +1148,8 @@ private: /*! * @brief Hierarchically initializes proxies - * with both maximum number of proxies and minimum error drop stop criteria, where - * the first criterion met stops the seeding. + * with both maximum number of proxies and minimum error drop stop criteria, + * where the first criterion met stops the seeding. * @param max_nb_proxies maximum number of proxies, should be in range (nb_connected_components, num_faces(tm) / 3) * @param min_error_drop minimum error drop, should be in range (0.0, 1.0) * @param num_iterations number of re-fitting iterations diff --git a/Surface_mesh_approximation/include/CGAL/internal/Surface_mesh_approximation/parameters_interface.h b/Surface_mesh_approximation/include/CGAL/internal/Surface_mesh_approximation/parameters_interface.h index 1eb7db5917e..0e8b056b0e1 100644 --- a/Surface_mesh_approximation/include/CGAL/internal/Surface_mesh_approximation/parameters_interface.h +++ b/Surface_mesh_approximation/include/CGAL/internal/Surface_mesh_approximation/parameters_interface.h @@ -12,5 +12,5 @@ CGAL_add_named_parameter(mesh_chord_error_t, mesh_chord_error, mesh_chord_error) // output parameters CGAL_add_named_parameter(facet_proxy_map_t, facet_proxy_map, facet_proxy_map) CGAL_add_named_parameter(proxies_t, proxies, proxies) -CGAL_add_named_parameter(anchor_points_t, anchors, anchors) -CGAL_add_named_parameter(indexed_triangles_t, triangles, triangles) +CGAL_add_named_parameter(anchors_t, anchors, anchors) +CGAL_add_named_parameter(triangles_t, triangles, triangles) diff --git a/Surface_mesh_approximation/include/CGAL/mesh_approximation.h b/Surface_mesh_approximation/include/CGAL/mesh_approximation.h index f389a8a6b62..07d332388c5 100644 --- a/Surface_mesh_approximation/include/CGAL/mesh_approximation.h +++ b/Surface_mesh_approximation/include/CGAL/mesh_approximation.h @@ -102,7 +102,6 @@ bool mesh_approximation(const TriangleMesh &tm, const NamedParameters &np) approx.run(nb_of_iterations); - #ifdef CGAL_SURFACE_MESH_APPROXIMATION_DEBUG // TODO replace by verbose level? std::cout << "#px = " << approx.proxies_size() << ", #itr = " << nb_of_iterations @@ -116,7 +115,7 @@ bool mesh_approximation(const TriangleMesh &tm, const NamedParameters &np) internal_np::vsa_no_output_t>::type FPMap; FPMap fproxymap = choose_param( get_param(np, internal_np::facet_proxy_map), internal_np::vsa_no_output); - proxies(approx, fproxymap); + facet_proxy_map(approx, fproxymap); // get proxies typedef typename boost::lookup_named_param_def < @@ -133,7 +132,7 @@ bool mesh_approximation(const TriangleMesh &tm, const NamedParameters &np) // get anchor points typedef typename boost::lookup_named_param_def< - internal_np::anchor_points_t, + internal_np::anchors_t, NamedParameters, internal_np::vsa_no_output_t>::type Anchor_point_output_iterator; Anchor_point_output_iterator apts_out_itr = choose_param( @@ -142,7 +141,7 @@ bool mesh_approximation(const TriangleMesh &tm, const NamedParameters &np) // get indexed triangles typedef typename boost::lookup_named_param_def< - internal_np::indexed_triangles_t, + internal_np::triangles_t, NamedParameters, internal_np::vsa_no_output_t>::type Indexed_triangles_output_iterator; Indexed_triangles_output_iterator tris_out_itr = choose_param( diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_class_interface_test.cpp b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_class_interface_test.cpp index 558c778752f..9614744ed41 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_class_interface_test.cpp +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_class_interface_test.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::FT FT; @@ -18,8 +18,8 @@ typedef Polyhedron::Facet_handle Facet_handle; typedef boost::associative_property_map > Facet_proxy_map; typedef boost::property_map::type Vertex_point_map; -typedef CGAL::L2_metric L2_metric; -typedef CGAL::VSA_approximation L2_approx; +typedef CGAL::VSA::L2_metric_plane_proxy L2_metric_plane_proxy; +typedef CGAL::VSA_approximation L2_approx; typedef L2_approx::Proxy Plane_proxy; /** @@ -46,7 +46,7 @@ int main() std::cout << "setup algorithm instance" << std::endl; L2_approx approx(mesh, get(boost::vertex_point, const_cast(mesh))); - L2_metric error_metric(mesh, + L2_metric_plane_proxy error_metric(mesh, get(boost::vertex_point, const_cast(mesh))); approx.set_metric(error_metric); diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_kernel_test.cpp b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_kernel_test.cpp index 1b928b6c477..8bce729a743 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_kernel_test.cpp +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_kernel_test.cpp @@ -34,8 +34,8 @@ int test() { nb_of_iterations(30). nb_of_relaxations(5). mesh_chord_error(0.5). - anchor_points(std::back_inserter(points)). - indexed_triangles(std::back_inserter(triangles))); + anchors(std::back_inserter(points)). + triangles(std::back_inserter(triangles))); return EXIT_SUCCESS; } diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_mesh_approximation_test.cpp b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_mesh_approximation_test.cpp index c46d8704f5b..f77a2b47f9a 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_mesh_approximation_test.cpp +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_mesh_approximation_test.cpp @@ -37,8 +37,8 @@ int main() mesh_chord_error(0.5). facet_proxy_map(fpxmap). proxies(std::back_inserter(proxies)). - anchor_points(std::back_inserter(points)). - indexed_triangles(std::back_inserter(triangles))); + anchors(std::back_inserter(points)). + triangles(std::back_inserter(triangles))); std::cout << "#fpxmap " << fidxmap.size() << std::endl; std::cout << "#proxies " << proxies.size() << std::endl;