From 6ab9c45851fd09ae2efca497e8a92729ac87b585 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Fri, 28 Apr 2017 18:18:18 +0200 Subject: [PATCH] Use internal squared radius for backward compatibility --- .../Alpha_shape_mesher.h | 6 ++++-- .../Weighted_PCA_smoother.h | 5 +++++ .../CGAL/Scale_space_surface_reconstruction_3.h | 12 +++++++++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h index 9ee89b4129e..8f3b252c729 100644 --- a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h +++ b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h @@ -100,13 +100,15 @@ private: public: - Alpha_shape_mesher (bool separate_shells = false, bool force_manifold = false, + Alpha_shape_mesher (FT squared_radius, + bool separate_shells = false, + bool force_manifold = false, FT border_angle = 45.) : _separate_shells (separate_shells), _force_manifold (force_manifold), _border_angle (border_angle), _shape (NULL), - _squared_radius (0.) + _squared_radius (squared_radius) { } diff --git a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Weighted_PCA_smoother.h b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Weighted_PCA_smoother.h index eeab2b87832..f720c51f828 100644 --- a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Weighted_PCA_smoother.h +++ b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Weighted_PCA_smoother.h @@ -99,6 +99,11 @@ public: } + FT squared_radius() + { + return _squared_radius; + } + private: void estimate_neighborhood_squared_radius () diff --git a/Scale_space_reconstruction_3/include/CGAL/Scale_space_surface_reconstruction_3.h b/Scale_space_reconstruction_3/include/CGAL/Scale_space_surface_reconstruction_3.h index d15a3ed7a99..56011ccd96b 100644 --- a/Scale_space_reconstruction_3/include/CGAL/Scale_space_surface_reconstruction_3.h +++ b/Scale_space_reconstruction_3/include/CGAL/Scale_space_surface_reconstruction_3.h @@ -47,12 +47,15 @@ private: Point_vector m_points; Facet_vector m_facets; + FT m_internal_squared_radius; // For backward compatibility + public: - Scale_space_surface_reconstruction_3 () { } + Scale_space_surface_reconstruction_3 () : m_internal_squared_radius(0.) { } template Scale_space_surface_reconstruction_3 (InputIterator begin, InputIterator end) + : m_internal_squared_radius (0.) { insert (begin, end); } @@ -118,7 +121,9 @@ public: void increase_scale (std::size_t iterations = 1) { - increase_scale (iterations, Weighted_PCA_smoother()); + Weighted_PCA_smoother smoother; + increase_scale (iterations, smoother); + m_internal_squared_radius = smoother.squared_radius(); } /// constructs a triangle mesh from the point set at a fixed scale. @@ -144,7 +149,8 @@ public: void reconstruct_surface () { - reconstruct_surface (Alpha_shape_mesher()); + CGAL_assertion (m_internal_squared_radius != 0.); + reconstruct_surface (Alpha_shape_mesher(m_internal_squared_radius)); } /// gives the number of points of the surface.