fix compilation error

This commit is contained in:
Lingjie Zhu 2018-03-24 11:37:42 +08:00
parent b9be820b74
commit f679888c7e
8 changed files with 37 additions and 40 deletions

View File

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

View File

@ -13,7 +13,7 @@
#include <list>
namespace CGAL {
namespace VSA {
namespace VSA {
/// \ingroup PkgTSMA
/// @brief Approximation L2 metric.

View File

@ -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<TriangleMesh>::%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<TriangleMesh>::%face_descriptor` as value type
* @param px_idx proxy index
* @param out_itr output iterator
* @param out output iterator
*/
template <typename OutputIterator>
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 <typename OutputIterator>
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 <typename OutputIterator>
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 <typename OutputIterator>
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 <typename OutputIterator>
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<std::size_t> as value type
*/
template <typename OutputIterator>
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<std::size_t> 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

View File

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

View File

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

View File

@ -7,7 +7,7 @@
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/VSA_approximation.h>
#include <CGAL/L2_metric.h>
#include <CGAL/L2_metric_plane_proxy.h>
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<std::map<Facet_handle, std::size_t> > Facet_proxy_map;
typedef boost::property_map<Polyhedron, boost::vertex_point_t>::type Vertex_point_map;
typedef CGAL::L2_metric<Polyhedron> L2_metric;
typedef CGAL::VSA_approximation<Polyhedron, Vertex_point_map, L2_metric> L2_approx;
typedef CGAL::VSA::L2_metric_plane_proxy<Polyhedron> L2_metric_plane_proxy;
typedef CGAL::VSA_approximation<Polyhedron, Vertex_point_map, L2_metric_plane_proxy> 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<Polyhedron &>(mesh)));
L2_metric error_metric(mesh,
L2_metric_plane_proxy error_metric(mesh,
get(boost::vertex_point, const_cast<Polyhedron &>(mesh)));
approx.set_metric(error_metric);

View File

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

View File

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