From c4eea7fb164ec7db7f9d2cc3dc4e83c8356e9bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 4 Feb 2014 15:58:16 +0100 Subject: [PATCH] fix constructor overloads and document default for pmaps --- .../custom_weight_for_edges_example.cpp | 6 ++- Surface_modeling/include/CGAL/Deform_mesh.h | 52 +++++++++++-------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/Surface_modeling/examples/Surface_modeling/custom_weight_for_edges_example.cpp b/Surface_modeling/examples/Surface_modeling/custom_weight_for_edges_example.cpp index b1ebb828b0d..f552d962458 100644 --- a/Surface_modeling/examples/Surface_modeling/custom_weight_for_edges_example.cpp +++ b/Surface_modeling/examples/Surface_modeling/custom_weight_for_edges_example.cpp @@ -74,7 +74,11 @@ int main() for(boost::tie(eb, ee) = boost::edges(mesh); eb != ee; ++eb, ++counter) { put(edge_index_map, *eb, counter); } - Deform_mesh deform_mesh(mesh, vertex_index_map, edge_index_map, Weights_from_map(&weight_map)); + Deform_mesh deform_mesh(mesh, + vertex_index_map, + edge_index_map, + boost::get(CGAL::vertex_point, mesh), + Weights_from_map(&weight_map)); // Deform mesh as desired } diff --git a/Surface_modeling/include/CGAL/Deform_mesh.h b/Surface_modeling/include/CGAL/Deform_mesh.h index 794e7d12399..3bd569fa58b 100644 --- a/Surface_modeling/include/CGAL/Deform_mesh.h +++ b/Surface_modeling/include/CGAL/Deform_mesh.h @@ -260,8 +260,7 @@ public: //vertex_point_map set by default Deform_mesh(Halfedge_graph& halfedge_graph, Vertex_index_map vertex_index_map, - Edge_index_map edge_index_map, - Weight_calculator weight_calculator = Weight_calculator() + Edge_index_map edge_index_map ) : m_halfedge_graph(halfedge_graph), vertex_index_map(vertex_index_map), edge_index_map(edge_index_map), ros_id_map(std::vector(boost::num_vertices(halfedge_graph), (std::numeric_limits::max)() )), @@ -271,7 +270,7 @@ public: need_preprocess_factorization(true), need_preprocess_region_of_solution(true), last_preprocess_successful(false), - weight_calculator(weight_calculator), + weight_calculator(Weight_calculator()), vertex_point_map(boost::get(vertex_point, halfedge_graph)) { init(); @@ -279,8 +278,7 @@ public: //vertex_point_map and edge_index_map set by default Deform_mesh(Halfedge_graph& halfedge_graph, - Vertex_index_map vertex_index_map, - Weight_calculator weight_calculator = Weight_calculator() + Vertex_index_map vertex_index_map ) : m_halfedge_graph(halfedge_graph), vertex_index_map(vertex_index_map), edge_index_map(boost::get(boost::edge_index, halfedge_graph)), @@ -291,14 +289,13 @@ public: need_preprocess_factorization(true), need_preprocess_region_of_solution(true), last_preprocess_successful(false), - weight_calculator(weight_calculator), + weight_calculator(Weight_calculator()), vertex_point_map(boost::get(vertex_point, halfedge_graph)) { init(); } //vertex_point_map, edge_index_map and vertex_index_map set by default - Deform_mesh(Halfedge_graph& halfedge_graph, - Weight_calculator weight_calculator = Weight_calculator() + Deform_mesh(Halfedge_graph& halfedge_graph ) : m_halfedge_graph(halfedge_graph), vertex_index_map(boost::get(boost::vertex_index, halfedge_graph)), @@ -310,25 +307,13 @@ public: need_preprocess_factorization(true), need_preprocess_region_of_solution(true), last_preprocess_successful(false), - weight_calculator(weight_calculator), + weight_calculator(Weight_calculator()), vertex_point_map(boost::get(vertex_point, halfedge_graph)) { init(); } - /// \endcond -/// \name Construction -/// @{ - /** - * The constructor of a deformation object - * - * @pre the halfedge_graph consists of only triangular facets - * @param halfedge_graph triangulated surface mesh used to deform - * @param vertex_index_map property map for associating an id to each vertex, from `0` to `boost::num_vertices(halfedge_graph)-1`. - * @param edge_index_map property map for associating an id to each edge, from `0` to `boost::num_edges(halfedge_graph)-1`. - * @param vertex_point_map property map used to access the points associated to each vertex of the graph. - * @param weight_calculator function object or pointer for weight calculation - * \todo document the default inline using bgl default parameters - */ + + // Constructor with all the parameters provided Deform_mesh(Halfedge_graph& halfedge_graph, Vertex_index_map vertex_index_map, Edge_index_map edge_index_map, @@ -348,7 +333,28 @@ public: { init(); } + /// \endcond + #if DOXYGEN_RUNNING +/// \name Construction +/// @{ + /** + * The constructor of a deformation object + * + * @pre the halfedge_graph consists of only triangular facets + * @param halfedge_graph triangulated surface mesh used to deform + * @param vertex_index_map property map for associating an id to each vertex, from `0` to `boost::num_vertices(halfedge_graph)-1`. + * @param edge_index_map property map for associating an id to each edge, from `0` to `boost::num_edges(halfedge_graph)-1`. + * @param vertex_point_map property map used to access the points associated to each vertex of the graph. + * @param weight_calculator function object or pointer for weight calculation + */ + Deform_mesh(Halfedge_graph& halfedge_graph, + Vertex_index_map vertex_index_map=boost::get(boost::vertex_index, halfedge_graph), + Edge_index_map edge_index_map=boost::get(boost::edge_index, halfedge_graph), + Vertex_point_map vertex_point_map=boost::get(vertex_point, halfedge_graph), + Weight_calculator weight_calculator = Weight_calculator() + ); /// @} + #endif private: void init() {