Use internal squared radius for backward compatibility

This commit is contained in:
Simon Giraudot 2017-04-28 18:18:18 +02:00
parent 09bdbad8e9
commit 6ab9c45851
3 changed files with 18 additions and 5 deletions

View File

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

View File

@ -99,6 +99,11 @@ public:
}
FT squared_radius()
{
return _squared_radius;
}
private:
void estimate_neighborhood_squared_radius ()

View File

@ -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 <typename InputIterator>
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.