VSA example: simpler naming

This commit is contained in:
Pierre Alliez 2017-11-13 14:59:51 +01:00
parent 4bcb44f1d9
commit a11d1b5bf1
3 changed files with 14 additions and 8 deletions

View File

@ -12,9 +12,12 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef boost::property_map<Polyhedron, boost::vertex_point_t>::type VertexPointMap;
typedef CGAL::VSA_approximation<Polyhedron, VertexPointMap> L21VSA;
typedef L21VSA::ErrorMetric L21Metric;
typedef L21VSA::ProxyFitting L21ProxyFitting;
typedef CGAL::VSA_approximation<Polyhedron, VertexPointMap> 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<Polyhedron &>(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);

View File

@ -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;

View File

@ -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,