From 9146027ecf2c770204ec0e3d7301874711b55e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20P=C3=A9an?= Date: Thu, 15 Oct 2020 00:23:47 +0200 Subject: [PATCH 1/2] Add const qualifier for getters in MCF skeletonization --- .../Mean_curvature_flow_skeletonization.h | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 3a799e96393..b30199f69cd 100644 --- a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h +++ b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h @@ -394,14 +394,14 @@ public: /// During the local remeshing step, a triangle will be split /// if it has an angle larger than `max_triangle_angle()`. - double max_triangle_angle() + double max_triangle_angle() const { return m_alpha_TH; } /// During the local remeshing step, an edge will be collapse /// if it is length is less than `min_edge_length()`. - double min_edge_length() + double min_edge_length() const { return m_min_edge_length; } @@ -423,7 +423,7 @@ public: /// @{ /// Maximum number of iterations performed by `contract_until_convergence()`. - std::size_t max_iterations() + std::size_t max_iterations() const { return m_max_iterations; } @@ -432,7 +432,7 @@ public: /// the meso-skeleton after one iteration is smaller than /// `area_variation_factor()*original_area` where `original_area` is the area of the input /// triangle mesh. - double area_variation_factor() + double area_variation_factor() const { return m_delta_area; } @@ -460,7 +460,7 @@ public: /// faster, but results in a skeleton of lower quality. /// This parameter corresponds to \f$ w_H \f$ in the original publication. /// \cgalAdvancedEnd - double quality_speed_tradeoff() + double quality_speed_tradeoff() const { return m_omega_H; } @@ -469,7 +469,7 @@ public: /// of the medial axis of the mesh during the contraction steps, so will be the result skeleton. // (an additional energy is used during the contraction using the Voronoi poles of the input triangulated mesh // as attractors). - bool is_medially_centered() + bool is_medially_centered() const { return m_is_medially_centered; } @@ -482,7 +482,7 @@ public: /// It is only used if `is_medially_centered()==true`. /// This parameter corresponds to \f$ w_M \f$ in the original publication. /// \cgalAdvancedEnd - double medially_centered_speed_tradeoff() + double medially_centered_speed_tradeoff() const { return m_omega_P; } @@ -526,7 +526,7 @@ public: * @param fixed_points * return the positions of fixed points */ - void fixed_points(std::vector& fixed_points) + void fixed_points(std::vector& fixed_points) const { fixed_points.clear(); for(vertex_descriptor vd : vertices(m_tmesh)) @@ -542,7 +542,7 @@ public: * @param non_fixed_points * return the positions of non-fixed points */ - void non_fixed_points(std::vector& non_fixed_points) + void non_fixed_points(std::vector& non_fixed_points) const { non_fixed_points.clear(); for(vertex_descriptor vd : vertices(m_tmesh)) @@ -558,7 +558,7 @@ public: * @param max_poles * for each surface mesh vertex, record its correspondent Voronoi pole position */ - void poles(std::vector& max_poles) + void poles(std::vector& max_poles) const { max_poles.resize(num_vertices(m_tmesh)); int cnt = 0; From 3de69ed6503ab5215ebb9d6bc7fe8206dad1da8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 19 Oct 2020 13:28:39 +0200 Subject: [PATCH 2/2] remove useless call --- .../include/CGAL/Mean_curvature_flow_skeletonization.h | 3 --- 1 file changed, 3 deletions(-) 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 b30199f69cd..33ff240de56 100644 --- a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h +++ b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h @@ -867,9 +867,6 @@ private: m_vertex_id_count = static_cast(num_vertices(m_tmesh)); m_max_id = m_vertex_id_count; - if (m_is_medially_centered) - compute_voronoi_pole(); - init_args(); }