Test the feature in the 3D demo, and fix the code

This commit is contained in:
Laurent Rineau 2019-05-03 16:24:50 +02:00
parent 8648a72655
commit 1b1f0a6ac3
3 changed files with 29 additions and 6 deletions

View File

@ -1197,6 +1197,7 @@ insert_balls(const Vertex_handle& vp,
dim,
index,
out);
if(forced_stop()) return out;
const Vertex_handle new_vertex = pair.first;
out = pair.second;
const FT sn = get_radius(new_vertex);
@ -1835,6 +1836,7 @@ walk_along_edge(const Vertex_handle& start, const Vertex_handle& next,
// and current intersects enough
while ( ! is_sampling_dense_enough(previous, current, curve_index, orientation) )
{
if(forced_stop()) return out;
*out++ = current;
// Don't go through corners
@ -1943,6 +1945,7 @@ repopulate(InputIterator begin, InputIterator last,
#endif // CGAL_MESH_3_PROTECTION_DEBUG
*out++ = *current;
c3t3_.triangulation().remove(*current);
if(forced_stop()) return out;
}
// Repopulate edge

View File

@ -197,7 +197,13 @@ template < typename C3T3, typename MeshDomain, typename MeshCriteria>
void init_c3t3_with_features(C3T3& c3t3,
const MeshDomain& domain,
const MeshCriteria& criteria,
bool nonlinear = false)
bool nonlinear = false,
std::size_t maximal_number_of_vertices = 0,
Mesh_error_code* pointer_to_error_code = 0
#ifndef CGAL_NO_ATOMIC
, CGAL::cpp11::atomic<bool>* pointer_to_stop = 0
#endif
)
{
typedef typename MeshCriteria::Edge_criteria Edge_criteria;
typedef Edge_criteria_sizing_field_wrapper<Edge_criteria> Sizing_field;
@ -206,7 +212,12 @@ void init_c3t3_with_features(C3T3& c3t3,
protect_edges(c3t3,
domain,
Sizing_field(criteria.edge_criteria_object()),
typename Edge_criteria::FT()
typename Edge_criteria::FT(),
maximal_number_of_vertices,
pointer_to_error_code
#ifndef CGAL_NO_ATOMIC
, pointer_to_stop
#endif
);
protect_edges.set_nonlinear_growth_of_balls(nonlinear);
@ -234,7 +245,13 @@ struct C3t3_initializer_base
{
return Mesh_3::internal::init_c3t3_with_features
(c3t3, domain, criteria,
mesh_options.nonlinear_growth_of_balls);
mesh_options.nonlinear_growth_of_balls,
mesh_options.maximal_number_of_vertices,
mesh_options.pointer_to_error_code
#ifndef CGAL_NO_ATOMIC
, mesh_options.pointer_to_stop_atomic_boolean
#endif
);
}
};

View File

@ -136,8 +136,8 @@ private:
private:
boost::any object_to_destroy;
C3t3& c3t3_;
Domain* domain_;
Mesh_parameters p_;
Domain* const domain_;
Mesh_parameters const p_;
std::atomic<bool> stop_;
Mesher* mesher_;
#ifdef CGAL_MESH_3_MESHER_STATUS_ACTIVATED
@ -237,6 +237,7 @@ Mesh_function<D_,Tag>::
initialize(const Mesh_criteria& criteria, Mesh_fnt::Domain_tag)
// for the other domain types
{
namespace p = CGAL::parameters;
// Initialization of the mesh, either with the protection of sharp
// features, or with the initial points (or both).
// If `detect_connected_components==true`, the initialization is
@ -250,7 +251,9 @@ initialize(const Mesh_criteria& criteria, Mesh_fnt::Domain_tag)
*domain_,
criteria,
p_.protect_features,
p_.use_sizing_field_with_aabb_tree);
p::mesh_3_options(p::pointer_to_stop_atomic_boolean = &stop_,
p::nonlinear_growth_of_balls =
p_.use_sizing_field_with_aabb_tree));
}
template < typename D_, typename Tag >