diff --git a/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h b/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h index 2d0840d7552..8c3f9ea3358 100644 --- a/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h +++ b/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h @@ -313,59 +313,8 @@ public: CGAL::internal::remove_property(m_fproxy_map, *(const_cast(m_ptm))); } } - - /// \name Setup - /// @{ - /*! - * @brief Sets the mesh for approximation and rebuilds the internal data structure. - * @pre @a tm.is_pure_triangle() - * @param tm `CGAL TriangleMesh` on which approximation operates. - * @param vpoint_map vertex point map of the mesh. - */ - void set_mesh(const TriangleMesh &tm, const VertexPointMap &vpoint_map) { - m_ptm = &tm; - m_vpoint_map = vpoint_map; - rebuild(); - } - /*! - * @brief Sets the approximation traits. - * @param error_metric an `ErrorMetricProxy` object. - */ - void set_metric(const Error_metric &error_metric) { - m_metric = &error_metric; - } - - /*! - * @brief Rebuilds the internal data structure. - */ - void rebuild() { - // cleanup - m_proxies.clear(); - m_px_planes.clear(); - m_anchors.clear(); - m_bcycles.clear(); - m_tris.clear(); - - if (!m_ptm) - return; - - // rebuild internal data structure - CGAL::internal::remove_property(m_fproxy_map, *m_ptm); - m_fproxy_map = CGAL::internal::add_property( - Face_proxy_tag("VSA-face_proxy"), *(const_cast(m_ptm))); - BOOST_FOREACH(face_descriptor f, faces(*m_ptm)) - put(m_fproxy_map, f, CGAL_VSA_INVALID_TAG); - - CGAL::internal::remove_property(m_vanchor_map, *m_ptm); - m_vanchor_map = CGAL::internal::add_property( - Vertex_anchor_tag("VSA-vertex_anchor"), *(const_cast(m_ptm))); - BOOST_FOREACH(vertex_descriptor v, vertices(*m_ptm)) - put(m_vanchor_map, v, CGAL_VSA_INVALID_TAG); - } - /// @} - - /// \name Processing + /// \name Approximation /// @{ /*! * @brief Initializes the seeds with both maximum number of proxies 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 62ea674b649..bd824aa252a 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 @@ -119,18 +119,12 @@ int main() const FT drop(0.001); const std::size_t iterations = 5; - std::cout << "rebuild and hierarchical seeding" << std::endl; - approx.rebuild(); - if (approx.proxies_size() != 0) - return EXIT_FAILURE; + std::cout << "re-initialize and hierarchical seeding" << std::endl; approx.initialize_seeds(CGAL::VSA::Hierarchical, boost::none, drop, iterations); approx.run(10); std::cout << "#proxies " << approx.proxies_size() << std::endl; - std::cout << "rebuild and incremental seeding" << std::endl; - approx.rebuild(); - if (approx.proxies_size() != 0) - return EXIT_FAILURE; + std::cout << "re-initialize and incremental seeding" << std::endl; approx.initialize_seeds(CGAL::VSA::Incremental, boost::none, drop, iterations); approx.run(10); std::cout << "#proxies " << approx.proxies_size() << std::endl;