From cac04ed1496a6c17c8c4b16dfa09c20999204595 Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Tue, 8 Jun 2021 13:36:09 +0200 Subject: [PATCH] quick mael review --- .../Surface_mesh_geodesic_distances_3.h | 15 ++++----- .../ARAP_parameterizer_3.h | 3 +- .../Discrete_authalic_parameterizer_3.h | 7 ++--- .../Discrete_conformal_map_parameterizer_3.h | 7 ++--- .../Iterative_authalic_parameterizer_3.h | 20 ++++++------ .../MVC_post_processor_3.h | 3 +- .../Mean_value_coordinates_parameterizer_3.h | 7 ++--- .../Orbifold_Tutte_parameterizer_3.h | 31 +++++++++---------- .../Mean_curvature_flow_skeletonization.h | 10 +++--- 9 files changed, 45 insertions(+), 58 deletions(-) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index ee0960da297..d8592b1346f 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -392,15 +392,12 @@ private: const FT cotan_k = CGAL::Weights::cotangent(p_j, p_k, p_i, traits); const Vector_3& a = m_X[face_i]; - const double i_entry = - (CGAL::to_double(scalar_product(a, v_ij) * cotan_k)) + - (CGAL::to_double(scalar_product(a, v_ik) * cotan_j)); - const double j_entry = - (CGAL::to_double(scalar_product(a, v_jk) * cotan_i)) + - (CGAL::to_double(scalar_product(a, v_ji) * cotan_k)); - const double k_entry = - (CGAL::to_double(scalar_product(a, v_ki) * cotan_j)) + - (CGAL::to_double(scalar_product(a, v_kj) * cotan_i)); + const double i_entry = (CGAL::to_double(scalar_product(a, v_ij) * cotan_k)) + + (CGAL::to_double(scalar_product(a, v_ik) * cotan_j)); + const double j_entry = (CGAL::to_double(scalar_product(a, v_jk) * cotan_i)) + + (CGAL::to_double(scalar_product(a, v_ji) * cotan_k)); + const double k_entry = (CGAL::to_double(scalar_product(a, v_ki) * cotan_j)) + + (CGAL::to_double(scalar_product(a, v_kj) * cotan_i)); indexD.add_coef(i, 0, (1./2)*i_entry); indexD.add_coef(j, 0, (1./2)*j_entry); diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h index 7e91b3d5cd5..33fef26c674 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h @@ -449,8 +449,7 @@ private: const Point_3& position_vj = get(ppmap, vj); const Point_3& position_vk = get(ppmap, vk); - const NT cot = CGAL::Weights:: - cotangent(position_vi, position_vj, position_vk); + const NT cot = CGAL::Weights::cotangent(position_vi, position_vj, position_vk); put(ctmap, hd, cot); } diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h index 06425c25b0e..aeb891cff92 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h @@ -180,15 +180,14 @@ protected: const Point_3& position_v_j = get(ppmap, *neighbor_vertex_v_j); vertex_around_target_circulator previous_vertex_v_k = neighbor_vertex_v_j; - previous_vertex_v_k--; + --previous_vertex_v_k; const Point_3& position_v_k = get(ppmap, *previous_vertex_v_k); vertex_around_target_circulator next_vertex_v_l = neighbor_vertex_v_j; - next_vertex_v_l++; + ++next_vertex_v_l; const Point_3& position_v_l = get(ppmap, *next_vertex_v_l); - return CGAL::Weights::authalic_weight( - position_v_k, position_v_j, position_v_l, position_v_i) / NT(2); + return CGAL::Weights::authalic_weight(position_v_k, position_v_j, position_v_l, position_v_i) / NT(2); } }; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h index 87a71d316ad..3d09fad861c 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h @@ -176,15 +176,14 @@ protected: const Point_3& position_v_j = get(ppmap, *neighbor_vertex_v_j); vertex_around_target_circulator previous_vertex_v_k = neighbor_vertex_v_j; - previous_vertex_v_k--; + --previous_vertex_v_k; const Point_3& position_v_k = get(ppmap, *previous_vertex_v_k); vertex_around_target_circulator next_vertex_v_l = neighbor_vertex_v_j; - next_vertex_v_l++; + ++next_vertex_v_l; const Point_3& position_v_l = get(ppmap, *next_vertex_v_l); - return CGAL::Weights::cotangent_weight( - position_v_k, position_v_j, position_v_l, position_v_i) / NT(2); + return CGAL::Weights::cotangent_weight(position_v_k, position_v_j, position_v_l, position_v_i) / NT(2); } }; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h index c75d15ea990..d8373eb54ba 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h @@ -636,29 +636,27 @@ private: Vertex_around_target_circulator neighbor_vertex_v_j) const { const PPM ppmap = get(vertex_point, tmesh); - const Point_3& position_v_i = get(ppmap, main_vertex_v_i); - const Point_3& position_v_j = get(ppmap, *neighbor_vertex_v_j); + const PPM_ref position_v_i = get(ppmap, main_vertex_v_i); + const PPM_ref position_v_j = get(ppmap, *neighbor_vertex_v_j); const Vector_3 edge = position_v_i - position_v_j; const NT squared_length = edge * edge; vertex_around_target_circulator previous_vertex_v_k = neighbor_vertex_v_j; - previous_vertex_v_k--; - const Point_3& position_v_k = get(ppmap, *previous_vertex_v_k); + --previous_vertex_v_k; + const PPM_ref position_v_k = get(ppmap, *previous_vertex_v_k); vertex_around_target_circulator next_vertex_v_l = neighbor_vertex_v_j; - next_vertex_v_l++; - const Point_3& position_v_l = get(ppmap, *next_vertex_v_l); + ++next_vertex_v_l; + const PPM_ref position_v_l = get(ppmap, *next_vertex_v_l); NT weight = NT(0); CGAL_assertion(squared_length > NT(0)); // two points are identical! - if (squared_length != NT(0)) { + if(squared_length != NT(0)) { // This version was commented out to be an alternative weight // in the original code by authors. - // weight = CGAL::Weights::authalic_weight( - // position_v_k, position_v_j, position_v_l, position_v_i) / NT(2); - weight = CGAL::Weights::cotangent_weight( - position_v_k, position_v_j, position_v_l, position_v_i) / NT(2); + // weight = CGAL::Weights::authalic_weight(position_v_k, position_v_j, position_v_l, position_v_i) / NT(2); + weight = CGAL::Weights::cotangent_weight(position_v_k, position_v_j, position_v_l, position_v_i) / NT(2); } return weight; } diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h index 0c3d44a85a2..87e54a7487e 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h @@ -393,8 +393,7 @@ private: const Point_2& p = pk; const Point_2& q = pi; const Point_2& r = pj; - const CGAL::Weights::internal:: - Tangent_weight_wrapper tangent_weight(p, q, r); + const CGAL::Weights::internal::Tangent_weight_wrapper tangent_weight(p, q, r); // Set w_ij in matrix const NT w_ij = tangent_weight.get_w_r(); diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h index 1e58a948351..95593adf95e 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h @@ -199,15 +199,14 @@ protected: const Point_3& position_v_j = get(ppmap, *neighbor_vertex_v_j); vertex_around_target_circulator previous_vertex_v_k = neighbor_vertex_v_j; - previous_vertex_v_k--; + --previous_vertex_v_k; const Point_3& position_v_k = get(ppmap, *previous_vertex_v_k); vertex_around_target_circulator next_vertex_v_l = neighbor_vertex_v_j; - next_vertex_v_l++; + ++next_vertex_v_l; const Point_3& position_v_l = get(ppmap, *next_vertex_v_l); - return CGAL::Weights::tangent_weight( - position_v_k, position_v_j, position_v_l, position_v_i) / NT(2); + return CGAL::Weights::tangent_weight(position_v_k, position_v_j, position_v_l, position_v_i) / NT(2); } }; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h index b3cfd6f063c..e524fca930c 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h @@ -722,24 +722,23 @@ private: const Point_3& p = pk; const Point_3& q = pi; const Point_3& r = pj; - const CGAL::Weights::internal:: - Tangent_weight_wrapper tangent_weight(p, q, r); + const CGAL::Weights::internal::Tangent_weight_wrapper tangent_weight(p, q, r); // Set w_ij in matrix const NT w_ij = tangent_weight.get_w_r(); - M.add_coef(2 * i, 2 * j, w_ij); - M.add_coef(2 * i + 1, 2 * j + 1, w_ij); + M.add_coef(2*i, 2*j, w_ij); + M.add_coef(2*i + 1, 2*j + 1, w_ij); // Set w_ik in matrix const NT w_ik = tangent_weight.get_w_p(); - M.add_coef(2 * i, 2 * k, w_ik); - M.add_coef(2 * i + 1, 2 * k + 1, w_ik); + M.add_coef(2*i, 2*k, w_ik); + M.add_coef(2*i + 1, 2*k + 1, w_ik); // Add to w_ii (w_ii = - sum w_ij) const NT w_ii = - w_ij - w_ik; - M.add_coef(2 * i, 2 * i, w_ii); - M.add_coef(2 * i + 1, 2 * i + 1, w_ii); + M.add_coef(2*i, 2*i, w_ii); + M.add_coef(2*i + 1, 2*i + 1, w_ii); } // Compute the mean value Laplacian matrix. @@ -789,20 +788,20 @@ private: const NT w_ij = NT(2) * cotangent_weight(hd, mesh, pmap); // ij - M.set_coef(2 * i, 2 * j, w_ij, true /* new coef */); - M.set_coef(2 * i + 1, 2 * j + 1, w_ij, true /* new coef */); + M.set_coef(2*i, 2*j, w_ij, true /* new coef */); + M.set_coef(2*i + 1, 2*j + 1, w_ij, true /* new coef */); // ji - M.set_coef(2 * j, 2 * i, w_ij, true /* new coef */); - M.set_coef(2 * j + 1, 2 * i + 1, w_ij, true /* new coef */); + M.set_coef(2*j, 2*i, w_ij, true /* new coef */); + M.set_coef(2*j + 1, 2*i + 1, w_ij, true /* new coef */); // ii - M.add_coef(2 * i, 2 * i, - w_ij); - M.add_coef(2 * i + 1, 2 * i + 1, - w_ij); + M.add_coef(2*i, 2*i, - w_ij); + M.add_coef(2*i + 1, 2*i + 1, - w_ij); // jj - M.add_coef(2 * j, 2 * j, - w_ij); - M.add_coef(2 * j + 1, 2 * j + 1, - w_ij); + M.add_coef(2*j, 2*j, - w_ij); + M.add_coef(2*j + 1, 2*j + 1, - w_ij); } } diff --git a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h index 2c6492cb236..0a71a381d69 100644 --- a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h +++ b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h @@ -223,8 +223,7 @@ public: typedef typename boost::graph_traits::edge_iterator edge_iterator; // Get weight from the weight interface. - typedef CGAL::Weights::internal:: - Cotangent_weight_wrapper Weight_calculator; + typedef CGAL::Weights::internal::Cotangent_weight_wrapper Weight_calculator; typedef internal::Curve_skeleton