diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_class_interface_example.cpp b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_class_interface_example.cpp index 73892bc8057..cd56c31e8de 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_class_interface_example.cpp +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_class_interface_example.cpp @@ -12,9 +12,12 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Polyhedron_3 Polyhedron; typedef boost::property_map::type VertexPointMap; -typedef CGAL::VSA_approximation L21VSA; -typedef L21VSA::ErrorMetric L21Metric; -typedef L21VSA::ProxyFitting L21ProxyFitting; + +typedef CGAL::VSA_approximation VSA; + +// default L21 metric +typedef VSA::ErrorMetric L21_metric; +typedef VSA::ProxyFitting L21_proxy_fitting; int main() { @@ -26,7 +29,7 @@ int main() return EXIT_FAILURE; } - // create VSA L21 metric approximation algorithm instance + // create VSA approximation algorithm instance L21VSA l21_approx(input, get(boost::vertex_point, const_cast(input))); @@ -53,7 +56,7 @@ int main() for (std::size_t i = 0; i < 10; ++i) l21_approx.run_one_step(); - // extract the approximation polyhedron + // mesh and output final polyhedral surface Polyhedron output; l21_approx.meshing(output); diff --git a/Surface_mesh_approximation/include/CGAL/vsa_approximation.h b/Surface_mesh_approximation/include/CGAL/vsa_approximation.h index 46b11bb2a1d..359d4059b5b 100644 --- a/Surface_mesh_approximation/include/CGAL/vsa_approximation.h +++ b/Surface_mesh_approximation/include/CGAL/vsa_approximation.h @@ -286,7 +286,7 @@ public: /*! * Set the mesh for approximation and rebuild the internal data structure. * @pre @a _mesh.is_pure_triangle() - * @param _mesh `CGAL TriangleMesh` on which approximation operate. + * @param _mesh `CGAL TriangleMesh` on which approximation operates. * @param _point_pmap vertex point map of the mesh */ void set_mesh(const TriangleMesh &_mesh, const VertexPointMap &_point_pmap) { @@ -310,6 +310,8 @@ public: * Rebuild the internal data structure. */ void rebuild() { + + // cleanup proxies.clear(); px_planes.clear(); anchors.clear(); @@ -318,7 +320,8 @@ public: if (!m_pmesh) return; - // rebuild inter data structure + + // rebuild internal data structure internal_fidx_map.clear(); BOOST_FOREACH(face_descriptor f, faces(*m_pmesh)) internal_fidx_map[f] = 0; diff --git a/Surface_mesh_approximation/include/CGAL/vsa_mesh_approximation.h b/Surface_mesh_approximation/include/CGAL/vsa_mesh_approximation.h index 5f46155999f..a68d4c59de6 100644 --- a/Surface_mesh_approximation/include/CGAL/vsa_mesh_approximation.h +++ b/Surface_mesh_approximation/include/CGAL/vsa_mesh_approximation.h @@ -125,7 +125,7 @@ bool vsa_mesh_approximation(const TriangleMesh &tm_in, get_proxy_map(vsa_l21, fproxymap); FT split_criterion = choose_param(get_param(np, internal_np::chord_subdivide), FT(1)); - bool is_manifold = vsa_l21.meshing(tm_out, split_criterion); + const bool is_manifold = vsa_l21.meshing(tm_out, split_criterion); typedef typename boost::lookup_named_param_def< internal_np::anchor_vertex_t,