diff --git a/Surface_mesh_approximation/include/CGAL/vsa_mesh_approximation.h b/Surface_mesh_approximation/include/CGAL/vsa_mesh_approximation.h index e4745e06adf..2c2aa7f1e8e 100644 --- a/Surface_mesh_approximation/include/CGAL/vsa_mesh_approximation.h +++ b/Surface_mesh_approximation/include/CGAL/vsa_mesh_approximation.h @@ -1,7 +1,7 @@ #ifndef CGAL_SURFACE_MESH_APPROXIMATION_VSA_MESH_APPROXIMATION_H #define CGAL_SURFACE_MESH_APPROXIMATION_VSA_MESH_APPROXIMATION_H -#include "VSA.h" +#include #include namespace CGAL @@ -10,22 +10,37 @@ namespace CGAL \ingroup PkgTSMA Main function */ -template ::type, - typename GeomTraits - = typename Kernel_traits::value>::Kernel> + typename PointPropertyMap, + typename AnchorIndexContainer, + typename AnchorPositionContainer, + typename AnchorVertexContainer, + typename BoundaryContainer, + typename GeomTraits> void vsa_mesh_approximation(const TriangleMesh &triangle_mesh, const std::size_t number_of_segments, + const std::size_t number_of_iterations, SegmentPropertyMap segment_ids, - FittingPropertyMap fit_error_map = FittingPropertyMap(), - PointPropertyMap ppmap = PointPropertyMap(), - GeomTraits traits = GeomTraits()) { - internal::VSA - algorithm(triangle_mesh, ppmap, traits); - algorithm.partition(number_of_segments, segment_ids); + PointPropertyMap ppmap, + AnchorIndexContainer &tris, + AnchorPositionContainer &pos, + AnchorVertexContainer &vtx, + BoundaryContainer &bdrs, + GeomTraits traits) { + typedef CGAL::internal::VSA VSA; + + VSA algorithm(triangle_mesh, ppmap, traits); + + algorithm.partition(number_of_segments, number_of_iterations, segment_ids); + + algorithm.extract_mesh(segment_ids, tris); + BOOST_FOREACH(const typename VSA::Anchor &a, algorithm.collect_anchors()) { + vtx.push_back(a.vtx); + pos.push_back(a.pos); + } + + bdrs = algorithm.collect_borders(segment_ids); } }