mirror of https://github.com/CGAL/cgal
remove default constructor for Connected_components_pmap
keep only one constructor, and compute the connected components only conditionally when they are needed
This commit is contained in:
parent
20c8e9a321
commit
0185563131
|
|
@ -180,26 +180,24 @@ namespace internal {
|
|||
typedef Patch_id& reference;
|
||||
typedef boost::read_write_property_map_tag category;
|
||||
|
||||
Connected_components_pmap(PM& pmesh)
|
||||
{
|
||||
patch_ids_map = add(boost::face_property_t<Patch_id>("PMP_patch_id"), pmesh);
|
||||
remove(patch_ids_map, pmesh);
|
||||
}
|
||||
|
||||
//note pmesh is a non-const ref because add() and remove()
|
||||
//modify the mesh data structure, but not the mesh itself
|
||||
Connected_components_pmap(PM& pmesh
|
||||
, EdgeIsConstrainedMap ecmap
|
||||
, FIMap fimap)
|
||||
, FIMap fimap
|
||||
, const bool do_init = true)
|
||||
{
|
||||
patch_ids_map = add(boost::face_property_t<Patch_id>("PMP_patch_id"), pmesh);
|
||||
nb_cc
|
||||
= PMP::connected_components(pmesh,
|
||||
patch_ids_map,
|
||||
PMP::parameters::edge_is_constrained_map(ecmap)
|
||||
.face_index_map(fimap));
|
||||
if(nb_cc == 1)
|
||||
remove(patch_ids_map, pmesh);
|
||||
if (do_init)
|
||||
{
|
||||
nb_cc
|
||||
= PMP::connected_components(pmesh,
|
||||
patch_ids_map,
|
||||
PMP::parameters::edge_is_constrained_map(ecmap)
|
||||
.face_index_map(fimap));
|
||||
if(nb_cc == 1)
|
||||
remove(patch_ids_map, pmesh);
|
||||
}
|
||||
}
|
||||
|
||||
friend void remove(CCMap m, PM& pmesh)
|
||||
|
|
|
|||
|
|
@ -178,11 +178,10 @@ void isotropic_remeshing(const FaceRange& faces
|
|||
NamedParameters,
|
||||
internal::Connected_components_pmap<PM, ECMap, FIMap>//default
|
||||
> ::type FPMap;
|
||||
FPMap fpmap = (boost::is_same<FPMap, internal::Connected_components_pmap<PM, ECMap, FIMap> >::value)
|
||||
? choose_param(get_param(np, internal_np::face_patch),
|
||||
internal::Connected_components_pmap<PM, ECMap, FIMap>(pmesh, ecmap, fimap))
|
||||
: choose_param(get_param(np, internal_np::face_patch),
|
||||
internal::Connected_components_pmap<PM, ECMap, FIMap>(pmesh));//do not compute cc's
|
||||
FPMap fpmap = choose_param(
|
||||
get_param(np, internal_np::face_patch),
|
||||
internal::Connected_components_pmap<PM, ECMap, FIMap>(pmesh, ecmap, fimap,
|
||||
boost::is_default_param(get_param(np, internal_np::face_patch))));
|
||||
|
||||
double low = 4. / 5. * target_edge_length;
|
||||
double high = 4. / 3. * target_edge_length;
|
||||
|
|
@ -339,7 +338,7 @@ void split_long_edges(const EdgeRange& edges
|
|||
remesher(pmesh, vpmap, false/*protect constraints*/
|
||||
, ecmap
|
||||
, internal::No_constraint_pmap<vertex_descriptor>()
|
||||
, internal::Connected_components_pmap<PM, ECMap, FIMap>(pmesh)
|
||||
, internal::Connected_components_pmap<PM, ECMap, FIMap>(pmesh, ecmap, fimap, false)
|
||||
, fimap
|
||||
, false/*need aabb_tree*/);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue